Solved

WM_HELP -- How to tell if it's via F1 or "What's This" icon

Posted on 1998-10-12
2
264 Views
Last Modified: 2013-12-04
You get a WM_HELP message when the user hits F1 or clicks on the window while the "What's This" icon is turned on (see WS_EX_CONTEXTHELP).  I want to do something different when the user hits F1, such as bring up the actual help as opposed to a popup.
0
Comment
Question by:shrif
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 1415214
To chack if F1 is down (You'll receive WM_HELP before the user has the chance to release the key ;-), check:

if ( 0x80000000 & GetKeyState ( VK_F1))
{
 // F1 is pressed
}
else
{
 // not pressed...
}
0
 
LVL 1

Author Comment

by:shrif
ID: 1415215
Worked like a champ.  What's more, GetKeyEvent seems to be returning the write thing even when F1 isn't pressed at the time the function is executed, as long as F1 was pressed when the message was generated.  So this is even better.

Thanks for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

911 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