CDialog Transparent
-
Hallo, ich versuche meinen Dialog ein wenig Transparent zu machen mit
SetLayeredWindowAttributes(NULL,100,2);allerdings sagt er mir immer folgende Fehlermeldung:
error C3861: 'SetLayeredWindowAttributes': identifier not found, even with argument-dependent lookup
ich habe im linker gesagt User32.lib aber es funktioniert nicht.
-
BOOL MakeWindowTransparent(HWND hWnd, int value=255) { if(value > 255) value = 255; if(value < 0) value = 0; typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD); static PSLWA pSetLayeredWindowAttributes = NULL; HMODULE hDLL = LoadLibrary ("user32"); pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL, "SetLayeredWindowAttributes"); if(pSetLayeredWindowAttributes == NULL) return FALSE; SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | 0x00080000); if(GetLastError()) return FALSE; int result = pSetLayeredWindowAttributes (hWnd, 0, (int)(value), 0x00000002); return result; }