?
Solved

disable F1 key

Posted on 2002-05-20
4
Medium Priority
?
543 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 200 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

Independent Software Vendors: 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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
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…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

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