Search Tools Links Login

Implement chm Help in Visual Basic


Give your app a more polished appearance by using .chm files for your help system.

First place a existing chm File in the project path. You must know what name your htm pages have to work correct.

Module

Option Explicit
Private Declare Function HtmlHelpTopic Lib "hhctrl.ocx" Alias _
    "HtmlHelpA" (ByVal hWnd As Long, ByVal lpHelpFile As String, _
    ByVal wCommand As Long, ByVal dwData As String) As Long

Sub ShowHtmlHelp(ByVal tHelpFile As String, ByVal tHelpPage As String)
    Const HH_DISPLAY_TOPIC =3D &H0
    On Error Resume Next
    ' open the help page in a modeless window
    HtmlHelpTopic 0, tHelpFile, HH_DISPLAY_TOPIC, tHelpPage
End Sub

Usage

Put a command button to your form and name it cmdHelp

Private Sub cmdHelp_Click()
    'This is only a example
    ShowHtmlHelp App.path & "\MyHelp.chm", "Introduction.htm"
End Sub

About this post

Posted: 2019-09-25
By: Arthur
Viewed: 259 times

Categories

Visual Basic 6

Attachments

No attachments for this post

Special Instructions

This code originally appeared on AndreaVB.com, and has been republished here with the permission of Andrea Tincani.


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.