1 Replies - 516 Views - Last Post: 13 July 2017 - 09:23 AM Rate Topic: -----

#1 ahmedcrow  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

Creating commandbutton for HTML help

Posted 11 July 2017 - 07:32 AM

I made simple help file (.chm) and typed this code in Form_load:

 app.helpfile = app.path & "\help.chm" 


then I assigned the "HelpContextId" property for forms in project, the html help worked good when I pressed F1 in every form but I want to make help commandbutton but I don't know what to type in the click procedure.
Is This A Good Question/Topic? 0
  • +

Replies To: Creating commandbutton for HTML help

#2 ahmedcrow  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

Re: Creating commandbutton for HTML help

Posted 13 July 2017 - 09:23 AM

Somebody gave me this code and it works, I tested it:

Const HH_DISPLAY_TOPIC = &H0
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE   ' Display string resource ID or text in a pop-up window.
Const HH_HELP_CONTEXT = &HF         ' Display mapped numeric value in dwData.
Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to WinHelp's HELP_CONTEXTMENU.
Const HH_TP_HELP_WM_HELP = &H11     ' text pop-up help, similar to WinHelp's HELP_WM_HELP.
Const HH_CLOSE_ALL = &H12

Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long

Private Sub Command1_Click()
 'KPD-Team 2000
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    Dim hwndHelp As Long
    'The return value is the window handle of the created help window.
    hwndHelp = HtmlHelp(me.hWnd, App.Path & "\help.chm", HH_HELP_CONTEXT, 20)
End Sub

Private Sub Form_Unload(Cancel As Integer)
HtmlHelp Me.hWnd, "", HH_CLOSE_ALL, 0
End Sub




This site help: http://allapi.mental.../HtmlHelp.shtml

This post has been edited by ahmedcrow: 13 July 2017 - 09:25 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1