Dialog applications and a tricky situation

MattG
MattG used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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
by the way why dont you remove the minimize button from the modal dialog ?

Author

Commented:
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

Commented:
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
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial