Destroying a dialog box.
-
I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John
-
I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John
Use EndDialog() function. Cheers!!! :beer: Carlos Antollini.
-
I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John
To programatically close the dialog, fake an OK (or Cancel) button-click by doing:
PostMessage (WM_COMMAND, IDOK); // fake an OK
Post Message (WM_COMMAND, IDCANCEL); // fake a CancelThis should cause your dialog to close as if the user clicked OK. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com