Click here to Skip to main content
16,012,352 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow do we hide Modal Dialog Boxes? Pin
waxie17-Jan-06 23:30
waxie17-Jan-06 23:30 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
toxcct17-Jan-06 23:32
toxcct17-Jan-06 23:32 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
waxie17-Jan-06 23:44
waxie17-Jan-06 23:44 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
ThatsAlok18-Jan-06 0:07
ThatsAlok18-Jan-06 0:07 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
Cedric Moonen17-Jan-06 23:44
Cedric Moonen17-Jan-06 23:44 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
waxie17-Jan-06 23:48
waxie17-Jan-06 23:48 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
toxcct17-Jan-06 23:51
toxcct17-Jan-06 23:51 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
Cedric Moonen17-Jan-06 23:59
Cedric Moonen17-Jan-06 23:59 
Wow, I think your are mixing everything Unsure | :~

Ok, first, using a modeless dialog box is still done with a ressource. In fact the only thing that changes is that it lets the user work with the rest of your program. Let's take an example:

CMyModalDlg Dlg;<br />
Dlg.DoModal();<br />
MessageBox("Test message");

If you run this code, you will see that the "Test message" (message box) will only be displayed when you close your modal dialog. It means that your program 'stops' at this line to let the message box receive the inputs from the user. Once the dialog is closed, the DoModal function is exited and your program continues. But this also means that your program main loop is not processed thus you cannot work with the rest of your application (I think you already discovered that).

Now, if instead of using a dialog box, you use a modeless one, you won't call the DoModal function (but rather simply ShowWindow) and thus, your program will continue and show immediatley the message box. This means also that you will still be able to 'work' with the rest of your program (click on buttons,...). I suggest you to search for modeless articles on this website to see how to use them.

In your example, you won't be able to have two moal dialogs (because of what I explained below). Or, the only way to do it is to open one 'inside the code' of the first one. But, then the first one won't be refreshed and processed.

I suggest that you buy yourself a book about the MFC because you are lacking some important concepts there. And it is impossible to explain in detail through a forum.

Hope this helps
GeneralRe: How do we hide Modal Dialog Boxes? Pin
waxie18-Jan-06 0:19
waxie18-Jan-06 0:19 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
Cedric Moonen18-Jan-06 0:52
Cedric Moonen18-Jan-06 0:52 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
Prakash Nadar17-Jan-06 23:57
Prakash Nadar17-Jan-06 23:57 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
vallikumar17-Jan-06 23:59
vallikumar17-Jan-06 23:59 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
ThatsAlok18-Jan-06 0:07
ThatsAlok18-Jan-06 0:07 
AnswerRe: How do we hide Modal Dialog Boxes? Pin
Owner drawn18-Jan-06 0:18
Owner drawn18-Jan-06 0:18 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
ThatsAlok18-Jan-06 0:39
ThatsAlok18-Jan-06 0:39 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
Owner drawn18-Jan-06 0:41
Owner drawn18-Jan-06 0:41 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
ThatsAlok18-Jan-06 0:44
ThatsAlok18-Jan-06 0:44 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
Owner drawn18-Jan-06 0:47
Owner drawn18-Jan-06 0:47 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
toxcct18-Jan-06 0:57
toxcct18-Jan-06 0:57 
GeneralRe: How do we hide Modal Dialog Boxes? Pin
ThatsAlok18-Jan-06 1:24
ThatsAlok18-Jan-06 1:24 
QuestionCRichEditView in a Property Page Pin
MartyWorkingAtTi17-Jan-06 23:08
MartyWorkingAtTi17-Jan-06 23:08 
AnswerRe: CRichEditView in a Property Page Pin
vallikumar17-Jan-06 23:22
vallikumar17-Jan-06 23:22 
QuestionChange Icon Pin
sweep12317-Jan-06 22:48
sweep12317-Jan-06 22:48 
AnswerRe: Change Icon Pin
Anilkumar K V17-Jan-06 23:15
Anilkumar K V17-Jan-06 23:15 
AnswerRe: Change Icon Pin
vallikumar17-Jan-06 23:41
vallikumar17-Jan-06 23:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.