I'm trying to draw an animation to the desktop(A polar clock is my final goal), but I can't seem to manage to draw to the desktop.
I can get the handle and the DC for the window with this code:
HWND progMan = FindWindow("progMan", NULL); HWND shellDLL = FindWindowEx(progMan, NULL, "SHELLDLL_DefView", NULL); HWND sysList = FindWindowEx(shellDLL, NULL, "SysListView32", NULL); HDC hdc = GetDC(progMan);
and I can use this code to write text, which works when getting at other windows or controls:
while(true) TextOut(hdc, 50, 50, "Hello World!", 13);
but I can't seem to manage to get it to work on the SysListView32 control.
Is this some quirk of Windows 7 or is my code just bugged?
Edit: I'd like to get this to work, but worst-case, does anyone else have any other method of drawing to the desktop behind the icons?