views:

260

answers:

1

We place our transparent app window, over the window of another process. Our window contains some child controls. We create a WS_EX_LAYERED window, using colorkey for selective transparency. The main window is completely transparent, so it only functions as a container for the child controls.

This works fine on XP and Vista without Aero. However, on Vista with Aero clicks do not pass through the transparent area. What can we do?

Using WS_EX_TRANSPARENT fails, it makes our own controls inoperable, of course.

I have considered hiding the parent window (WS_SHOWWINDOW), but I am fairly certain that that will hide all children, and AFAIK resizing the window to a minimal size, with any combination of CLIPCHILDREN & CLIPSIBLINGS would fail in a similar way...

Thanks for any help.

+1  A: 

Another option is to use a window region and not WS_EX_LAYERED

Anders
Thanks, I am aware of regions, but I think it could become rather tedious to create regions over 30+ text and button elements. But still, maybe it is worth reconsidering.
Adam
Well, they are all child controls and it is easy to get their RECT
Anders
tedious? thats why you're a programmer - to automate tedium. Generating a region from rects is trivial, from other shapes a bit more tricky. but region based window clipping is far far better supported on windows 6.0 and 6.1 than WS_EX_LAYERED with a colorkey.
Chris Becke
Thanks Anders, I got over my hangup and tried it. Works like a dream. Kempegrejt!Chris, WS_EX_LAYERED has been supported since W2K, and I have not seen any documentation claming that it would not work Vista or later. (And in fact, it only fails with Aero switched on). Do you have any pointers where I could follow up? Thx.
Adam
Yes, it would be nice to know why it was not working with WS_EX_LAYERED
Anders