Link to home
Start Free TrialLog in
Avatar of MattG
MattG

asked on

Dialog applications and a tricky situation

This i know is gonna be simple but it is foxing me.

I have a dialog based application.  On the main form it minimizes and maximises correctly, if i open a pop-up dialog from the main dialog then minimize the pop-up box it minimizes to the corner of the desktop not the taskbar, leaving the parent window showing (disabled) on the desktop.

I have tried <popupdialog>->SetParent(this) before calling DoModal but this creates an exception.  Has anybody any ideas what i am doing wrong.

Thanks

Matt
Avatar of jhance
jhance

The problem is that you're calling DoModal().  DoModal creates (believe it or not) a MODAL dialog.  The DEFINITION of MODAL is that the modal dialog MUST BE RESOLVED before the appliation can continue.  Minimizing a modal window does not resolve it.

You need to create a non-modal dialog.  See this for an example of how to do it:

http://www.codeguru.com/dialog/dialogMcManus.shtml
Avatar of ambience
by the way why dont you remove the minimize button from the modal dialog ?
Avatar of MattG

ASKER

Thanks for your responces guys.  I worked it out.  You have to set the property 'application window' of the dialog to true, and use SW_HIDE adn SW_RESTORE to hide the parent window(s).

Thanks

Matt
This question didn't show any activity for more than 21 days. I will ask Community Support to close it unless you finalize it yourself within 7 days.
You can always request to keep this question open. But remember, experts can only help if you provide feedback to their comments.
Unless there is objection or further activity,  I will suggest to

    "refund the points and PAQ at zero points"

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
========
Werner
ASKER CERTIFIED SOLUTION
Avatar of Mindphaser
Mindphaser

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial