Z-ordering, wndTopMost and modal dialogs
-
Hi All, I was wondering if anyone had some advice regarding a z-ordering issue I'm having with my application. For some background, part of my app's functionality if video playback, and the app has a modeless 'VCR' dialog, that allows users to skip forward a frame at a time, play, pause, skip to the end, etc etc. I wanted to keep this dialog above the video windows, so I followed Nish's advice in http://www.codeproject.com/dialog/dlgboxtricks.asp (Making your dialog stay on top), and added the appropriate SetWindowPos( &wndTopMost, .....) call in the VCR dialog's InitDialog(). This worked great, but I've now noticed a problem. When the app shows modal dialogs (a preferences dialog, for example), they are shown underneath the VCR dialog. However, because the preferences dialog is modal, I can't move the VCR dialog out of the way because it won't get focus. So my question is, what's the best way to ensure that modal dialogs are shown ABOVE the modeless VCR dialog, while video windows, etc are shown below it. Do I need to add SetWindowPos() calls to OnInitDialog() for every modal dialog in the application, or is there a way of specifying that the VCR control is shown ABOVE regular windows but below modal dialogs? Any advice would be greatly appreciated. Cheers, Pete
-
Hi All, I was wondering if anyone had some advice regarding a z-ordering issue I'm having with my application. For some background, part of my app's functionality if video playback, and the app has a modeless 'VCR' dialog, that allows users to skip forward a frame at a time, play, pause, skip to the end, etc etc. I wanted to keep this dialog above the video windows, so I followed Nish's advice in http://www.codeproject.com/dialog/dlgboxtricks.asp (Making your dialog stay on top), and added the appropriate SetWindowPos( &wndTopMost, .....) call in the VCR dialog's InitDialog(). This worked great, but I've now noticed a problem. When the app shows modal dialogs (a preferences dialog, for example), they are shown underneath the VCR dialog. However, because the preferences dialog is modal, I can't move the VCR dialog out of the way because it won't get focus. So my question is, what's the best way to ensure that modal dialogs are shown ABOVE the modeless VCR dialog, while video windows, etc are shown below it. Do I need to add SetWindowPos() calls to OnInitDialog() for every modal dialog in the application, or is there a way of specifying that the VCR control is shown ABOVE regular windows but below modal dialogs? Any advice would be greatly appreciated. Cheers, Pete
Windows is doing just what you told it to do, showing the VCR dialog above all other windows. You'll need to either make the modal dlg topmost as well, or temporarily make the VCR dialog non-topmost while the modal dialog is up. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb