HTMLHelp Search

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
 
M

meh

No I actually bypassed that stuff for a more rapid development
environment....I use

Private Sub mnuHelpSearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuHelpSearch.Click

Help.ShowHelp(Me, "urHelp.chm", HelpNavigator.Find, "")

End Sub


Which brings up the search Tab


meh
 
S

Scott

Yes. I know that works. I've done it. However, how do you control where the
window is shown with this method. I was using the API functions so that I
could position the window (height, width, maximized, etc.) correctly when I
load the help file. The API functions return the window handle so this is a
simple task. How do you get the window handle when using the .NET help
classes without using a FindWindow call or something of that nature?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top