Solved

Adding Accelerator Keys to toolbars

Posted on 1998-12-08
2
312 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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 66
maven archtype selection in eclipse 1 57
FizzBuzz challenge 9 82
x-bar in Google Sheets 2 72
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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