Solved

disable F1 key

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Title # Comments Views Activity
set up trigger (or something) to rename files (starting with ATL) in a linux directory 6 55
if loop in java 3 154
format the code in java 6 102
move a line in eclipse 3 107
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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