Click to See Complete Forum and Search --> : partially translucent layered window...


Mal Reynolds
October 28th, 2009, 05:24 PM
what i'm trying to achieve is similar to this image of Norton Internet Security 2009. (http://img229.imageshack.us/img229/8726/nis2009yt2.jpg) if you look closely you can see that the main background of the window is alpha blended and you can see the desktop behind it a little, yet the icons, text, and controls, 'child windows' and such have full opacity.

Here is my way of implementing this:
Note: UpdateLayeredWindow() is not compatible with child windows since it redirects drawing and foregoes WM_PAINT messages.
1) create a layered top-level popup window and set it's alpha with UpdateLayeredWindow().
2) create another top-level window the same size and set a transparent colorkey; then fill that entire window with that color, that way, only the child windows will be visible.
3) place the second window above the first and handle the appropriate window z-positioning and moving other window when one moves.

My Question:
Is this the most efficient way of implementing this, or is there a simpler way that I just havn't come across yet? I will if i have to, but i'd rather not do a dual-window approach. thank you for any input you may have!

Some12k
November 3rd, 2009, 03:34 PM
I'm interested in this as well. Anyone?

rajeev01
July 6th, 2011, 09:01 AM
I am also interested in this.

What is the consensus on this? Is the OP's method the most efficient.?

Thanks.

aamir121a
July 7th, 2011, 05:54 AM
Head over to Nokia QT , and have a look at this article

http://stackoverflow.com/questions/1333610/displaying-translucent-irregular-shaped-windows-with-qt

Developing translucent windows is nothing unique , this however is the easiest way to achieve them.

rajeev01
July 7th, 2011, 08:23 AM
Thanks aamir121a for the link.

I can't use QT in my project. I can only use win32 APIs.

TheGreatCthulhu
July 7th, 2011, 07:44 PM
You might want to check out this MSDN Magazine article: Layered Windows (http://msdn.microsoft.com/en-us/magazine/cc163698.aspx).

(It shows how to do it in MFC, but you should be able to figure out how to do the same in Win32 API.)

EDIT:
P.S. Also, see this: http://msdn.microsoft.com/en-us/library/ms997507.aspx