Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to disable F10 in an application

Posted on 2003-02-24
5
Medium Priority
?
469 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
2 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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

580 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