Solved

disable F1 key

Posted on 2002-05-20
4
537 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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