'In a global module, place the following in your declaration section:
Declare Function WinHelp LIb "user32" Alias "WinHelpA" (ByVal HWnd as Long, ByVal lpHelpFile As String, ByVal wCommand as Long, ByVal dwData As Long) As Long
'Then define some constants that may be helpful:
Global Const HELP_CONTEXT = &H1
Global Const HELP_QUIT = &H2
Global Const HELP_INDEX = &H3
Global Const HELP_HELPONHELP = &H4
Global Const HELP_SETINDEX = &H5
Global Const HELP_KEY = &H101
Global Const HELP_MULTIKEY = &H201
Global vHelp&
'be sure to set the App.Helfile by (for example in the first form_load event):
App.Helfpfile = App.Path & "\" & App.ExeName & ".hlp"
'this gives you a helpfile located in the executable directory with the same name
as youre executable only with the extesion HLP
'In the click
Event for the control you choose to open
the helpfile, place the code:
vHelp& = WinHelp(Form1.hWnd, App.HelpFile, HELP_INDEX, CLNG(0))
'And that will bring up your help
file.
'Be sure and attach the following code to the form_unload event of the form where you end
youre program
Dim dummy
as String
vHelp& = WinHelp(Form1.hWnd, dummy, HELP_QUIT, 0)
Return