Closing a menu (for WinHelp context help)

0 views
Skip to first unread message

Bob Masta

unread,
May 30, 2007, 10:57:31 AM5/30/07
to
I offer my app with the user's choice of WinHelp or HTML Help.

With WinHelp uder Win9x, everything is fine. With XP, if the
user right-clicks a menu item to get context Help, the menu doesn't
close... it stays floating over the Help page, and in fact if the
mouse is moved over the menu bar, the menus change accordingly.
Other than that one detail, WinHelp works fine on XP.

So, is there a way to close a menu programmatically?
DestroyMenu doesn't seem to work for this.

Or is there some other way to handle this?

Many thanks,


Bob Masta

D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, Signal Generator
Science with your sound card!

Bob Masta

unread,
Jun 6, 2007, 8:54:28 AM6/6/07
to
On Wed, 30 May 2007 14:57:31 GMT, NoS...@daqarta.com (Bob Masta)
wrote:

>I offer my app with the user's choice of WinHelp or HTML Help.
>
>With WinHelp uder Win9x, everything is fine. With XP, if the
>user right-clicks a menu item to get context Help, the menu doesn't
>close... it stays floating over the Help page, and in fact if the
>mouse is moved over the menu bar, the menus change accordingly.
>Other than that one detail, WinHelp works fine on XP.
>
>So, is there a way to close a menu programmatically?
>DestroyMenu doesn't seem to work for this.

Answering my own question here, in case someone else
runs into this:

You can close the menu by feeding it an ESC key (0x1B) using
PostMessage.

However, the real cause of the problem seems to be that
XP regards the WinHelp HELP_CONTEXT invocation to be an
unwarranted attempt to force top-most status, if it is
given when a menu is active. So it doesn't allow WinHelp to
get to the top, but keeps it under the menu and flashes
the new Help item in the system tray.

Although posting ESC does dismiss the menu, it apparently
comes too late to stop the flashing routine. (SendMessage
doesn't work at all here.)

I can imagine some devious ways to circumvent this XP bug,
err, "feature", but for the moment I will just let the users
put up with a few seconds of flashing.

Gee, I guess the folks in Redmond *really* don't like
WinHelp any more! If only they'd make HTML Help as
pleasant to page through... <sigh>

Best regards,

Reply all
Reply to author
Forward
0 new messages