Solved

Disable hotkeys.

Posted on 1998-09-30
1
470 Views
Last Modified: 2013-11-20
I have a CEdit control in a toolbar that i want to write
into, the problem is that i have the 1-5 keys at hotkeys for some functions.

My question is if there is any good way to disable this hotkeys when im writing the text in the control?
0
Comment
Question by:DanielC
[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
1 Comment
 

Accepted Solution

by:
umarama earned 0 total points
ID: 1322742
In your derived CEdit class, say CMyEdit, add an handler for PreTranslateMessage ...

From Class Wizard derive a new class (say CMyEdit) from CEdit.
Add the following handler

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg)
{
  if ((pMsg->message == WM_KEYDOWN)
{
     if ( (pMsg->wParam >=  VK_NUMPAD1) &&  (pMsg->wParam <=  VK_NUMPAD5))
      return TRUE;

// Above was for Number Pad keys
// If you need this for 1-5 top panel keys check for range 1 to 5.
// If function keys check for VK_F1 to VK_F5
// U should return TRUE if it falls in range.
 }
  return CEdit::PreTranslateMessage(pMsg);
}
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

728 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