VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 **

by Gareth Lock (DynaByte Software) (3 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 30th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 **

API Declarations


'Purpose :- Call HTML Help from within a Visual Basic Program.
'Version :- 1.01.1001
'Object :- HTML_Help (Module)


'Function call provided...
'HelpMe(ProgWindow,HelpFile,[ContextID]) : Displays either help index or context sensitive help.

'Two parameters required, one optional...
'ProgWindow : Your Program's Window Handle.
'HelpFile : Filespec of the .CHM file to display.
'[ContextID] : If passed will open context help at that topic.

Const HH_DISPLAY_TOPIC = &H0
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 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


Rate Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 **



'will open a window containing the index of the specified help file. On both counts it returns the
'handle of the window created.
    Public Function HelpMe(ProgWindow As Long, HelpFile As String, Optional ContextID As Variant) As Long
        If IsMissing(ContextID) Then                                        'Display Root.
            HelpMe = HtmlHelp(ProgWindow, HelpFile, HH_DISPLAY_TOPIC, 0)
        Else                                                                'Context sensitive help.
            HelpMe = HtmlHelp(ProgWindow, HelpFile, HH_HELP_CONTEXT, ContextID)
        End If
    End Function


Download this snippet    Add to My Saved Code

Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 ** Comments

No comments have been posted about Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 **. Why not be the first to post a comment about Calling HTML Help (.CHM) files from within VB applications. ** Updated 30/12/02 **.

Post your comment

Subject:
Message:
0/1000 characters