>Cetin,
>
>I'll nutshell for you what I'm trying to do in my application:
>
>I want to load a File Open Dialog; have the user select a drawing (raster type) file; Click OK; Load the Drawing Viewer program with the selected file loaded in Drawing Viewer application.
>
>I know that GETFILE() will return something like E:\DATA\DWG\2299\2299A.MIL.
>
>I can then parse this string for .MIL extension, pass this extension to your method to find the Drawing Viewer program; then exec this application with ShellExecute() with this file loaded.
>
>Fz
OK Donald,
You know the filename returned from GetFile() :
lcFile = "E:\DATA\DWG\2299\2299A.MIL"
If you're not really interested in knowing which exe runs it (Like windows explorer dblclick and it opens with associated file) :
Need to wait for return (George Tasker's code) :
oWS = createobject('Wscript.Shell')
oWS.Run(lcFile,5,.t.)
You don't want to wait for a return (as if user independently dblclicked in windows explorer) :
declare long ShellExecute in "shell32.dll" ;
long hwnd, string lpszOp, ;
string lpszFile, string lpszParams, ;
string lpszDir, long nShowCmd
ShellExecute(0,'Open',lcFile,0,0,1)
Cetin