Shell Command

PeteMac
09-30-2001, 08:53 AM
Can anyone tell me how I can allow a user to double-click on a file name and have that file loaded via it's associated applicaiton. This is mimicking what Windows Explorer does. Ideally I would like to force the user to close the invoked file/application before continuing with my application.
I will not know which application is required. It may be a map, cad/cam drawing, wordprocessing document, spreadsheet, in fact anything the user wants to connect to.

Thanks in anticipation

Squirm
09-30-2001, 08:57 AM
You need to look into the ShellExecute API:

<pre>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
</pre>

PrOpHeT
09-30-2001, 10:34 AM
Excellent link explains all the details

http://www.vbapi.com/ref/s/shellexecute.html

"No one can know everything, only so much as to drive us to look for the rest." -PrOpHeT-

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum