- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using a menu, tool bar buttons and accellerator keys to access menu items.
Is there a way to tell if an accelerator button has been pressed rather than the menu directly?
Thanks
Is there a way to tell if an accelerator button has been pressed rather than the menu directly?
Thanks
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Give the accelerator a diffent ID from the menu item it covers. Then the WM_COMMAND wParam parameter will contain a different ID according to whether the Menu or the Accelerator was used. Process both commands identically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony's suggestion is probably more robust and flexible, but an alternative is to examine the contents of the high word of the wparam argument provided with the WM_COMMAND message - it should be 0 if the command has come from the menu or 1 if the command cam via an accelerator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony,
Thanks, that's a very simple way to sort the problem.
David
Thanks, that's a very simple way to sort the problem.
David

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page