When you open up visual studio (2005) and look at the dialog properties in the behavior section there is a "system modal" property with a drop down selection that you can use to set it to true or false. If set true the dialog then upon initialization will be top most and can't be covered by any other window. If I use the top most as you suggest that all it does it, it makes the dialog top most but if I click on any other window that can cover it, that dialog will be then hidden by it.
Main Topics
Browse All Topics





by: ZoppoPosted on 2009-10-28 at 08:01:30ID: 25683991
Hi Kejtar,
what you mean with system-modal (with style DS_SYSMODAL) is nothing else than makeing the dialog top-most - here's a short quote from MSDN about DS_SYSMODAL:
"This style is obsolete and is included for compatibility with 16-bit versions of Windows. If you specify this style, the system creates the dialog box with the WS_EX_TOPMOST style. This style does not prevent the user from accessing other windows on the desktop."
So, IMO what you need to do is simply make your dialog a top-most window - for this you can use SetWindowPos, i.e. from the dialog's OnInitDialog somehow like this:
> BOOL CMyDialog::OnInitDialog()
> {
> ...
> CDialog::OnInitDialog();
>
> SetWindowPos( &wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
> ...
> }
Hope that helps,
ZOPPO