Re: Change owner of Help window
- From: RvGrah <rvgrahamsevatenein@xxxxxxxxxxxxx>
- Date: Tue, 1 Sep 2009 14:21:07 -0700 (PDT)
On Sep 1, 12:24 pm, "Peter Duniho" <no.peted.s...@xxxxxxxxxxxxxxxxxx>
wrote:
On Tue, 01 Sep 2009 12:00:59 -0700, RvGrah
<rvgrahamsevaten...@xxxxxxxxxxxxx> wrote:
I built a help system using Html Help Workshop (very unintuitive!).
Got it hooking up with my C# application OK. But I have one issue:
The application allows multiple child windows to be open, usually non-
modally. If the help window is launched from one window, and then the
user gives focus to another window and presses F1 again, the topic in
Help changes as it ought to, but whatever window opened it first comes
back to front as well (if it was still open in the background). I
assume this is because the first window to open Help still "owns" the
help window.
Is there a way to catch the F1 keystroke and take ownership of the
help window for the latest open form when the user presses F1?
I don't know how you're handling F1 now, but I'm sure there's a way to
detect when the key is pressed in your program.
As for changing the window parent, the Win32 function SetParent() will do
that. I mention the Win32 function, because the Help window is not a
managed window, AFAIK. So I think you'll have to use the unmanaged Win32
API to change the parent (see p/invoke interop).
Pete
I'm using the HelpProvider component from the standard toolbox and
setting Show help on HelpProvider1 to true. That makes it respond to
the F1 key with no further code writing as long as you set the
HelpProvider's properties and the HelpNavigator and HelpKeyword
properly on whatever form or control you're using.
I understand your answer, and can figure it out from there except for
one part... How do I attach to the help window's handle? Do I have to
iterate through the other windows that the os is handling to find it?
What if there are several help windows open from different programs?
Is there a way to know I'm getting the right one?
Thanks Peter, Bob Graham
.
- Follow-Ups:
- Re: Change owner of Help window
- From: Peter Duniho
- Re: Change owner of Help window
- References:
- Change owner of Help window
- From: RvGrah
- Re: Change owner of Help window
- From: Peter Duniho
- Change owner of Help window
- Prev by Date: Re: Multi-level grouping?
- Next by Date: Re: Change owner of Help window
- Previous by thread: Re: Change owner of Help window
- Next by thread: Re: Change owner of Help window
- Index(es):
Relevant Pages
|