
Hi, how can i launch an application using a file of this application
Quote:
>Hi i need to launch an application For example Microsoft Photo Editor giving
>the name of a gif file
>Thanks
You need to use the ShellExecute API function. It's use is as follows:
' In a standard module
Public 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
Public Const SW_HIDE = 0
Public Const SW_MINIMIZE = 6
Public Const SW_RESTORE = 9
Public Const SW_SHOW = 5
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
' In the event of your choice
Dim lngRetVal As Long
lngRetVal = ShellExecute(Me.hwnd, "open", "C:\Temp\MyGif.Gif", vbNullString,
"C:\Windows\Temp", SW_SHOWNORMAL)
Change the "C:\Temp\MyGif.Gif" to a string specifying the file you want to open.
Change the "C:\Windows\Temp" to the directory you want to open the file in. The
SW_SHOWNORMAL parameter can be changes to any of the public constants listed.
They're pretty self explanitory. :)
Hope this helps....
Sheppe Pharis, MCP * 3/TekMetrics VB Certified
VB5/VB6/VBS/ActiveX Developer