Solved

Disable hotkeys.

Posted on 1998-09-30
1
457 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 126
viewing source code from eclipse 13 110
bigDiff challenge 17 123
Modbus - whats the maximum I can store in one register? 4 80
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

790 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