views:

101

answers:

1

I have an ActiveX control that gets placed in an IE browser container. The control creates another dialog window that has WS_POPUP and WS_LAYERED properties enabled in order to be able to use SetLayeredWindowAttributes(...) function to accomplish color keyed transparency and alpha blending on top of the control.

Because the WS_LAYERED property cannot be used in conjunction with WS_CHILD property the management of the window visibility is not automatic. I need to be able to detect when the ActiveX control is no longer visible (i.e. because the browser tab was changed or minimized) so I can change the visibility of the overlay window.

I have tried to use some of the existing window messages (WM_) to determine this change but have not seen them fire when the IE browser tab is changed. Does anyone know the best way to capture when these visibility changes are happening?

+2  A: 

If you aren't seeing a WM_SHOWWINDOW notification, then your window is being covered over rather than hidden. There is no Windows message that will tell you when your ActiveX control has been covered over. You need to look for notifications from the browser.

Or come up with a solution that doesn't use a WS_POPUP window. Perhaps you could use AlphaBlend to do your own color keying rather than relying on the implied AlphaBlend behavior of SetLayeredWindowAttributes.

John Knoeller
Yeah a WM_SHOWWINDOW notification in the control doesn't occur either when the tab is changed or even if the browser window is minimized. How would I go about intercepting and interpreting notifications from the browser?
flawlesslyfaulted
I can create an "OWNED" window as mentioned on msdn but that only solves the minimize problem not the tab change issue.http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx#owned_windows"-An owned window is always above its owner in the z-order.-The system automatically destroys an owned window when its owner is destroyed.-An owned window is hidden when its owner is minimized."
flawlesslyfaulted
If the browser isn't _giving_ your control any notifications, then you need to look for a solution that doesn't use a WS_POPUP window. I don't think you will be able to _intercept_ anything reliably. The popup window is just a deadend, sorry.
John Knoeller
Yes, you should never create an unowned popup window, so minimize of the browser is not a problem, but there is still no general purpose solution for switching tabs unless the browser provides one.
John Knoeller