Solved

Adding Accelerator Keys to toolbars

Posted on 1998-12-08
2
304 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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now