|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to lauch associated app to file extension & view fileI need to emulate double clicking on a file from Windows Explorer (launch
associated app & load file in to app) without having to know the path/file name of the app. If this is possible, how? I was able to do it with Shell but I need know the path/file name of the app. The associated app can be different on each workstation let alone differnt version of the app (different folder and/or file name). The Shell way could work if there is a way to obtain for the OS the path/file name of the app associated to the file extension. You want the ShellExecute API:
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 Dim Result as Long Result = ShellExecute(0, "Open", "http:\\www.worship-him.com", "", APP.Path, SW_SHOWMAXIMIZED) -Woodie Show quoteHide quote "MAB" <M**@discussions.microsoft.com> wrote in message news:12288042-701C-493A-96E8-6139C684EF30@microsoft.com... >I need to emulate double clicking on a file from Windows Explorer (launch > associated app & load file in to app) without having to know the path/file > name of the app. If this is possible, how? > > I was able to do it with Shell but I need know the path/file name of the > app. The associated app can be different on each workstation let alone > differnt version of the app (different folder and/or file name). The > Shell > way could work if there is a way to obtain for the OS the path/file name > of > the app associated to the file extension. Works like a champ! Thank you Woodie.
Show quoteHide quote "Woodie M" wrote: > You want the ShellExecute API: > > 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 > > Dim Result as Long > Result = ShellExecute(0, "Open", "http:\\www.worship-him.com", "", APP.Path, > SW_SHOWMAXIMIZED) > > -Woodie > > > "MAB" <M**@discussions.microsoft.com> wrote in message > news:12288042-701C-493A-96E8-6139C684EF30@microsoft.com... > >I need to emulate double clicking on a file from Windows Explorer (launch > > associated app & load file in to app) without having to know the path/file > > name of the app. If this is possible, how? > > > > I was able to do it with Shell but I need know the path/file name of the > > app. The associated app can be different on each workstation let alone > > differnt version of the app (different folder and/or file name). The > > Shell > > way could work if there is a way to obtain for the OS the path/file name > > of > > the app associated to the file extension. > > |
|||||||||||||||||||||||