Are you following a tutorial from a book or something? If not you should be, trying to guess your way into developing C++ Windows applications will be a slo
>> The dialog box has to end the program by using PostQuitMessage() function.
Not really. If all you want is a modal dialog as your main window, you don't need a message loop. But call DialogBox(...) instead of CreateDialog, this will make the dialog modal.
DialogBox doesn't return until the dialog is over. Then after that, simply return a value in WinMain.
Quite True, apatterno.
I used the CreateDialog for a few reasons though.
1) It is close to the CreateWindowEx, and with the message loop it would probably be more easy to convert a simple 'main window' application to a 'main dialog' application.
2) Using the DialogBox() function is OK, but if you wanted to create another dialog or window, you would have to end the main dialog first.
A very good point though. I suppose it depends on what the dialog box is going to do. Adonai
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.