Suchwort

Willie1, Mittwoch, 13.08.2008, 10:03 (vor 5706 Tagen)

Hallo Leute,
ich will eine CHM-Hilfe aus einem eigenen Programm heraus mit einem Schlüselwort der Index-Seite direkt die richtige Hilfeseite anzeigen lassen.
Der Anwender soll ein Suchwort eingeben und die Hilfe soll die entsprechende Seite anzeigen ohne dass der User erst die Hilfe-Datei aufrufen und zur Index-Sete wechseln muss. Das müsste sich doch machen lassen >
Ging mit der alten HLP-Hilfe ohne Probleme!

MfG
Willie

Suchwort

Ulrich Kulle ⌂, Mittwoch, 13.08.2008, 19:33 (vor 5706 Tagen) @ Willie1

Hallo willie1

» ich will eine CHM-Hilfe aus einem eigenen Programm heraus mit einem
» Schlüselwort der Index-Seite direkt die richtige Hilfeseite anzeigen
» lassen.
» Der Anwender soll ein Suchwort eingeben und die Hilfe soll die
» entsprechende Seite anzeigen ohne dass der User erst die Hilfe-Datei
» aufrufen und zur Index-Sete wechseln muss. Das müsste sich doch machen
» lassen >
» Ging mit der alten HLP-Hilfe ohne Probleme!

da stellt sich die Frage:
Mit welcher Programmiersprache und mit welcher Version der IDE>

Ich habe an der Thematik schon mal irgendwann "gebastelt" bin aber mit dem CHM internen Index nicht zu einem zufriedenstellenden Ergebnis gekommen.

Ist nicht ganz ohne ;-)
Für VB6 siehe und probiere die VB6_CHM.exe:
http://www.help-info.de/download/VB6_CHM.zip

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

Suchwort

Ulrich Kulle ⌂, Mittwoch, 13.08.2008, 19:41 (vor 5706 Tagen) @ Willie1

und etwas Coding zum lesen ;-)

[code]Public Sub SearchIndexKeyword(ByVal intHelpFile As Integer, ByVal sKeyword As String)
' ----------
' from http://msdn.microsoft.com/library/default.asp>url=/library/en-us/htmlhelp/html/vscon...
' 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[/code]

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

Suchwort

Willie1, Donnerstag, 14.08.2008, 12:49 (vor 5705 Tagen) @ Ulrich Kulle

Hallo Ullrich,
meine Programmiersprache ist Pascal und ich nutze Delphi 2005 und Turbo-Delphi.
... ist komplizierter als ich dachte. Du schreibst, dass die Lösung dich nicht ganz zufrieden stellt - wie muss ich das verstehen>

Ich habe seit Quick-Basic nicht mehr mit Basic programmiert, wenn du einen Source für Pascal hast, wäre das hilfreich.

MfG
W.

Suchwort

Ulrich Kulle ⌂, Donnerstag, 14.08.2008, 21:04 (vor 5705 Tagen) @ Willie1

Hallo Willie,

» meine Programmiersprache ist Pascal und ich nutze Delphi 2005 und
» Turbo-Delphi.
» ... ist komplizierter als ich dachte. Du schreibst, dass die Lösung dich
» nicht ganz zufrieden stellt - wie muss ich das verstehen>

Ich hatte versucht (auch mehrstufige) Keywords im Index zu finden und das geht wohl nur bedingt. Unzufrieden deshalb, weil ich das nicht sauber lösen konnte.

» Ich habe seit Quick-Basic nicht mehr mit Basic programmiert, wenn du einen
» Source für Pascal hast, wäre das hilfreich.

Einen Source für Pascal habe ich nicht. Bezüglich Delpi kann ich nur auf folgende Seite verweisen:
http://www.helpware.net/delphi/

So bleibt in jedem fall die Quälerei it der Übersetzung nach Pascal.

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

Suchwort

Willie1, Freitag, 15.08.2008, 09:07 (vor 5704 Tagen) @ Ulrich Kulle

Hallo Ullrich,


» Hallo Willie,
»
»
» Ich hatte versucht (auch mehrstufige) Keywords im Index zu finden und das
» geht wohl nur bedingt. Unzufrieden deshalb, weil ich das nicht sauber
» lösen konnte.
»
»
» Einen Source für Pascal habe ich nicht. Bezüglich Delpi kann ich nur auf
» folgende Seite verweisen:
» http://www.helpware.net/delphi/
»
Mit Delphi ab Version 9 ist die HTML-Hilfe Einbindung eigentlich kein Problem mehr.

» So bleibt in jedem fall die Quälerei it der Übersetzung nach Pascal.

Ich werde mich an die Arbeit machen.

Danke und schönen Gruß
Willie1

powered by my little forum