View Full Version : Transparent OpenGL window

06-25-2003, 08:01 PM
Is there any way to make the OpenGL window transparent so that I can see the desktop through it where there is no geometry displayed? I'm mainly interested in a solution for Windows XP but a general solution would certainly be of interest.

06-25-2003, 09:03 PM
The problem is simply of wild imagination.
i don't know if this works ,but you can try the win32 api SetBkMode(hdc,TRANSPARENT).

06-25-2003, 10:39 PM
I just tried and found the SetBkMode is of no use at all. However, accidently in digging into the msdn , i found the layer Window might be works.

This is sample command.
CreateWindowEx(WS_EX_LAYERED | // Layered Windows
WS_EX_TRANSPARENT | // Don't hittest this window
gszFade, gszFade, WS_POPUP | WS_VISIBLE, prc->left,
prc->top, 0, 0, NULL, (HMENU)0, ghinst, NULL);

For more ,please look into the MSDN.I might as well give it try.
One more thing, the layered window is only applicable in win 2k and xp .

[This message has been edited by RunningRabbit (edited 06-26-2003).]

06-27-2003, 09:57 PM
I am using Glut. In the display function, do not call glClear. This makes your window use the data on the video card before it was created - i.e. the desktop. You can then copy this to a buffer and do whatever u want with it. Change the display function after that. A screensaver is a good example. But I guess you want to make your window transparent so that changes to the desktop can be seen via the window. I haven't found a solution to this yet.


06-28-2003, 08:08 PM
Ah that's a good start - I'll give it a whirl. Please do post if you think of anyway to have the lower windows update the texture. Maybe something is possible with a global window hook.

06-30-2003, 04:37 AM
Try playing with the Win32 API function, SetWindowRgn.