Dear all experienced asm coders,

How can i create a window with a TRANSPARENT client area? It means the window contain borders, titlebar and menubar, and you can see through the desktop in the client area.

I tried mov WNDCLASSEX.hbrBackground, TRANSPARENT , but it fails

Posted on 2002-05-06 07:33:07 by yoursguideline
try NULL, but it has problems on redrawing...
Posted on 2002-05-06 07:36:03 by JCP
as far i know the only way to create (real) transparent
windows is to use regions... as you only want to see
through some parts of your window (client area,
whatever) the best solution would be to create a snapshot
of your window, save it as bmp and create a region over it
with rgnCreator (for example)... you can then take the
region data and throw it over your window... you'll need
no bitmaps or other garbage then... 2nd solution would
be a custom skinned window... (look in the algo section,
i posted an example a while ago)... this technique is very
easy but you'll end up including bitmaps in your resources.

maybe you can do something with the windows-paint msg's
too but that would be harder to implement i think...
Posted on 2002-05-06 08:27:36 by mob
I've never tried, but im confident this will work:

Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted

Combined with (b): CS_PARENTDC
Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance

Hope its helps
Posted on 2002-05-06 09:59:05 by NaN
Thanks for all your help.

By the way,
Does Windows 9x support WS_EX_TRANSPARENT ?
Posted on 2002-05-06 10:08:07 by yoursguideline
You have to check the MSDN to be sure: Here

But i would suspect it is, since it supports CreateWindowEx anyways.

Posted on 2002-05-06 10:46:20 by NaN