Bestimmte Seite einer CHM-Hilfe aufrufen

  • VB.NET

Es gibt 10 Antworten in diesem Thema. Der letzte Beitrag () ist von freecoder.

    oh sorry, der link war falsch:
    vbarchiv.net/tipps/tipp_400-be…-html-hilfe-anzeigen.html

    hier mein code:

    VB.NET-Quellcode

    1. ' HTML-Help
    2. Private Declare Function HtmlHelpTopic Lib "hhctrl.ocx" _
    3. Alias "HtmlHelpA" ( _
    4. ByVal hWnd As Long, _
    5. ByVal lpHelpFile As String, _
    6. ByVal wCommand As Long, _
    7. ByVal dwData As String) As Long
    8. Private Const HH_DISPLAY_TOPIC = &H0
    9. ' Öffnen und Anzeigen einer HTML-Seite
    10. ' anhand des "internen" HTML-Dateinamens
    11. Sub ShowHTMLHelp(ByVal tsHelpFile As String, _
    12. ByVal tsHelpPage As String)
    13. On Error Resume Next
    14. HtmlHelpTopic(0, tsHelpFile, HH_DISPLAY_TOPIC, _
    15. tsHelpPage)
    16. End Sub
    17. 'Hilfe aufrufen
    18. Private Sub cmdHilfe_Click()
    19. Dim hlpFile As String
    20. hlpFile = My.Application.Info.DirectoryPath & "\Hilfe.chm"
    21. ShowHTMLHelp(hlpFile, "Willkommen.htm")
    22. End Sub


    Fehlerbeschreibung:
    wenn ich jetzt den sub "cmdHilfe_Click" aufrufe, passiert gar nichts, obwohl die CHM-Hilfe wie auch die Html-Seite (in der Hilfe) vorhanden ist. Weiß nicht, woran das liegen könnte. :S
    mit diese Code kannst du belibiege Seite in Hilfe Datei öffnen:

    VB.NET-Quellcode

    1. Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" ( _
    2. ByVal hwndCaller As Int32, _
    3. ByVal pszfile As String, _
    4. ByVal ucommand As Int32, _
    5. ByVal dwdata As Int32) As Int32
    6. Private Const HH_DISPLAY_TOPIC As Int32 = &H0
    7. Private Const HH_HELP_CONTEXT As Int32 = &HF
    8. Private Sub Help_ID (ByVal HelpFile As String, ByVal ID As Integer)
    9. If ID = 0 Then HtmlHelp 0, HelpFile, HH_DISPLAY_TOPIC, ByVal 0&
    10. If ID > 1 Then HtmlHelp 0, HelpFile, HH_HELP_CONTEXT, ID
    11. End Sub


    NICHT GETESTET !
    so soll das funz !

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Alex2000“ ()

    wie man ein Prozedur aufruft solltest du eingetlich wissen:
    HelpFile = pfad+ dateiname
    ID = Seiten nummer in Hilfe Datei

    Schau dir der VB6 Code etwas genauer an:

    VB.NET-Quellcode

    1. ' Hilfe aufrufen (Context)
    2. Private Sub cmdHilfe_Click()
    3. Dim hlpFile As String
    4. Dim ContextID AS Long
    5. hlpFile = App.Path & "DeineHilfe.chm"
    6. ' Context-ID
    7. ContextID = 100
    8. HtmlHelp 0, hlpFile, HH_HELP_CONTEXT, ContextID
    9. End Sub
    ich würde an deine stelle so machen:

    VB.NET-Quellcode

    1. Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" ( _
    2. ByVal hwndCaller As Int32, _
    3. ByVal pszfile As String, _
    4. ByVal ucommand As Int32, _
    5. ByVal dwdata As Int32) As Int32
    6. Private Const HH_DISPLAY_TOPIC As Int32 = &H0
    7. 'Diese Code schreiben in irgend ein event
    8. Call HtmlHelp 0, HelpFile, HH_DISPLAY_TOPIC,0



    [PDF] Rezepte und Lösungen für Microsoft VB.Net 5 Hilfe <<< das kann dir schon helfen ohne APIs

    Dieser Beitrag wurde bereits 6 mal editiert, zuletzt von „Alex2000“ ()

    der link ist sehr interessant! danke!

    habs jetzt geschafft; wens interessiert: Mit Windows.Forms.Help.ShowHelp kann man CHM-Dateien und bestimmte Seiten daraus anzeigen lassen:

    VB.NET-Quellcode

    1. Windows.Forms.Help.ShowHelp(Me, My.Application.Info.DirectoryPath & "\Hilfe.chm", "C/Dragon%20Hilfe/Lizenz.htm")