Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-10-12
2
Medium Priority
?
276 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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Screencast - Getting to Know the Pipeline

972 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