HOWTO: Use HTML Help API in a Visual Basic Application --------------------------------------------------------------------------------
The information in this article applies to:Microsoft Visual Basic Professional and Enterprise Editions, 32-bit only, for Windows, versions 4.0, 5.0, 6.0
Microsoft HTML Help 1.3--------------------------------------------------------------------------------
SUMMARY
This article describes the steps necessary to use the HTML Help API in a Visual Basic application. MORE INFORMATION
The steps needed to use the HTML Help API in a Visual Basic application are: Declare the HTML Help constants.
Declare the HtmlHelp() function.
Call the HtmlHelp() function with valid parameters.
The following code fragments demonstrate these steps:
The HTML Help constants are defined as follows: 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. The HtmlHelp() function is declared as follows: 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 The following are examples of how to call the HTML Help API from Visual Basic: ' HTML Help file launched in response to a button click:
Private Sub HH_DISPLAY_Click()
'hWnd is a Long defined elsewhere to be the window handle
'that will be the parent to the help window.
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 ' A specific topic identified by the variable ContextID is launched
' in response to this button click:
Private Sub HH_HELP_Click()
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
hwndHelp = HtmlHelp(hWnd, "myfile.chm", HH_HELP_CONTEXT, ContextID)
End Sub 第二个问题,
你要用App.path 设定数据库的相对路径!
The information in this article applies to:Microsoft Visual Basic Professional and Enterprise Editions, 32-bit only, for Windows, versions 4.0, 5.0, 6.0
Microsoft HTML Help 1.3--------------------------------------------------------------------------------
SUMMARY
This article describes the steps necessary to use the HTML Help API in a Visual Basic application. MORE INFORMATION
The steps needed to use the HTML Help API in a Visual Basic application are: Declare the HTML Help constants.
Declare the HtmlHelp() function.
Call the HtmlHelp() function with valid parameters.
The following code fragments demonstrate these steps:
The HTML Help constants are defined as follows: 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. The HtmlHelp() function is declared as follows: 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 The following are examples of how to call the HTML Help API from Visual Basic: ' HTML Help file launched in response to a button click:
Private Sub HH_DISPLAY_Click()
'hWnd is a Long defined elsewhere to be the window handle
'that will be the parent to the help window.
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 ' A specific topic identified by the variable ContextID is launched
' in response to this button click:
Private Sub HH_HELP_Click()
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
hwndHelp = HtmlHelp(hWnd, "myfile.chm", HH_HELP_CONTEXT, ContextID)
End Sub 第二个问题,
你要用App.path 设定数据库的相对路径!
解决方案 »
- 关于shell,cmd 与[开始菜单->运行]的问题
- 如何用VB打开和关闭COM口?
- Mscomm控件怎么自动适应不同的校验方式?
- 几个简单的问题,在线等
- 在VB中如何实现多线程?如在Form上一边实现文字的滚动显示,同时可以响应各种消息。
- 关于MP2格式音频音量大小
- 如何删除列表框的重复项目?
- 这个验证码识别可以在XP+IE8+excel2007中正确识别,谁能让它在win7-64+IE11+excel2010中正确识别?
- 如何获得webbroswser控件上显示的图片?
- 小白请教VB
- 关于在2000下使用98下程序的问题
- OFFICE启动WORD时会调用哪个链接库文件,在注册表中如何体现?
也就是他会将我的相对路径重复两遍当作数据库路径。不知怎样能不使用它自己的搜索路径。
App.HelpFile = App.Path + "\help.chm"
private sub help_click()
frmMain.HelpContextID = 0
SendKeys "{F1}"
end subDim str As String
str = App.PathIf Right(str, 1) <> "\" Then
str = str + "\"
End If
dim StrdatabasePath as string
dim app_path as string
If Right(app_path, 1) = "\" Then
app_path = left(app_path ,len(app_path)-1)
End If
StrDatabasePath = app_path & "\mymdb.mdb"
ConnSchool.ConnectionString = "Provider= Microsoft.Jet.OLEDB.3.51;" _
& "Data Source = ' " & StrDatabasePath & " '"
ConnSchool.Open
以上是源程序,没重复负值和逻辑错误啊,是不是Ado的某些设置有关?
up!!