How to achieve transparent windows

xiaoxiao2021-03-06  64

With pictures transparent interface, the following method is applicable only WINDOWS2000 and XP systems: Add in the dialog box initialization function: #define LWA_COLORKEY 0x00000001 #define WS_EX_LAYERED 0x00080000 typedef BOOL (WINAPI * lpfnSetLayeredWindowAttributes) (HWND hWnd, COLORREF crKey, BYTE bAlpha?? , DWORD dwFlags); lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes; // disposed edges of the transparent COLORREF maskColor = RGB (0,255,0); HMODULE hUser32 = GetModuleHandle ( "user32.dll"); SetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes) GetProcAddress (hUser32, "SetLayeredWindowAttributes"); SetWindowLong (GetSafeHwnd (), GWL_EXSTYLE, GetWindowLong (GetSafeHwnd (), GWL_EXSTYLE) │ WS_EX_LAYERED);?? SetLayeredWindowAttributes (GetSafeHwnd (), maskColor, 255, LWA_COLORKEY); FreeLibrary (hUser32); maskcolor which is transparent color, that is the What color zone is set to transparent

转载请注明原文地址:https://www.9cbs.com/read-119888.html

New Post(0)