September 26, 2022, 06:50:25 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


OnCommand - wparam

Started by cip, November 21, 2007, 02:18:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cip

I'd like to have an example using OnCommand and wparam

Bruce Peaslee

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);
   }
}
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Rock Ridge Farm (Larry)

Enter and Esc return the same value (true) - should enter be false?

Bruce Peaslee

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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles