?
Solved

Accelerator keys in CDialog

Posted on 1997-03-18
2
Medium Priority
?
529 Views
Last Modified: 2013-11-20
How can I add accelerator keys to a CDialog window?

I want to be able to act upon a certain alt-key sequence (not associated with a control such as a button).

I have created a new accelerator table with my values, but no WM_COMMAND is sent when I enter the sequence in the window (just a bell).
0
Comment
Question by:tdietz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
rhgaracci earned 600 total points
ID: 1300085
In the resource view, select the accelerator resource.  Press Ctrl-W to bring up class wizard.  Class wizard will display a dialog that allows to to associate the accelerator with your CDialog derived dialog class.  Select your dialog class.

Then, in class wizard, the IDs of your accelerators will be displayed in your dialog class.  Associate a COMMAND message with the ID to create an On...() member function.  Then put your response functionality into the On...().
0
 

Author Comment

by:tdietz
ID: 1300086
Originally you answer seemed to work.  However, it does not, or at least the steps I followed do not.

I have a CDialog window created.  I want to do something when the user press ALT-UP or ALT-DOWN.  I added the accelerators in the Accelerator Table, then hit CTRL-W for Class Wizard.  Everything is fine.  Two new commands are added to the window I want (which is actually a CWnd as a child of a CDialog).

I added a handler for both the functions.  When I press ALT-Up or ALT-DOWN I still get a bell.

I have tried adding new "accelerator tables" through class wizard for both the CWnd and the main CDialog.  I have even tried using a simple ALT-A sequence instead of ALT-DOWN, with no luck.

0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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 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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

800 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