Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Disable hotkeys.

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

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: 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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

604 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