S
Scott
I'm trying to use the HTMLHelp API calls in a VB.NET program because I want
a little more functionality than is offered by the Help class in .NET.
Everything works fine except for displaying the "Search" tab. Has anyone
gotten this to work?
This is what I have so far.... The HTMLHelp API call always returns 0...
' HTML Help function for showing search
Private Const HH_DISPLAY_SEARCH As Short = &H3
Private Declare Function HTMLHelpSearch Lib "hhctrl.ocx" Alias
"HtmlHelpA" _
(ByVal hWnd As Integer, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByRef dwData As tagHH_FTS_QUERY) As Int32
' HTML Help Search Structure
Private Structure tagHH_FTS_QUERY
Public cbStruct As Integer ' Sizeof structure in bytes.
Public fUniCodeStrings As Boolean ' TRUE if all strings are
unicode.
Public pszSearchQuery As String ' String containing the search
query.
Public iProximity As Long ' Word proximity.
Public fStemmedSearch As Boolean ' TRUE for StemmedSearch only.
Public fTitleOnly As Boolean ' TRUE for Title search only.
Public fExecute As Boolean ' TRUE to initiate the search.
Public pszWindow As String ' Window to display in
End Structure
' ShowWindow API call
Const SW_MAXIMIZE As Integer = 3
Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Int32, ByVal
nCmdShow As Int32) As Int32
' Show search page
Public Sub ShowHelpSearch()
' Create search struct
Dim ss As tagHH_FTS_QUERY
ss.cbStruct = Len(ss)
ss.fUniCodeStrings = 0&
ss.fTitleOnly = 0&
ss.fExecute = 1&
ss.fStemmedSearch = 0&
ss.pszWindow = ""
ss.pszSearchQuery = ""
ss.iProximity = 0&
' Display the search tab
Dim hhWnd As Int32
hhWnd = HTMLHelpSearch(fMainForm.Handle.ToInt32, helpFile,
HH_DISPLAY_SEARCH, ss)
' Position help window
ShowWindow(hhWnd, SW_MAXIMIZE)
End Sub
a little more functionality than is offered by the Help class in .NET.
Everything works fine except for displaying the "Search" tab. Has anyone
gotten this to work?
This is what I have so far.... The HTMLHelp API call always returns 0...
' HTML Help function for showing search
Private Const HH_DISPLAY_SEARCH As Short = &H3
Private Declare Function HTMLHelpSearch Lib "hhctrl.ocx" Alias
"HtmlHelpA" _
(ByVal hWnd As Integer, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByRef dwData As tagHH_FTS_QUERY) As Int32
' HTML Help Search Structure
Private Structure tagHH_FTS_QUERY
Public cbStruct As Integer ' Sizeof structure in bytes.
Public fUniCodeStrings As Boolean ' TRUE if all strings are
unicode.
Public pszSearchQuery As String ' String containing the search
query.
Public iProximity As Long ' Word proximity.
Public fStemmedSearch As Boolean ' TRUE for StemmedSearch only.
Public fTitleOnly As Boolean ' TRUE for Title search only.
Public fExecute As Boolean ' TRUE to initiate the search.
Public pszWindow As String ' Window to display in
End Structure
' ShowWindow API call
Const SW_MAXIMIZE As Integer = 3
Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Int32, ByVal
nCmdShow As Int32) As Int32
' Show search page
Public Sub ShowHelpSearch()
' Create search struct
Dim ss As tagHH_FTS_QUERY
ss.cbStruct = Len(ss)
ss.fUniCodeStrings = 0&
ss.fTitleOnly = 0&
ss.fExecute = 1&
ss.fStemmedSearch = 0&
ss.pszWindow = ""
ss.pszSearchQuery = ""
ss.iProximity = 0&
' Display the search tab
Dim hhWnd As Int32
hhWnd = HTMLHelpSearch(fMainForm.Handle.ToInt32, helpFile,
HH_DISPLAY_SEARCH, ss)
' Position help window
ShowWindow(hhWnd, SW_MAXIMIZE)
End Sub