Accessing context sensitive help files from CF

Accessing context sensitive help files from CF

Post by David Topp » Tue, 08 Oct 2002 11:09:13



I'm surprised that this has not come up before...so it probably means that
it is so simple that everybody else has figgered it out!

How do you link the appropriate Help file to your application? I found some
examples where it showed how to modify the main help index so that your own
help file is in the main list.

And I found an example where it shows you how to (from C++ unfortunately -
not my strong suit) call PEGHELP.EXE and pass it text arguments so that you
can call it from, say, a button on your form.

But how about the simple case where, your app is already running, and the
user clicks Start | Help -- you don't want to leave them at the main help
index, searching for the title you have left there - you want to take them
straight to the first, or even better, most relevant help page for that
form.

What am I overlooking?

dt

 
 
 

Accessing context sensitive help files from CF

Post by Tim Wilso » Tue, 08 Oct 2002 11:50:16


Quote:> But how about the simple case where, your app is already running, and the
> user clicks Start | Help -- you don't want to leave them at the main help
> index, searching for the title you have left there - you want to take them
> straight to the first, or even better, most relevant help page for that
> form.

This is accomplished by handling the WM_HELP message that is sent to the
application that is active when Help is selected on the Start Menu. When
this message is received in your application you could then just start
peghelp.exe and pass it the .htm page that represents your help (and even
direct it to the appropriate location within your help file as well).
Unfortunately, we do not have the ability to directly override WndProc to
receive this message. You can "re-route" the window proc for any window by
writing an unmanaged  .dll that changes the window proc using SetWindowLong.
Inside this new window proc you then send a message back to the managed
application via a MessageWindow when you get a message that you wish to
handle. This is tricky because the WM_HELP message is said to go to the
Active window, so this may complicate "re-routing" the window proc as the
Active window is, of course, going to change from Form to Form.
In the MFC world this was easily accomplished by handling WM_HELP at the
MainFrame (FrameWnd) level, but in the .Net world I can only guess (cross
fingers/hope) that it can be done in a similar fashion.

-- Tim
====================================
Tim Wilson
Mobile Software Solutions Inc.
====================================

Quote:> I'm surprised that this has not come up before...so it probably means that
> it is so simple that everybody else has figgered it out!

> How do you link the appropriate Help file to your application? I found
some
> examples where it showed how to modify the main help index so that your
own
> help file is in the main list.

> And I found an example where it shows you how to (from C++ unfortunately -
> not my strong suit) call PEGHELP.EXE and pass it text arguments so that
you
> can call it from, say, a button on your form.

> But how about the simple case where, your app is already running, and the
> user clicks Start | Help -- you don't want to leave them at the main help
> index, searching for the title you have left there - you want to take them
> straight to the first, or even better, most relevant help page for that
> form.

> What am I overlooking?

> dt


 
 
 

Accessing context sensitive help files from CF

Post by David Topp » Tue, 08 Oct 2002 15:24:18


So, it wasn't quite so simple after all...well, not for a bear with very
little brain...

I'm surprised that with all the helpful things that VS.Net is now doing for
us (ability to edit ancillary files, edit and include icon files etc) that
this is not just a simple function call from within managed code.

dt


> > But how about the simple case where, your app is already running, and
the
> > user clicks Start | Help -- you don't want to leave them at the main
help
> > index, searching for the title you have left there - you want to take
them
> > straight to the first, or even better, most relevant help page for that
> > form.
> This is accomplished by handling the WM_HELP message that is sent to the
> application that is active when Help is selected on the Start Menu. When
> this message is received in your application you could then just start
> peghelp.exe and pass it the .htm page that represents your help (and even
> direct it to the appropriate location within your help file as well).
> Unfortunately, we do not have the ability to directly override WndProc to
> receive this message. You can "re-route" the window proc for any window by
> writing an unmanaged  .dll that changes the window proc using
SetWindowLong.
> Inside this new window proc you then send a message back to the managed
> application via a MessageWindow when you get a message that you wish to
> handle. This is tricky because the WM_HELP message is said to go to the
> Active window, so this may complicate "re-routing" the window proc as the
> Active window is, of course, going to change from Form to Form.
> In the MFC world this was easily accomplished by handling WM_HELP at the
> MainFrame (FrameWnd) level, but in the .Net world I can only guess (cross
> fingers/hope) that it can be done in a similar fashion.

> -- Tim
> ====================================
> Tim Wilson
> Mobile Software Solutions Inc.
> ====================================


> > I'm surprised that this has not come up before...so it probably means
that
> > it is so simple that everybody else has figgered it out!

> > How do you link the appropriate Help file to your application? I found
> some
> > examples where it showed how to modify the main help index so that your
> own
> > help file is in the main list.

> > And I found an example where it shows you how to (from C++
unfortunately -
> > not my strong suit) call PEGHELP.EXE and pass it text arguments so that
> you
> > can call it from, say, a button on your form.

> > But how about the simple case where, your app is already running, and
the
> > user clicks Start | Help -- you don't want to leave them at the main
help
> > index, searching for the title you have left there - you want to take
them
> > straight to the first, or even better, most relevant help page for that
> > form.

> > What am I overlooking?

> > dt

 
 
 

Accessing context sensitive help files from CF

Post by Peter Foo » Tue, 08 Oct 2002 17:23:14


eVB gave us the HelpClick event for each form and using this you could use
the CreateProcess api call to call peghelp with your file, unfortunatly .NET
CF does not expose a HelpClick event :-(

Peter


> So, it wasn't quite so simple after all...well, not for a bear with very
> little brain...

> I'm surprised that with all the helpful things that VS.Net is now doing
for
> us (ability to edit ancillary files, edit and include icon files etc) that
> this is not just a simple function call from within managed code.

> dt



> > > But how about the simple case where, your app is already running, and
> the
> > > user clicks Start | Help -- you don't want to leave them at the main
> help
> > > index, searching for the title you have left there - you want to take
> them
> > > straight to the first, or even better, most relevant help page for
that
> > > form.
> > This is accomplished by handling the WM_HELP message that is sent to the
> > application that is active when Help is selected on the Start Menu. When
> > this message is received in your application you could then just start
> > peghelp.exe and pass it the .htm page that represents your help (and
even
> > direct it to the appropriate location within your help file as well).
> > Unfortunately, we do not have the ability to directly override WndProc
to
> > receive this message. You can "re-route" the window proc for any window
by
> > writing an unmanaged  .dll that changes the window proc using
> SetWindowLong.
> > Inside this new window proc you then send a message back to the managed
> > application via a MessageWindow when you get a message that you wish to
> > handle. This is tricky because the WM_HELP message is said to go to the
> > Active window, so this may complicate "re-routing" the window proc as
the
> > Active window is, of course, going to change from Form to Form.
> > In the MFC world this was easily accomplished by handling WM_HELP at the
> > MainFrame (FrameWnd) level, but in the .Net world I can only guess
(cross
> > fingers/hope) that it can be done in a similar fashion.

> > -- Tim
> > ====================================
> > Tim Wilson
> > Mobile Software Solutions Inc.
> > ====================================


> > > I'm surprised that this has not come up before...so it probably means
> that
> > > it is so simple that everybody else has figgered it out!

> > > How do you link the appropriate Help file to your application? I found
> > some
> > > examples where it showed how to modify the main help index so that
your
> > own
> > > help file is in the main list.

> > > And I found an example where it shows you how to (from C++
> unfortunately -
> > > not my strong suit) call PEGHELP.EXE and pass it text arguments so
that
> > you
> > > can call it from, say, a button on your form.

> > > But how about the simple case where, your app is already running, and
> the
> > > user clicks Start | Help -- you don't want to leave them at the main
> help
> > > index, searching for the title you have left there - you want to take
> them
> > > straight to the first, or even better, most relevant help page for
that
> > > form.

> > > What am I overlooking?

> > > dt

 
 
 

Accessing context sensitive help files from CF

Post by Alan Vanc » Wed, 09 Oct 2002 04:27:09


try this using the "CreateProcess" PInvoke:

                        // Call CreateProcess....and Open
Help File
                        ProcessInfo pi = new ProcessInfo();


                        if (global.CreateProcess(progPath,
filestring, pi) != true)
                                MessageBox.Show("Process
ID: " + pi.ProcessId.ToString() + " failed (system error
= " + global.GetPInvokeError().ToString() + ")","Document
Error");

Quote:>-----Original Message-----
>I'm surprised that this has not come up before...so it
probably means that
>it is so simple that everybody else has figgered it out!

>How do you link the appropriate Help file to your

application? I found some
Quote:>examples where it showed how to modify the main help

index so that your own
Quote:>help file is in the main list.

>And I found an example where it shows you how to (from
C++ unfortunately -
>not my strong suit) call PEGHELP.EXE and pass it text

arguments so that you
Quote:>can call it from, say, a button on your form.

>But how about the simple case where, your app is already
running, and the
>user clicks Start | Help -- you don't want to leave them
at the main help
>index, searching for the title you have left there - you
want to take them
>straight to the first, or even better, most relevant help
page for that
>form.

>What am I overlooking?

>dt

>.

 
 
 

Accessing context sensitive help files from CF

Post by David Topp » Wed, 09 Oct 2002 13:10:55


Ah, that helps...if I can just figger out the VB equivalent, I'll be off and
running...
Thanks very much.


> try this using the "CreateProcess" PInvoke:

> // Call CreateProcess....and Open
> Help File
> ProcessInfo pi = new ProcessInfo();
> String progPath =

> String filestring =

> if (global.CreateProcess(progPath,
> filestring, pi) != true)
> MessageBox.Show("Process
> ID: " + pi.ProcessId.ToString() + " failed (system error
> = " + global.GetPInvokeError().ToString() + ")","Document
> Error");

> >-----Original Message-----
> >I'm surprised that this has not come up before...so it
> probably means that
> >it is so simple that everybody else has figgered it out!

> >How do you link the appropriate Help file to your
> application? I found some
> >examples where it showed how to modify the main help
> index so that your own
> >help file is in the main list.

> >And I found an example where it shows you how to (from
> C++ unfortunately -
> >not my strong suit) call PEGHELP.EXE and pass it text
> arguments so that you
> >can call it from, say, a button on your form.

> >But how about the simple case where, your app is already
> running, and the
> >user clicks Start | Help -- you don't want to leave them
> at the main help
> >index, searching for the title you have left there - you
> want to take them
> >straight to the first, or even better, most relevant help
> page for that
> >form.

> >What am I overlooking?

> >dt

> >.

 
 
 

Accessing context sensitive help files from CF

Post by David Topp » Wed, 09 Oct 2002 13:10:16


Yes, I was hoping that there was an equivalent in VS.Net. Oh well...


> eVB gave us the HelpClick event for each form and using this you could use
> the CreateProcess api call to call peghelp with your file, unfortunatly
.NET
> CF does not expose a HelpClick event :-(

> Peter



> > So, it wasn't quite so simple after all...well, not for a bear with very
> > little brain...

> > I'm surprised that with all the helpful things that VS.Net is now doing
> for
> > us (ability to edit ancillary files, edit and include icon files etc)
that
> > this is not just a simple function call from within managed code.

> > dt



> > > > But how about the simple case where, your app is already running,
and
> > the
> > > > user clicks Start | Help -- you don't want to leave them at the main
> > help
> > > > index, searching for the title you have left there - you want to
take
> > them
> > > > straight to the first, or even better, most relevant help page for
> that
> > > > form.
> > > This is accomplished by handling the WM_HELP message that is sent to
the
> > > application that is active when Help is selected on the Start Menu.
When
> > > this message is received in your application you could then just start
> > > peghelp.exe and pass it the .htm page that represents your help (and
> even
> > > direct it to the appropriate location within your help file as well).
> > > Unfortunately, we do not have the ability to directly override WndProc
> to
> > > receive this message. You can "re-route" the window proc for any
window
> by
> > > writing an unmanaged  .dll that changes the window proc using
> > SetWindowLong.
> > > Inside this new window proc you then send a message back to the
managed
> > > application via a MessageWindow when you get a message that you wish
to
> > > handle. This is tricky because the WM_HELP message is said to go to
the
> > > Active window, so this may complicate "re-routing" the window proc as
> the
> > > Active window is, of course, going to change from Form to Form.
> > > In the MFC world this was easily accomplished by handling WM_HELP at
the
> > > MainFrame (FrameWnd) level, but in the .Net world I can only guess
> (cross
> > > fingers/hope) that it can be done in a similar fashion.

> > > -- Tim
> > > ====================================
> > > Tim Wilson
> > > Mobile Software Solutions Inc.
> > > ====================================


> > > > I'm surprised that this has not come up before...so it probably
means
> > that
> > > > it is so simple that everybody else has figgered it out!

> > > > How do you link the appropriate Help file to your application? I
found
> > > some
> > > > examples where it showed how to modify the main help index so that
> your
> > > own
> > > > help file is in the main list.

> > > > And I found an example where it shows you how to (from C++
> > unfortunately -
> > > > not my strong suit) call PEGHELP.EXE and pass it text arguments so
> that
> > > you
> > > > can call it from, say, a button on your form.

> > > > But how about the simple case where, your app is already running,
and
> > the
> > > > user clicks Start | Help -- you don't want to leave them at the main
> > help
> > > > index, searching for the title you have left there - you want to
take
> > them
> > > > straight to the first, or even better, most relevant help page for
> that
> > > > form.

> > > > What am I overlooking?

> > > > dt

 
 
 

1. context sensitive help

Hi,

I have a problem using context sensitive help from my .Net
application.
eVB gave us the HelpClick event for each form and using
this you could use
the CreateProcess api call to call peghelp with your file,
unfortunatly .NET
CF does not expose a HelpClick event.
Does anybody know something different I could use?

thanks, Michael

2. wtb: audio sampling cartridge for 1040stf

3. Integrating Context Sensitive help.

4. referencing composite counters used within a "newenvironment"

5. Context sensitive help in VB .NET

6. Die Cutting, Cold Lamination, and Inkjet Paper like Chromo Paper

7. F1 key not giving context sensitive help from MSDN

8. Can I delete the files in c:\config.msi???

9. Context-Sensitive Help in Custom Wizard

10. F1 key not giving context sensitive help from MSDN

11. Visual Studio Context Sensitive Help (F1) not linking to MSDN

12. Context-sensitive Help for Menu Items

13. Context-Sensitive Help in Custom Wizard