By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,012 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,012 IT Pros & Developers. It's quick & easy.

Sibling Mode not working on Menu Items when calling HtmlHelp?

P: n/a
I have a truly curious problem with HtmlHelp and Sibling Mode in Visual C++
..Net 2003 in an MFC app.
Sibling mode allows the help viewer to display on top of the app, but if the
app is clicked, then the app becomes the top most window. The idea is to
let the user switch back and forth between the help viewer and the
application.

For the case of Menu Items only, sibling mode does not appear to work
correctly under normal running conditions.
However, sibling mode does work for menu items, if you put a breakpoint on
the HtmlHelp call and stop prior to executing the call.
In this case the HtmlHelp viewer is triggered with an F1 key while the menu
item is highlighted via mouse drag prior to clicking for selection.

The call is simple, the first argument is null to indicate Sibling Mode:

::HtmlHelp( NULL, (LPCTSTR)csHelpViewer, HH_HELP_CONTEXT,
aMainFrameHelpIDPairs[i].dwTopicId );

The correct topic comes up using the provided ID. However, the Html Help
Viewer comes up in "Always On Top" mode not Sibling mode. The user cannot
switch back and forth between the application and the help window.

All but Menu Items will allow the HtmlHelp viewer to come up in sibling mode
as requested. It works great on dialogs but not menu items. On menu items,
the behavior is as though the call was made without sibling mode.

The really curious thing is that it acts like breaking in the debugger is
clearing out a problem with the viewer window. If I put a debug breakpoint
on the HtmlHelp call, stop at the breakpoint, and then continue execution,
it works. With a breakpoint stop, it will work in either Debug or Release
mode executables when run from the debugger. It doesn't appear to be a pure
timing issue, since putting 10 second sleeps either before, after, or both
before and after the call, does not make it work. The debug breakpoint
itself appears to be making the code behave differently.

We've put the necessary calls in to enable HTML help in MFC and every other
type of GUI is responding correctly.

Could there be an issue with the HTML file itself with menu items? Is there
something in the file that might force the window to be a Top Most window
instead of permitting Sibling Mode to be used? Or is there some mysterious
code issue lurking under the surface here?

Thanks,

Elaine

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.