[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Adding Accelerator Keys to toolbars

Posted on 1998-12-08
2
Medium Priority
?
317 Views
Last Modified: 2013-11-20
How do I get Accelerator Keys such as Alt+F to bring up a drop-down button in a tool bar?  I have used the MapAccelerator fucntion in the CToolBarCtrl but that seems to do nothing, do I have to route a message from the main window to the toolbar?
0
Comment
Question by:traott
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 1325921
An accelerator will go to the menu and if the menu finds an appropriate action, it translates the keystroke into a command message and posts that to the window which owns the menu. So you will need to have a response handler for the command in your main window. From that handler, you need to decide appropriate what to do. Alternatively, you can even override OnCmdMsg() in your frame window to route to the toolbar's if the toolbar has such a handler in it.
0
 

Author Comment

by:traott
ID: 1325922
OK, I got that to work, but now when I try to bring up the menu for the drop down using TrackPopupMenu(...) it returns a bad status and the error I get says that the Popup menu is already active. It does not do this if I click on the button, and it is using the same code.  Do I have to deactivate it?  If so, how do I it?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question