I have been testing out your overlay desktop demo, and find it very well put together.
I do have a simple question I hope.
What would it take to make a directx or opengl version of this code to display a simple rotating box instead of the static on the screen?
What would be different from your normal DirectX or OpenGL program is that you need to copy the rendered scene to the overlay surface. This would require a lock on the render target, a slow video-to-system memory read, a conversion to the pixel format of the overlay surface (often one of the YUV), then a copy to the surface. Of course you would have to set up DirectX/OpenGL to render to an offscreen buffer without affecting current desktop.
What are you planning to do with the program? If you're doing it just for fun I'd say go right ahead. But if you want to learn how to do it order to something special with afterwards you might want to reconsider. You'll soon find out that overlay surfaces and the way they work are widely different from card vendor to card vendor. Some vendors may not even support overlay surfaces at all, others may not support destination color keying, etc.