Dialog closes on Escape
-
Hi all; I have an application which has a log-in menu. The whole stuff works fine but the only problem is that if a user hits "Escape" while my log-in menu is on, the thing just disappears leaving him/her with all the program functionality without even logging on the system!! Obviously something's going wrong! Can u please help me to stop the dialog from closing when i hit Escape. Thank you guys; Regards Krugger
-
Hi all; I have an application which has a log-in menu. The whole stuff works fine but the only problem is that if a user hits "Escape" while my log-in menu is on, the thing just disappears leaving him/her with all the program functionality without even logging on the system!! Obviously something's going wrong! Can u please help me to stop the dialog from closing when i hit Escape. Thank you guys; Regards Krugger
See the FAQ 7.4 How do I prevent a dialog from closing when the user presses Enter or Esc?[^] --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy
-
Hi all; I have an application which has a log-in menu. The whole stuff works fine but the only problem is that if a user hits "Escape" while my log-in menu is on, the thing just disappears leaving him/her with all the program functionality without even logging on the system!! Obviously something's going wrong! Can u please help me to stop the dialog from closing when i hit Escape. Thank you guys; Regards Krugger
I use this approach:
BOOL CDejavuDlg::PreTranslateMessage(MSG* pMsg)
{
// Prevent escape key from closing application window
if(pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN))
return FALSE;return CDialog::PreTranslateMessage(pMsg);
}
The word of the day is legs, let's go back to my house and spread the word ;P