|
-
Sep 2nd, 2000, 06:50 AM
#1
Thread Starter
Frenzied Member
The main wnd for my app is a dialog box.Whenever i press ENTER or ESC my app closes.Can i disable this.
-
Sep 2nd, 2000, 09:43 AM
#2
Monday Morning Lunatic
Are you using MFC or pure Windows calls? With MFC, just add your own handler for the IDOK button. With pure Windows, it shouldn't do anything you haven't specifically told it to do.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 2nd, 2000, 12:02 PM
#3
Thread Starter
Frenzied Member
CHahaDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
MessageBox(HWND(this),"Blabla","HAHA",MB_OK);
}
else if (nResponse == IDCANCEL)
{
MessageBox(HWND(this),"Blabla","HAHA",MB_OK);
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
The Dialog still dissapears and the sgbox doesn't appear.
I changed the IDOK event(didn't i).
I almost forgot i use MFC.
-
Sep 2nd, 2000, 04:03 PM
#4
Monday Morning Lunatic
Try using NULL as the first argument to MessageBox.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|