ðHgeocities.com/Heartland/Pond/4805/running_help.htmgeocities.com/Heartland/Pond/4805/running_help.htm.delayedxÚPÔJÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0WìAOKtext/html€çhAÿÿÿÿb‰.HSun, 20 Jan 2002 13:04:33 GMToMozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)en, *ÚPÔJA Running a Help File

Running a Help File

Source :  newsgroup:access.formscoding


' Win Help Declarations
Public Const HELP_CONTEXT = &H1         'Display topic for Help context ID.
Public Const HELP_QUIT = &H2            'Terminate Help.
Public Const HELP_INDEX = &H3           'Display Help index.
Public Const HELP_CONTEXTPOPUP = &H8&   'Display Help context as a pop-up
                                        'window.
Public Const HELP_FINDER = &HB&         'If found, Display container file.
Public Const HELP_KEY = &H101           'Display topic for keyword.

'Declare the WinHelp function.
Declare Sub jlv_WinHelp Lib "user32" Alias "WinHelpA" (ByVal Hwnd As Long, _
    ByVal lpHelpFile As String, ByVal wCommand As Long, _
    ByVal dwData As Any)

Function OpenHelpContainer(ByVal strHelpFileName As String)
    'Opens the Help container.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, _
        HELP_FINDER, ByVal vbNullString
End Function

Function OpenHelpIndex(ByVal strHelpFileName As String)
    'Opens the Help index.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, HELP_KEY,
_
        ByVal ""
End Function

Function OpenHelpIndexWithSearchKey(ByVal strHelpFileName As String, _
        ByVal strSearchKey As String)
    'Opens the Help index and searches for keyword SKey.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, HELP_KEY,
_
        ByVal strSearchKey
End Function

Function OpenHelpWithContextID(ByVal strHelpFileName As String, _
        lngContextID As Long)
    'Opens the Help file to ContextID.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, _
        HELP_CONTEXT, ByVal lngContextID
End Function

Function OpenHelpWithContextIDPopup(ByVal strHelpFileName As String, _
        lngContextID As Long)
    'Opens the Help file to ContextID as a pop-up window.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, _
        HELP_CONTEXTPOPUP, ByVal lngContextID
End Function

Function CloseHelpContainer(ByVal strHelpFileName As String)
    'Closes the specified Help file.
    jlv_WinHelp Application.hWndAccessApp, ByVal strHelpFileName, HELP_QUIT,
_
        ByVal vbNullString
End Function
 


Note that I've prefixed the WinHelp function declaration with my initials to
avoid any possible conflict with library declarations.
--
John Viescas, author
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/