Preventing a child window to change its z-order?
-
Hallo, is there any possibility to prevent an embedded child window to change its z-order? My current problem is, I have an control embedded that brings itself into the front sporadically. Since it's embedded in one of my dialogs, the corresponding dialog is popping into the foreground, too. :( Within the application this causes an affected dialog to pop in front of another dialog the user could be working in at the same moment. For testing purposes I made a ::SetParent(controlHwnd, NULL). Once being a child of the desktop, it pops in front of any application now, not only on top of the application it was embedded in. Anyhow, since I have no chance to modify the control itself (no sources!), I am searching for a way to prevent the control of changing its z-order. Is there any chance to "pin" it? I have tried nearly all windows styles, but since the control seems to push itself into the front, I cannot do a lot against it this way. Perhaps subclassing the control's window and filtering some specific events? Any help appreciated! Thanks a lot in advance, Roland
-
Hallo, is there any possibility to prevent an embedded child window to change its z-order? My current problem is, I have an control embedded that brings itself into the front sporadically. Since it's embedded in one of my dialogs, the corresponding dialog is popping into the foreground, too. :( Within the application this causes an affected dialog to pop in front of another dialog the user could be working in at the same moment. For testing purposes I made a ::SetParent(controlHwnd, NULL). Once being a child of the desktop, it pops in front of any application now, not only on top of the application it was embedded in. Anyhow, since I have no chance to modify the control itself (no sources!), I am searching for a way to prevent the control of changing its z-order. Is there any chance to "pin" it? I have tried nearly all windows styles, but since the control seems to push itself into the front, I cannot do a lot against it this way. Perhaps subclassing the control's window and filtering some specific events? Any help appreciated! Thanks a lot in advance, Roland
This Article by Raymond Chen[^], might suggest a solution. Then again it might make things worse by confusing the issue. What you want to determine is why your control "brings itself into the front sporadically". It's being triggered by something, obviously. Here's another Interesting bit of z-order lore[^].