I used in the main window DoModal method shows a modal window, and the main window is blocked, but in the new window and I made a key, want to return to the main window, how should do?
CodePudding user response:
The ShowWindow (SW_HIDE); And finally the OnOK () commented out,
Or only the OnOK () to ShowWindow (SW_SHOW);
CodePudding user response:
The
reference 1/f, 7-eleven's reply: the ShowWindow (SW_HIDE); And finally the OnOK () commented out, Or only the OnOK () to ShowWindow (SW_SHOW); if I put the ShowWindow (SW_HIDE) and the OnOK commented out, in my entrance into the city of new window, the main window is not blocking, still showed that OnOK commented out, and the debug will pop up a window. Exe has triggered a breakpoint CodePudding user response:
Modal dialog box you DoModal () returns, your dialog box is destroyed CodePudding user response:
reference 7-eleven's reply: 3/f you DoModal modal dialog box () returns after your dialog box is destroyed ~ before the return, I need to close the main window, in return, need to put the main window to display CodePudding user response:
You DoModal () before and after the call ShowWindow (SW_HIDE/SW_SHOW); Can, CodePudding user response:
refer to fifth floor 7-eleven's response: you DoModal () before and after the call ShowWindow (SW_HIDE/SW_SHOW); Can, in my return to the main window of the button function, use this -> DestroyWindow, then in the main window of DoModal after the SHOW, then the debug, still does not display the main window CodePudding user response:
ShowWindow (SW_HIDE); XXX DLG (this); DLG. DoModal (); ShowWindow (SW_SHOW); CodePudding user response:
Mean you in DoModal () shows you the NetworkManager class associated module dialog before and after the call ShowWindow to hide and display the main window, not to destroy the main window, DetroyWindow calls are destroyed a modal dialog box, and the modal dialog box is to call EndDialog () to destroy, EndDialog for a modal dialog box just hide the window, you can subsequent calls to ShowWindow (SW_SHOW) will be displayed, Such as your button in the main dialog BN_CLICKED response function NetworkManager class associated modal dialog box pops up in C: the main dialog box class Dlg: OnBnClicked () { ShowWindow (SW_HIDE); NetworkManager DLG. DLG. DoModal (); ShowWindow (SW_SHOW); } Do not need additional processing can, rest, CodePudding user response:
reference 7-eleven's reply on the eighth floor: Mean you in DoModal () shows you the NetworkManager class associated module dialog before and after the call ShowWindow to hide and display the main window, not to destroy the main window, DetroyWindow calls are destroyed a modal dialog box, and the modal dialog box is to call EndDialog () to destroy, EndDialog for a modal dialog box just hide the window, you can subsequent calls to ShowWindow (SW_SHOW) will be displayed, Such as your button in the main dialog BN_CLICKED response function NetworkManager class associated modal dialog box pops up in C: the main dialog box class Dlg: OnBnClicked () { ShowWindow (SW_HIDE); NetworkManager DLG. DLG. DoModal (); ShowWindow (SW_SHOW); } Elsewhere, don't need additional processing, thank you, see what you mean CodePudding user response:
CodePudding user response:
https://blog.csdn.net/schlafenhamster/article/details/7212299 Application was initially based on CDialog hidden method "revisited