How do I prevent my dialog boxes from quiting when the escape key is pressed/
How do I prevent my dialog boxes from quiting when the escape key is pressed/
There are several solutions. You could override OnClose() and only call the inherited class close function on conditions or you could disable ESE all together.
GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, MF_ENABLED);
GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, MF_DISABLED);
Kuphryn
1\ Change the ID of the Cancel Button:it Must be differ from (IDCANCEL),
2/ and then Creat new Function that will react when you click the button (it must deffer from "OnCancel ";
your new function will Call the virtual Function (CButton::OnCancel);
3/ Creat new function as a member of your dialog class and its name must be OnCancel() this Function will do nothing.
try this way!