0

Possible Duplicate:
Transparent window containing opaque text and buttons

I'm trying to manipulate an existing window with C++.

Basically, what I'm trying to do is set the parent window transparent via first setting its window style to WS_EX_LAYERED and then using SetLayeredWindowAttributes() with the right values.

The problem is that that will set the child windows to transparent also, which will make the whole program transparent (obviously a problem).

Any ideas?

EDIT Image demonstrating the problem: enter image description here

As you might see, I set the taskbars window style to WS_EX_LAYERED, but for example the window MSTaskSwWClass (the window that has the running application icons) is also affected.

EDIT2 Tried UpdateLayeredWindow() with the exact same outcome.

Community
  • 1
  • 1
  • Even if the problem is pretty similar, I don't think the answers will be the same. First of all, I'm not creating the window myself, second I'm not using any bitmaps nor GDI(+). Also, I tried dicking around with UpdateLayeredWindow(), but it didn't change anything (might be because I don't understand how to use it..) –  Oct 25 '12 at 15:10
  • 1
    The opacity and transparency effects you ask for will always be applied to any child windows as well. The only way to avoid this is to put a top-level window on top of that parent window. – Hans Passant Oct 25 '12 at 15:27
  • ...How would I do that in this case..? –  Oct 25 '12 at 15:35

1 Answers1

0

As of http://msdn.microsoft.com/en-us/library/windows/desktop/ms633540%28v=vs.85%29.aspx

Windows 8: The WS_EX_LAYERED style is supported for top-level windows and child windows. Previous Windows versions support WS_EX_LAYERED only for top-level windows.

So it will not set layered attribute to 'child' windows.

Show us screenshot and/or code.

rkosegi
  • 14,165
  • 5
  • 50
  • 83