Results 1 to 4 of 4

Thread: how do I specify a help file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    118

    Question how do I specify a help file

    I people...

    I would like to know. I have a .HLP file (help file). I need it to open if the user press F1 or click on the 'Help' on the MENU.

    How do I it? I just want to open it.... no helpindex etc.

    thanks!

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Sample for u Sundance Kid

    VB Code:
    1. Private Declare Function WinHelp _
    2.  Lib "user32" Alias "WinHelpA" ( _
    3.  ByVal hwnd As Long, _
    4.  ByVal lpHelpFile As String, _
    5.  ByVal wCommand As Long, _
    6.  ByVal dwData As Long) As Long
    7.  
    8. Private Const HELP_CONTENTS = &H3&
    9. Private Const HELP_QUIT = &H2
    10.  
    11. Private Sub mnuHelp_Click()
    12.     WinHelp Me.hwnd, App.Path & "\HelpFile.hlp", HELP_CONTENTS, 0
    13. End Sub
    14.  
    15. Private Sub Form_Unload(Cancel As Integer)
    16.     WinHelp Me.hwnd, "", HELP_QUIT, 0
    17. End Sub
    -= a peet post =-

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    118
    Thanks peet

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Your welcome

    You can also use shellexecute....

    VB Code:
    1. Option Explicit
    2.  
    3.  
    4. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    5.                 (ByVal hwnd As Long, ByVal lpszOp As String, _
    6.                  ByVal lpszFile As String, ByVal lpszParams As String, _
    7.                  ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    8.                  As Long
    9. Private Const SW_SHOWNORMAL = 1
    10.  
    11. Private Sub Command1_Click()
    12.     'Open a web page
    13.     Dim l As Long
    14.     l = ShellExecute(Me.hwnd, "Open", "http://www.vbworld.com", "", "C:\", SW_SHOWNORMAL)
    15. End Sub
    16.  
    17.  
    18. Private Sub Command2_Click()
    19.     'Open a document
    20.     Dim l As Long
    21.     l = ShellExecute(Me.hwnd, "Open", App.Path & "\Test.Doc", "", "C:\", SW_SHOWNORMAL)
    22. End Sub
    -= a peet post =-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width