Re: Change owner of Help window

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: this.window.focus() vs. window.focus() vs. this.focus()
    ... When used in-line in the body tag, 'this' refers to the body element. ... the body element doesn't have a window property; ... This will attempt to call the focus method of the body element. ... Since I am using named windows to avoid users opening multiple copies of the same popup help window, some means of giving focus to an old copy of the help window is necessary, else the user will click the help link and nothing appears to happen. ...
    (comp.lang.javascript)
  • Re: Change owner of Help window
    ... If the help window is launched from one window, ... help window for the latest open form when the user presses F1? ... I mention the Win32 function, because the Help window is not a managed window, AFAIK. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help isnt working in Excel
    ... When I type in a word into the little window on the upper right hand corner ... Are you seeing the topics pane at the left or right side of the Help ... what happens when you click the Topics button in the Help window ...
    (microsoft.public.mac.office.excel)
  • HelpProvider and HTML Help interaction
    ... I use a modal application window and I can start the help. ... I cannot move my window over the help window. ... Is this a configuration problem of the help window settings in the html help ... Or must I manually control the help window using its process and window ...
    (microsoft.public.dotnet.languages.vb)
  • RE: red x instead of picture in Windows XP Help and Support window
    ... The Help and Support window works through the browser. ... Multimedia section and make sure that the Show Pictures option is checked. ... Scroll down to this section: ...
    (microsoft.public.windowsxp.help_and_support)