F1 key access to HTML help 
Author Message
 F1 key access to HTML help

OK, I'm being a good boy and migrating to HTML help.
Does anybody know how VB5 can be constrained to
map App.HelpFile and F1 to using the HTML help system?
Or do I have to catch every F1 wherever it might occur?

(Please don't suggest moving to VB6 -- we're not
prepared to make that switch for production code
quite yet.)

Any suggestions? Thanks.


Thu, 22 Feb 2001 03:00:00 GMT  
 F1 key access to HTML help

After more research, it seems unlikely that any automatic solution
exists. In the meantime, I've just bit the bullet and started putting
Form_KeyUp procedures on each form. See code snippet below
if you don't have this info handy. This isn't exactly what I'm doing
but should give you the idea. This is also documented (though not
so easy to find) in the KB; see article Q189086.

It's not hard, just annoying that we can't intercept the
standard behavior in some way. Perhaps somebody else
will supply a means to do this.

Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
   (ByVal hwndCaller As Long, ByVal pszFile As String, _
   ByVal uCommand As Long, ByVal dwData As Long) As Long
   Const HH_SET_WIN_TYPE = &H4
   Const HH_GET_WIN_TYPE = &H5
   Const HH_GET_WIN_HANDLE = &H6
   Const HH_DISPLAY_TEXT_POPUP = &HE   ' Display string resource ID or
                                       ' text in a pop-up window.
   Const HH_HELP_CONTEXT = &HF         ' Display mapped numeric value in
                                       ' dwData.
   Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to
                                       ' WinHelp's HELP_CONTEXTMENU.
   Const HH_TP_HELP_WM_HELP = &H11     ' text pop-up help, similar to
                                       ' WinHelp's HELP_WM_HELP.

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
   Dim hwndHelp as Long
   If ((KeyCode = vbKeyF1) And (App.HelpFile Like "*.chm")) Then
      hwndHelp = HtmlHelp( _
                               hwndCaller:=Me.hwnd, _
                               pszFile:=App.HelpFile, _
   End If
End Sub



    Please, I'm interested too ! It's quite important for me...

Fri, 23 Feb 2001 03:00:00 GMT  
 F1 key access to HTML help

>Seeing as you seem to be
>looking at HTML help, I thought you might have looked at this?

I was finally pointed to some HTML help reference resources
that I'll pass along; they came from David E. Liske:

> The majority of HTMLHelp information is conveyed through the WinHlp-L
> Listserv Discussion Group.  You can subscribe to this at
> http://www.humberc.on.ca/~byrnes/winhelp.html.  There are over 2000
> subscribers, and it's rather active.  There's also an archive maintained
> http://www.documentation.com/winhelp-l/winhelp-l.htm.

> I've started an HTMLHelp Center for Visual Basic techniques at
> http://www.vbexplorer.com.  We just opened it this week, and I have
> tutorials, sample apps with source code, and a number of other items.  The
> hope is that we'll build some serious interest in HTMLHelp in the VB
> community.  VB Explorer had 22,000 visitors in August alone.

I hope you also find this helpful.


Thu, 08 Mar 2001 03:00:00 GMT  
 [ 6 post ] 

 Relevant Pages 

1. VB6 - Accessing HTML Help other than F1

2. Showing custom Help by pressing the F1 key

3. Easy - Displaying help NOT via F1 key - How?

4. Help context ID and F1 key

5. Help on F1 key

6. Help on F1 key

7. Help on F1 key

8. Help on F1 key

9. What messages with F1 help key?

10. VB5 And F1 HTML Help???

11. Help file not accessed when pressing F1

12. Need to disable F1 key.


Powered by phpBB® Forum Software