哎,本来是懒得查msdn的,
函数声明
Function HtmlHelpA (hwnd:integer;lpHelpFile:string;
wCommand:integer;
dwData:string) external 'hhctrl.ocx';
函数调用
htmlhelpA(form1.handle,你的帮助文件, HH_DISPLAY_TOPIC, "登录日记.htm")
下面是vb的例子,你自己看着定义hh_display_topic和其它的常量吧
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
使用
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.
Const HH_CLOSE_ALL = &H12
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
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
hwndHelp = HtmlHelp(hWnd, "myfile.chm", HH_DISPLAY_TOPIC, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
HtmlHelp Me.hWnd, "", HH_CLOSE_ALL, 0
End Sub