hey,

i'm having a problem understanding the difference between using a modeless dialog box as the main window, as opposed to using a modal dialog box as the main window

i looked in the win32 api and it said for custom dialog boxes (such as when u're using it as the main window), u have to create and then register your own window class...and then, in the window procedure, you have to use DefDlgProc instead of DefWindowProc

in iczelion's tutorials (tutorial #10, first part, using modeless dialog box as window), he creates and registers the window class, but instead of using DefDlgProc in the window procedure, he uses DefWindowProc...but it works just fine...how come? shouldn't DefDlgProc be used instead? i changed it to DefDlgProc and it made no difference, worked same as before...whats happening?

and then, in the next part of that same tutorial, (using modal dialog box as main window), he doesn't create and register any window class...just makes the call to DialogBoxParam which uses CreateWindowEx to create all the child windows and enters its own loop...how come we could get away without creating and registering any window class this time?

thanks :D
Posted on 2003-02-21 18:40:39 by AnotherWay83
hi

i am also having the same doubt. however i can help you some though.
if u notice the first example , you will notice that he uses a custom class to be used as a dialob box. if we use a custom class, then we must use wndproc rather than dlgproc because in custom classes we have to manage the default message processing. we also have to add a class line in the resource file.


while if we use default dialog box class we dont use wndproc. because dialog box class have its own message processing,
the diff between createdialogparam and dialogboxparam is that in former we have to manually specify message loop and tab handling while in latter , it is done automatically.

my doubt is in ending the dialog box,. can we use destroy window,postquit message, or do we need exitprocess when we use enddialog. iam totally confused about the exitting part.

i usually prefer dialogboxparam.
Posted on 2003-03-02 10:13:22 by madhur_ahuja
i think if we use a modeless dialog box,we should DestroyWindow,PostQuitMessage,and call ExitProcess.
but if we use a model dialog box,we can use DestroyWindow to
destroy the dialogbox,but when we use PostQuitMessage send
message to the dialog box manage,it will ignor it,so the message loop
remain exist.what is we should do is to use EndDialg to destroy dialog box
and end message loop,then use ExitProcess.
Posted on 2004-11-12 00:47:02 by geegle