?
Solved

How to disable F10 in an application

Posted on 2003-02-24
5
Medium Priority
?
466 Views
Last Modified: 2013-11-20
In an application, F10 is set by the system to be an accelerate key of activating menus. But I want to use F10 in other ways. So how to disable this accelerate key? Thank you.
0
Comment
Question by:Xiaoyang
[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
5 Comments
 
LVL 1

Accepted Solution

by:
jackrabbit22 earned 120 total points
ID: 8012963
Add a message handler for PreTranslateMessage in your frame class.  

The F10 key triggers a WM_SYSKEYDOWN message, with the wParam set to the virtual key code for F10.

Sample Code
-----------

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
     if (pMsg->message == WM_SYSKEYDOWN)
     {
          if (pMsg->wParam == VK_F10)
               AfxMessageBox("F10");
     }
     return CFrameWnd::PreTranslateMessage(pMsg);
}
0
 

Author Comment

by:Xiaoyang
ID: 8014281
Thank you very much!!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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