用API:ShellExecute()运行就可以了。

解决方案 »

  1.   

    The steps needed to use the HTML Help API in a Visual Basic application are: Declare the HTML Help constants. 
    Declare the HtmlHelp() function. 
    Call the HtmlHelp() function with valid parameters. 
    The following code fragments demonstrate these steps: 
    The HTML Help constants are defined as follows:       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. The HtmlHelp() function is declared as follows:       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 The following are examples of how to call the HTML Help API from Visual Basic:       ' HTML Help file launched in response to a button click:
          Private Sub HH_DISPLAY_Click()
          'hWnd is a Long defined elsewhere to be the window handle
          'that will be the parent to the help window.
             Dim hwndHelp As Long
             'The return value is the window handle of the created help window.
             hwndHelp = HtmlHelp(hWnd, "myfile.chm", HH_DISPLAY_TOPIC, 0)
          End Sub      ' A specific topic identified by the variable ContextID is launched
          ' in response to this button click:
          Private Sub HH_HELP_Click()
             Dim hwndHelp As Long
             'The return value is the window handle of the created help window.
            hwndHelp = HtmlHelp(hWnd, "myfile.chm", HH_HELP_CONTEXT, ContextID)
          End Sub 
      

  2.   

    要简单的话,可以用以下方法:
    在Form的load 事件中加入:   App.HelpFile = App.Path & "\CoomRoomHelp.chm"
    它确定了你要用的帮助文件名,
    运行程序时,可以按键盘上的《F1》键,而要用鼠标完成调用的目的的话,可以用:
     SendKeys "{F1}"(即将此句加入到某单击事件中去)
    我用这种方法效果很好,不妨一试!
      

  3.   

    对了,要说明的是,App.HelpFile = App.Path & "\CoomRoomHelp.chm"中的CoomRoomHelp.chm是我用的帮助文件名,使用时,换成自己的帮助文件名即可啦!
      

  4.   

    我总是用Shell hh XXXX.chm, vbNormalFocus