Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable F1 key

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

609 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