Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running windows app
Message
 
To
24/09/1998 15:24:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00140547
Message ID:
00140561
Views:
20
>I have a file stored in a table and i want to run a windows app based on the files extension. what is the best way to accomplish this. Thanks

Hi Mark,

I assume you mean that you want to run the application associated with a particular file. To do this, use the Windows API function ShellExecute(). Here's an example:
DECLARE INTEGER ShellExecute IN Shell32;
  INTEGER hwnd, STRING @lpOperation, STRING @lpFile,;
  STRING @lpParameters, STRING @lpDirectory, SHORT nshow
lcop = "open"
lcparms = ""
* In versions before 6.0 you'll have to load the
* foxtools.fll library
* lcfile is your file name
lcdir = JUSTPATH(lcfile)
* lnshow set to normal
lnshow = 1
lnresult = ShellExecute(0, @lcop, @lcfile, @lcparms, @lcdir, lnshow)
IF lnresult < 32
  * An error occurred.
  * If no application is associated with the file
  * 31 is returned.
ENDIF
hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform