Click to See Complete Forum and Search --> : Dialog Problem??
Vlatko
Sep 2nd, 2000, 06:50 AM
The main wnd for my app is a dialog box.Whenever i press ENTER or ESC my app closes.Can i disable this.
parksie
Sep 2nd, 2000, 09:43 AM
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.
Vlatko
Sep 2nd, 2000, 12:02 PM
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.
parksie
Sep 2nd, 2000, 04:03 PM
Try using NULL as the first argument to MessageBox.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.