Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB7
Expertise: beginner
Jun 30, 2003

ShowOpenWithDialog - Displaying and opening a file through the "Open with..." dialog

' Display the "Open with..." dialog and open the specified file with the 
' selected program
' Example: ShowOpenWithDialog("d:\test.txt")

<System.Runtime.InteropServices.DllImport("shell32")> Shared Function _
    ShellExecute(ByVal hwnd As Integer, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
End Function

Sub ShowOpenWithDialog(ByVal filename As String)
    ShellExecute(0, String.Empty, "RUNDLL32.EXE", "shell32.dll,OpenAs_RunDLL " _
        & filename, "", 0)
End Sub
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date