Does it work if you use CreateWindow() rather than GetDesktopWindow()?
I would say GetDesktopWindow() is extremely unlikely to work. I would expect that to be unlike a normal window and the value you receive to be a special handle value.
If push comes to shove, just open a window without WS_VISIBLE. No one will be the wiser.
P.s. I note you're making this a console application. I will be quite surprised if console applications work with anything graphical, be it OpenGL or just the Windows 2D drawing API.
P.s.s I'm pretty sure Windows applications can write (one way or another) to the stdout of the command line they're run from. You could simply write a normal windows app, but just emit your output to stdout.
Blank Xavier
2009-04-03 17:11:04