determining if in whatsthis mode?

I want to include some help information along with parts of my app. I'm ditching my CHM help files and using regular .html files. I would like to add a WhatsThis help icon to the titlebar of some of my forms (or to one form, depending on which tab is active), but i would need to be notified when a user clicks WhatThis, and handle that myself, rather than letting VB do it.

basically, i just want the help icon in the toolbar, and when a user clicks it, it simply launches a .html file, instead of trying to provide context sensitive info per each control.

It's surprising you can set WhatsThisMode through code (user never clicks the icon), but you can't check if it's in that mode or not. surely there's a way... i just don't want to clutter my interface with a separate help button on my form. Putting it in the titlebar would be much better.
[894 byte] By [gnznroses] at [2007-11-20 9:59:03]
# 1 Re: determining if in whatsthis mode?
Maybe the Microsoft URL below will help?

http://support.microsoft.com/kb/142249
DinoVaught at 2007-11-9 19:35:50 >
# 2 Re: determining if in whatsthis mode?
hmm, nope. thanks tho.
i did find things in the api reference, but not sure which applies.

When a page is activated, the property sheet determines whether to enable or disable the Help button for the page by checking for the PSP_HASHELP style. If the page has this style, it supports the Help button. If the PSP_HASHELP style is not present, the button is disabled.

When the user chooses the Help button, the active page receives the PSN_HELP notification message. The page should respond by displaying help information, typically by calling the WinHelp function.

PSN_HELP
The PSN_HELP notification message notifies a page that the user has chosen the Help button. This notification message is sent in the form of a WM_NOTIFY message.

PSN_HELP
lpnmhdr = (NMHDR FAR *) lParam;


Parameters

lpnmhdr

Pointer to an NMHDR structure. The hwndFrom member is the handle to the property sheet.



Return Values

No return value.

Remarks

An application should display help information for the page.

but i also found this:
WM_HELP
The WM_HELP message indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no Window has the keyboard focus, WM_HELP is sent to the currently active window.

WM_HELP
lphi = (LPHELPINFO) lParam;


Parameters

lphi

Pointer to a HELPINFO structure that contains information about the menu item, control, dialog box, or window for which help is requested.



Return Values

Returns TRUE.

Remarks

The DefWindowProc function passes WM_HELP to the parent window of a child window or to the owner of a top-level window.

but also, that still only lets me be notified when a user clicks help, then when in help mode, clicks an item on the form. two problems with that: 1. i don't need them to click an item because the help will pertain to the whole form, and 2. the active-x controls i'm using (adn maybe the standard controls as well) respond to the clicks, even in help mode. so if they click a button to try to see what it does, it actually clicks the button as well. not good.

anyone have recommendations?
gnznroses at 2007-11-9 19:36:50 >
# 3 Re: determining if in whatsthis mode?
for anyone who finds this later: i found the solution. after messign with trying to create a button in the titlebar, and getting it XP-styled, etc, found out you just process WM_NCLBUTTONDOWN messages in the WndProc prodecude, checking for wParam = HTHELP
gnznroses at 2007-11-9 19:37:55 >
# 4 Re: determining if in whatsthis mode?
I don't sure you want but

on your form set properties WhatsthisButton and WhatsThisHelp to true,
and on controls set property HelpcontextID and to somes values numeric , and in your chm put in a file .txt
something as

.topic 1000
save data
.topic 1010
delete data
.topic 1020
enter last name
.topic 1030


and you may use api or app.Helpfile

Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hWndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As HH_COMMAND, dwData As Any) As Long


overview help of HelpworkShop, too.
hensa22 at 2007-11-9 19:38:55 >