Solved

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

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

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…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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