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?
Try Spy to get the correct order of the Windows . I had written this code sometime back, not sure if I have it with me right now . However Spy helped me a lot. Though this link has nothing to do with the desktop - http://blogs.msdn.com/b/oldnewthing/archive/2004/07/20/188696.aspx , you might get some help from this too.