?
Solved

Disable hotkeys.

Posted on 1998-09-30
1
Medium Priority
?
476 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

771 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