Help-Guide Forum


Dieses Forum wurde von Help-Guide.de eingerichtet, um Fragen zu stellen oder über Dinge zu diskutieren, die sich mit der Thematik Windows Hilfen und Hilfesysteme auseinandersetzen.
Ich bitte darum, dass sich alle Teilnehmer in diesem Forum an allgemein gültige Anstandsregeln halten.

Achtung! Aufgrund der Zunahme an Spam-Einträgen habe ich mich dazu entschieden, das Posten von Einträgen nur noch registrierten Usern zu ermöglichen. Achtung!

Zurück zur Homepage

Forums-Ausgangsseite

log in | registrieren

zurück zum Forum
Board-Ansicht  Mix-Ansicht

Suchwort

verfasst von Ulrich Kulle(R) Homepage, 13.08.2008, 19:41

und etwas Coding zum lesen ;-)

Public Sub SearchIndexKeyword(ByVal intHelpFile As Integer, ByVal sKeyword As String)
' ----------
' from http://msdn.microsoft.com/library/d...mlhelp/html/vsconStrhhaklink.asp
' new: http://msdn2.microsoft.com/en-us/library/ms524356.aspx
' modified by Ulrich Kulle [MVP]
' ------------
' cbStruct      Specifies the size of the structure. This value must always be filled in before passing the structure to the HTML Help API.
' fReserved     This parameter must be set to FALSE.
' pszKeywords   Specifies one or more ALink names or KLink keywords to look up. Multiple entries are delimited by a semicolon.
' pszUrl        Specifies the topic file to navigate to if the lookup fails. pszURL refers to a valid topic within the specified compiled help (.chm) file and does not support Internet protocols that point to an HTML file.
' pszMsgText    Specifies the text to display in a message box if the lookup fails and fIndexOnFail is FALSE and pszURL is NULL.
' pszMsgTitle   Specifies the caption of the message box in which the pszMsgText parameter appears.
' pszWindow     Specifies the name of the window type in which to display one of the following:
'               - The selected topic, if the lookup yields one or more matching topics.
'               - The topic specified in pszURL, if the lookup fails and a topic is specified in pszURL.
'               The Index tab, if the lookup fails and fIndexOnFail is specified as TRUE.
 
' fIndexOnFail  Specifies whether to display the keyword in the Index tab of the HTML Help Viewer if the lookup fails. The value of pszWindow specifies the Help Viewer.

' pszMsgText and pszMsgTitle.
' If fIndexOnFail is FALSE and pszURL is NULL, a message box appears using the text and caption specified in pszMsgText and pszMsgTitle.


' ALink name and KLink keyword lookups are case sensitive, and multiple keywords are delimited by a semicolon.
' If the lookup yields one or more matching topics, the topic titles appear in the Topics Found dialog box.
' ---------------
Dim hwnd As Long

Dim keyData As HH_AKLINK

  With keyData
    .cbStruct = Len(keyData)      ' size of this structure
    .fReserved = 0&               ' must be FALSE (really!)
    .pszKeywords = sKeyword
    .pszUrl = vbNullString
'    .pszMsgText = "keyword searched for: " + sKeyword      ' REM and message dosn't appear - test to jump to another outside topic
'    .pszMsgTitle = "Keyword Not Found"                     ' REM and message dosn't appear - test to jump to another outside topic
    .pszWindow = ""
    .fIndexOnFail = 0&            ' FALSE
  End With

'--- use HH_DISPLAY_INDEX to open the help window  ---------
'  hwnd = HTMLHelpTopic(hwnd, HFile(intHelpFile), HH_DISPLAY_INDEX, sKeyword)   ' uncomment for real search feature
'--- use HH_KEYWORD_LOOKUP to open the topic in the rigt pane  ---------
  hwnd = HtmlHelpIndex(hwnd, HFile(intHelpFile), HH_KEYWORD_LOOKUP, keyData)
  
  If keyData.pszUrl = vbNullString Then     ' --- only for test see above
    MsgBox "pszURL: is Null"
    MsgBox hwnd
    With keyData
      .cbStruct = Len(keyData)      ' size of this structure
      .fReserved = 0&               ' must be FALSE (really!)
      .pszKeywords = sKeyword
      .pszUrl = vbNullString
      .pszMsgText = "keyword searched for: " + sKeyword      ' REM and message dosn't appear
      .pszMsgTitle = "Keyword Not Found"                     ' REM and message dosn't appear
      .pszWindow = ""
      .fIndexOnFail = 0&            ' FALSE
    End With
        '--- use HH_DISPLAY_INDEX to open the help window  ---------
    HTMLHelpTopic hwnd, HFile(intHelpFile), HH_DISPLAY_INDEX, sKeyword    ' uncomment for real search feature
    '--- use HH_KEYWORD_LOOKUP to open the topic in the rigt pane  ---------
    hwnd = HtmlHelpIndex(hwnd, HFile(intHelpFile), HH_KEYWORD_LOOKUP, keyData)
  Else
    MsgBox "pszURL: is NOT Null"
    MsgBox hwnd
    With keyData
      .cbStruct = Len(keyData)      ' size of this structure
      .fReserved = 0&               ' must be FALSE (really!)
      .pszKeywords = sKeyword
      .pszUrl = vbNullString
      .pszMsgText = "keyword searched for: " + sKeyword      ' REM and message dosn't appear
      .pszMsgTitle = "Keyword Not Found"                     ' REM and message dosn't appear
      .pszWindow = ""
      .fIndexOnFail = 0&            ' FALSE
    End With
  
    '--- use HH_DISPLAY_INDEX to open the help window  ---------
    HTMLHelpTopic hwnd, HFile(intHelpFile), HH_DISPLAY_INDEX, sKeyword    ' uncomment for real search feature
    '--- use HH_KEYWORD_LOOKUP to open the topic in the rigt pane  ---------
    HtmlHelpIndex hwnd, HFile(intHelpFile), HH_KEYWORD_LOOKUP, keyData
  End If
  
End Sub

---
Mit besten Grüßen
Ulrich Kulle
Microsoft MVP - Help
************************
http://www.help-info.de
Unterstützen Sie Help-Info.de durch eine PayPal Spende!
https://www.paypal.com

 

gesamter Thread:

zurück zum Forum
Board-Ansicht  Mix-Ansicht
742 Postings in 299 Threads, 105 registrierte User, 7 User online (0 reg., 7 Gäste)
Help-Guide Forum | Kontakt
powered by my little forum