跪求:如何在程序中,调用chm格式的帮助文件
大虾们,我制作好了chm格式的帮助文件,请问如何在菜单栏中,调用帮着文件啊!
[解决办法]
方法很多,我知道几种方法
一:
使用HtmlHelp:
Const HH_DISPLAY_TOPIC = &H0
Const HH_CLOSE_ALL = &H12
Private Sub cmdOpen_Click()
Dim hwndHelp As Long
hwndHelp = HtmlHelp(hWnd, app.path+ "readme.chm ",HH_DISPLAY_TOPIC, 0)
end sub
Private Sub Form_Unload(Cancel As Integer)
HtmlHelp Me.hWnd, " ", HH_CLOSE_ALL, 0
End Sub
二:
工程属性-〉选定帮助文件即可
三:
用ShellExecute.
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
然后这样调用:
ShellExecute 0&, vbNullString, App.Path & "\readme.chm ", vbNullString, vbNullString, vbNormalFocus
四:
shell "hh.exe " & "cch.chm "
五:
WinHelp(Me.hwnd, MyHelpFileName, HELP_CONTENTS, 10)
注:有的方法可打开多种类型的帮助文件,有的只能打开一种
[解决办法]
shell "hh.exe " & "cch.chm "
最简洁的
[解决办法]
MARK