Im also stuck with SetLayeredWindowsAttributes... I am so insane with it that I am trying to get user32.lib to user32.a to see if it solves my problems :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
anybody know how to use the SetLayeredWindowAttributes function??
I use this code:
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
--------------------------------------------------------------
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes;
HMODULE hUser32 = GetModuleHandle("user32.dll");
SetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,"SetLayeredWindowAttributes");
-----------------------------------------------------------------------------
and
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(hwnd, 0, (255 * 70) / 100, LWA_ALPHA);
These are the errors:
ISO C++ forbids declaration of `
SetLayeredWindowAttributes' with no type
previous declaration as `BOOL
(*SetLayeredWindowAttributes)(HWND__*, long unsigned int, unsigned char,
long unsigned int)'
invalid conversion from `BOOL (*)(HWND__*, long unsigned
int, unsigned char, long unsigned int)' to `int'
In function `void RegionMe(HWND__*)':
`SetLayeredWindowAttributes' cannot be used as a function
I am aware that this only works on win2000 and XP (I have win2000) so that should not be the problem.
Anybody ?? Many thanks in advance
/Blackbird
Im also stuck with SetLayeredWindowsAttributes... I am so insane with it that I am trying to get user32.lib to user32.a to see if it solves my problems :(
The code above should load user32.dll dynamically and there was no error about unresolved external symbols . . .
/Blackbird
yes, please, I'm stuck at teh same prob . . .