Solved

disable F1 key

Posted on 2002-05-20
4
521 Views
Last Modified: 2013-11-20
I have a dialog based project with a tabcontrol on it. I want to overwrite F1 key so that when i press on it, the 'look for help file' doesn't gets activated. I'll use F1 to do other stuff

Please show code

i try to eat the key at CMydilogApp::PreTranslateMessage but it doesn't work
0
Comment
Question by:orange_juice
4 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7023097
Try RegisterHotKey API

GOOD LUCK
0
 
LVL 37

Expert Comment

by:zzynx
ID: 7023644
Defining F1 as an accelerator key in your accelerator table is another option.
0
 

Accepted Solution

by:
JShaft earned 50 total points
ID: 7023782
If you override the OnHelpInfo method on your main window, you can comment out the code that calls the help file ( return CDialog::OnHelpInfo(pHelpInfo); ) and put your own code in like this:

BOOL CMyDialog::OnHelpInfo(HELPINFO* pHelpInfo)
{
   // Add code here

   // return CDialog::OnHelpInfo(pHelpInfo);

   return true;
}
0
 
LVL 2

Expert Comment

by:SamratAshok
ID: 7026351
I think it is better to define Command handler in WinApp derived class
for ID_HELP

like this

ON_COMMAND( ID_HELP, OnHelp )

In the actual function OnHelp, do what you want to without calling base class
OnHelp.



0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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: 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. …
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now