Results 1 to 2 of 2

Thread: associated file's program

  1. #1

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    associated file's program

    hi
    What is the API that identify what program must open determinated file?

    I need to call a web browser or something to open a html file.

    thanks
    bye
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  2. #2
    Matthew Gates
    Guest
    Just use the ShellExecute API function, which will open a file's associated program.


    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" _
    2. Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
    3. String, ByVal lpFile As String, ByVal lpParameters As String, ByVal _
    4. lpDirectory As String, ByVal nShowCmd As Long) As Long
    5.  
    6. Private Sub OpenFile(sFile As String)
    7.     ShellExecute Me.hwnd, "Open", "C:\MyPage.htm", vbNullString, vbNullString, 1
    8. End Sub

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