: how do i prevent the dialog box from closing when ESCAPE key is pressed? : : can anybody help : pinkie : [blue]In the PreTranslateMessge() function. When the message is VK_ESCAPE just return TRUE. I put it in my project's CWinApp-derived class so that it will be disabled throughout the entire program, not just one specific view or dialog.[/blue]
i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do?
: : how do i prevent the dialog box from closing when ESCAPE key is pressed? : : : : can anybody help : : pinkie : : : [blue]In the PreTranslateMessge() function. When the message is VK_ESCAPE just return TRUE. I put it in my project's CWinApp-derived class so that it will be disabled throughout the entire program, not just one specific view or dialog.[/blue] :
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == VK_ESCAPE ) { return TRUE; } else { return FALSE;// but TAB is not working }
//return CDialog::PreTranslateMessage(pMsg);
}
Pl tell me is anything wrong with my code???
: : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do? : : : : : : post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem. :
[b][red]This message was edited by stober at 2003-7-5 8:36:16[/red][/b][hr] : here it is : [code] BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == VK_ESCAPE ) { return TRUE; } [red]delete the else statement![/red] // else // { // return FALSE;// but TAB is not working // }
[red]UN-delete this next line![/red] return CDialog::PreTranslateMessage(pMsg);
} [/code] : Pl tell me is anything wrong with my code??? : : : : : : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do? : : : : : : : : : : post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem. : : : :
: [b][red]This message was edited by stober at 2003-7-5 8:36:16[/red][/b][hr] : : here it is : : : [code] : BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) : { : if (pMsg->message == VK_ESCAPE ) : { : return TRUE; : } : [red]delete the else statement![/red] : // else : // { : // return FALSE;// but TAB is not working : // } : : [red]UN-delete this next line![/red] : return CDialog::PreTranslateMessage(pMsg); : : } : [/code] : : Pl tell me is anything wrong with my code??? : : : : : : : : : : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do? : : : : : : : : : : : : : : post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem. : : : : : : : : : : :
Comments
:
: can anybody help
: pinkie
:
[blue]In the PreTranslateMessge() function. When the message is VK_ESCAPE just return TRUE. I put it in my project's CWinApp-derived class so that it will be disabled throughout the entire program, not just one specific view or dialog.[/blue]
: : how do i prevent the dialog box from closing when ESCAPE key is pressed?
: :
: : can anybody help
: : pinkie
: :
: [blue]In the PreTranslateMessge() function. When the message is VK_ESCAPE just return TRUE. I put it in my project's CWinApp-derived class so that it will be disabled throughout the entire program, not just one specific view or dialog.[/blue]
:
:
:
post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem.
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == VK_ESCAPE )
{
return TRUE;
}
else
{
return FALSE;// but TAB is not working
}
//return CDialog::PreTranslateMessage(pMsg);
}
Pl tell me is anything wrong with my code???
: : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do?
: :
: :
:
: post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem.
:
: here it is
:
[code]
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == VK_ESCAPE )
{
return TRUE;
}
[red]delete the else statement![/red]
// else
// {
// return FALSE;// but TAB is not working
// }
[red]UN-delete this next line![/red]
return CDialog::PreTranslateMessage(pMsg);
}
[/code]
: Pl tell me is anything wrong with my code???
:
:
:
: : : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do?
: : :
: : :
: :
: : post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem.
: :
:
:
: [b][red]This message was edited by stober at 2003-7-5 8:36:16[/red][/b][hr]
: : here it is
: :
: [code]
: BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
: {
: if (pMsg->message == VK_ESCAPE )
: {
: return TRUE;
: }
: [red]delete the else statement![/red]
: // else
: // {
: // return FALSE;// but TAB is not working
: // }
:
: [red]UN-delete this next line![/red]
: return CDialog::PreTranslateMessage(pMsg);
:
: }
: [/code]
: : Pl tell me is anything wrong with my code???
: :
: :
: :
: : : : i tried as u suggested. The ESCAPE key is working as expected, but TAB is not working now. what do i do?
: : : :
: : : :
: : :
: : : post the OnTranslateMessage() function that you created. Disabling the ESC key should not have that side affect. That must be a different problem.
: : :
: :
: :
:
:
:
:
:
[code]
BOOL CTest5Dlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_ESCAPE)
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
[/code]
[code]
BOOL COwnApp::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
SendMessage(GetActiveWindow(), pMsg->message, pMsg->wParam, pMsg->lParam);
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
[/code]
: : this is not working.dont know why?? have u tried?
: :
: [code]
: BOOL CTest5Dlg::PreTranslateMessage(MSG* pMsg)
: {
: if(pMsg->message == WM_KEYDOWN)
: {
: if(pMsg->wParam == VK_ESCAPE)
: return TRUE;
: }
: return CDialog::PreTranslateMessage(pMsg);
: }
: [/code]
:
:
pinkie
: : this is not working.dont know why?? have u tried?
: :
: [code]
: BOOL CTest5Dlg::PreTranslateMessage(MSG* pMsg)
: {
: if(pMsg->message == WM_KEYDOWN)
: {
: if(pMsg->wParam == VK_ESCAPE)
: return TRUE;
: }
: return CDialog::PreTranslateMessage(pMsg);
: }
: [/code]
:
: