Shell Execute

See Also

Category System utility
Default Catalog Visual FoxPro Catalog\Foundation Classes\Utilities
Class _shellexecute
Class Library _environ.vcx
Parent Class _custom
Sample ...\Samples\Vfp98\Solution\OLE\Buttons.scx

Remarks

This class enables you to launch an application or document with its associated application from the current application.

To use, drop the class on a project or form or, from the Component Gallery Item Shortcut menu, select Add to Project or Add to Form. When you add the class to a form, Visual FoxPro places the class on the form. You can then specify the appropriate property values and provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods Description
ShellExecute method Attempts to run the file tcFileName in the directory, tcWorkDir.
Syntax: ShellExecute(tcFileName, tcWorkDir, tcOperation)
Return: nSuccess
Arguments:
tcFileName specifies the file to run.
tcWorkDir specifies the path to the file to run.
tcOperation
specifies the operation to perform.
nSuccess specifies the failure or the success of the run attempt using one of the following values.

2 = Bad Association (for example, invalid URL)
29 = Failure to load application
30 = Application is busy
31 = No application association

Values over 32 represent success, and return an instance handle for the running application.