I have a layered window, having the size of the screen but being almost completely transparent. (apart from a little cross drawn where the user clicks)
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) wnd_top_rect_proc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = NULL;
wc.hCursor = LoadCursor(hInst, IDC_CROSS);
wc.hbrBackground= (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName= L"POGO_WND_TOP";
RegisterClass(&wc);
hWnd = CreateWindowEx(
WS_EX_TOPMOST | WS_EX_LAYERED,
L"POGO_WND_TOP", //class name
NULL, //wnd name
WS_POPUP, //style
0, 0, //x, y
screen.right-screen.left,//w
screen.bottom-screen.top,//h
g_hWnd, //parent
NULL, //menu
hInst, //instance
NULL); //lparam
SetLayeredWindowAttributes(hWnd, WND_TOP_BG, 0, LWA_COLORKEY);
ShowWindow(hWnd, SW_SHOW);
How can I set a custom cursor for this window, or for the whole desktop? I have specified a class cursor in the window class but it does not display it (I expect this to be because of the transparency)
Also, I'd like to know how is actually transparency manged in windows: why can't I get WM_LBUTTON
messages if the mouse is in the transparent area of the window? Isn't there any way to get transparent areas of the window working just like colored area?