How can I make windows send a WM_INITIALIZE to a dialog box, every time the box is opened.
What I'm seeing now is that the first time I open the dialog, windows sends a WM_INITIALIZE and I can populate the controls of the box. However if I close the box, then open it again, WM_INITIALIZE doesn't get sent, and the contents of the box may be wrong.
Is there a WM_OPEN message (or anything like it), so I have some way of knowing when the box is re-opened?
Or is there some other standard way ofhandling these situations.
What I'm seeing now is that the first time I open the dialog, windows sends a WM_INITIALIZE and I can populate the controls of the box. However if I close the box, then open it again, WM_INITIALIZE doesn't get sent, and the contents of the box may be wrong.
Is there a WM_OPEN message (or anything like it), so I have some way of knowing when the box is re-opened?
Or is there some other standard way ofhandling these situations.
WM_INITDIALOG
WM_INITDIALOG
Hm, you're saying you don't get WM_INITDIALOG second time you
create a dialog box? Weird, for I do :)
create a dialog box? Weird, for I do :)
Hm, you're saying you don't get WM_INITDIALOG second time you
create a dialog box? Weird, for I do :)
I can think of four ways to make a dialog box disappear.
1) Minimize or hide the owning (parent) window. In this case, the dialog box is merely hidden, not destroyed.
2) Minimize or hide the dialog box (ShowWindow). You may get a button showing up somewhere, either in the owning window or on the desktop. Once again the dialog box is not destroyed.
3) Cover the dialog box with another window. Need I mention that the dialog box isn't destroyed?
4) Actually destroy the dialog box with EndDialog (modal) or DestroyWindow (nonmodal). In this case only, the window gets destroyed and a new WM_INITDIALOG sent when the dialog box is "reopened". Note: after calling EndDialog (which works only on modal dialogs), you must exit the dialog proc to destroy the window.
1) Minimize or hide the owning (parent) window. In this case, the dialog box is merely hidden, not destroyed.
2) Minimize or hide the dialog box (ShowWindow). You may get a button showing up somewhere, either in the owning window or on the desktop. Once again the dialog box is not destroyed.
3) Cover the dialog box with another window. Need I mention that the dialog box isn't destroyed?
4) Actually destroy the dialog box with EndDialog (modal) or DestroyWindow (nonmodal). In this case only, the window gets destroyed and a new WM_INITDIALOG sent when the dialog box is "reopened". Note: after calling EndDialog (which works only on modal dialogs), you must exit the dialog proc to destroy the window.
4) Actually destroy the dialog box with EndDialog (modal) or DestroyWindow (nonmodal). In this case only, the window gets destroyed and a new WM_INITDIALOG sent when the dialog box is "reopened". Note: after calling EndDialog (which works only on modal dialogs), you must exit the dialog proc to destroy the window.
Thanks for the help.