Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

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.



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