Private Sub Form_Load() App.HelpFile = app.path & "\help.chm" '调用与主程序同目录下的help.chm帮助文件,按F1键调用 End Sub |
Private Sub Form_Load() App.HelpFile = app.path & "\help.chm" End Sub private Sub CmdHelp_Click() SendKeys "{F1}" '发送击键到活动窗口 End Sub |
private Sub CmdHelp_Click() Shell "hh.exe help.chm", vbNormalFocus 'help.chm为指定的帮助文件,可包含路径。 End Sub |
Option Explicit Private Declare Function HtmlHelpA Lib "hhctrl.ocx" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long 'hwndCaller指定调用者的窗口,pszFile指定要调用的文件,uCommand是发送给 HtmlHelp的命令,dwData是uCommand的参数。 |
private Sub CmdHelp_Click() dim i as string i = app.path & "\help.chm" '用变量i记录与主程序同目录下的help.chm帮助文件 HtmlHelpA Form1.hWnd, i, 0, 0 End Sub |
Option Explicit '声明API函数用于异步打开一个文档 Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL = 1 |
private Sub CmdHelp_Click() dim a as long Dim b As String b = App.Path & "\help.chm" '用变量b记录与主程序同目录下的help.chm帮助文件 a = ShellExecute (0, "open", b, "", "", SW_SHOWNORMAL) End Sub |