Solved

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

Posted on 1998-10-12
2
255 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

11 Experts available now in Live!

Get 1:1 Help Now