Results 1 to 8 of 8

Thread: Show the help-file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    100
    Howdi..

    I have put the path to the help-file in the "Project properties and if I press "F1" the HTML Help show's the help-file.

    THE QUESTION:
    How do I show the help-file from a menu. I tryed to use "SendKey ({F1})" and it works if the program is active but since I have a a icon in the tray icon bar where a menu is shown on right-click it's not sure that the program is active and I send the F1 key to something else.

    Any ideá?

  2. #2
    Guest
    Private Sub OpenHelp(file As String)
    Dim lngResult As Long
    lngResult = ShellExecute(frm1.hwnd, "Open", file, "", "", vbNormalFocus)
    End Sub

    Invoke this as
    Call OpenHelp(strhelp)

    in mnuHelp_click()

  3. #3
    Guest
    Or you can use the Shell method.
    Code:
    Shell "hh.exe MyCHTM.chm", 1

  4. #4
    Guest
    When I used the Shell method, on some client machines, even though the task manager showed the Help file, i could not access it by any method and my application always had focus .

    Any ideas why?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    100
    Sub or Function not defined is the only thing I get if I use sarun's example..

    Is there anything missing in the code?

  6. #6
    Guest
    Where is the sub defined(in a module?)

    Note that it is declared as Private


  7. #7
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    You must declare the API:
    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
    lpOperation As String, ByVal lpFile As String, ByVal _
    lpParameters As String, ByVal lpDirectory As String, ByVal _
    nShowCmd As Long) As Long
    
    
    Private Sub OpenHelp(file As String) 
    Dim lngResult As Long 
    lngResult = ShellExecute(frm1.hwnd, "Open", file, "", "", vbNormalFocus) 
    End Sub 
    
    'Invoke this as 
    Call OpenHelp(strhelp)
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  8. #8
    Guest
    Oops! Sorry I forgot to mention that.

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