Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
274 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
[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
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 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