Hello everybody,

I wonder if anybody knows how to make a dialog box created from a window menu disable that menu while the dialog is displayed. I mean like the ShellAbout dialog behaviour.

thanks and best regards,

Posted on 2002-02-11 23:25:37 by czDrillard
Hi CzDrillard

Use DialogBoxParam to show the dialog modal.

Posted on 2002-02-12 04:04:33 by KetilO
Thanks Ketilo but if you mean DS_SYSMODAL it sets style similar to windows WS_EX_TOPMOST this does not disable the window menu and buttons like ShellAbout dialog box which is what I must do, or do I misunderstand your meaning?

best regards,

Posted on 2002-02-12 22:15:08 by czDrillard
Hi czDrillard

DS_SYSMODAL and WS_EX_TOPMOST are just styles and does not prevent you from accessing the parent window.

invoke DialogBoxParam,....

and the parent window will be disabled as long as the dialogbox is shown.

Posted on 2002-02-13 02:27:49 by KetilO
Thanks KetilO, and of course you are right :) this does work very well.

Btw, is there any comparable procedure that I can achieve the same with windows, not just dialog boxes?

best regards,

Posted on 2002-02-13 19:48:48 by czDrillard
If your About box is not a dialog box, you can use

invoke EnableWindow, parentWindow, FALSE

to disable the parent/owner window, and use

invoke EnableWindow, parentWindow, TRUE

to re-enable it.
Posted on 2002-02-13 22:01:17 by tank
Thanks tank for your suggestion. I tried this and it works, but not quite the same. For example I can still open another window then the parent window is reduced to an icon and is disabled. But when I click on the icon it comes back on top although still disabled. This looks kinda messy but if this is the only choice then I will take it. :)

best regards,

Posted on 2002-02-14 08:55:25 by czDrillard
In the CreateWindowEx that creates the About box, make sure the parent/owner argument is set to the owner window. This ensures the owner window is always behind the About box.

That's the way the owner argument (OK, so it's called the parent in some docs) in DialogBoxParam works.

If you want to reduce the owner to an icon while displaying the About box...the above will probably kill that feature.
Posted on 2002-02-14 12:34:41 by tank
Thanks tank,
That does it:)

best regards,

Posted on 2002-02-15 08:55:17 by czDrillard