I'd like to have an example using OnCommand and wparam
Quote from: cip on November 21, 2007, 02:18:53 PM
I'd like to have an example using OnCommand and wparam
I used this code once:
/*
+------------------------------------------------------------------------------------------------+
| AgendaDialog::OnCommand |
+------------------------------------------------------------------------------------------------+
| Responds to some key strokes. "Swallows" the return key. |
+------------------------------------------------------------------------------------------------+
*/
AgendaDialog::OnCommand(unsigned int wParam, unsigned int lParam), int
{
select wParam
{
case IDOK: // user entered Enter, we ignore
return true;
case IDCANCEL: // user hit esc, we close dialog
return true;
default: // pass it on...
return CDialog!!OnCommand(wparam,lparam);
}
}
Enter and Esc return the same value (true) - should enter be false?
Quote from: Rock Ridge Farm (Larry) on November 22, 2007, 06:28:30 AM
Enter and Esc return the same value (true) - should enter be false?
[Esc] should close the dialog. The way I had it swallows both keys. But it shows the technique.