Skip to content

Latest commit

 

History

History
91 lines (68 loc) · 3.39 KB

ShellExecute.md

File metadata and controls

91 lines (68 loc) · 3.39 KB

Home

Function name : ShellExecute

Group: Shell Functions - Library: shell32


Performs an operation on a specified file.


Code examples:

How to access a file using not its name but an alias (hard link)
Using Shell for performing operations on files
Storing content of the Clipboard to a bitmap file
Accessing examples contained in this reference from a VFP application
Reading the structure of VFP main menu
Saving local machine ODBC Registry Entries to XML file
Mapping and disconnecting network drives
Accessing Windows Control Panel from VFP Application
GDI+: creating scaled copy of image file
Accessing examples contained in this reference through Web Services
Accessing Adobe Reader 7.0 main menu from VFP application
GDI+: converting text strings to images and saving in a graphics file
GDI+: Drawing a Pie Chart
GDI+: cropping images
How to control Adobe Reader 9.0 (SDI mode) from VFP application
How to display Windows On-Screen Keyboard
GDI+: creating a gradient

Declaration:

HINSTANCE ShellExecute(
    HWND hwnd,
    LPCTSTR lpOperation,
    LPCTSTR lpFile,
    LPCTSTR lpParameters,
    LPCTSTR lpDirectory,
    INT nShowCmd
);
  

FoxPro declaration:

DECLARE INTEGER ShellExecute IN shell32;
	INTEGER hwnd,;
	STRING  lpOperation,;
	STRING  lpFile,;
	STRING  lpParameters,;
	STRING  lpDirectory,;
	INTEGER nShowCmd  

Parameters:

hwnd Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting.

lpVerb A string, referred to as a verb, that specifies the action to be performed: edit, explore, find, open, print

lpFile Address of a null-terminated string that specifies the file or object on which to execute the specified verb.

lpParameters If the lpFile parameter specifies an executable file, lpParameters is an address to a null-terminated string that specifies the parameters to be passed to the application.

lpDirectory Address of a null-terminated string that specifies the default directory.

nShowCmd Flags that specify how an application is to be displayed when it is opened.


Return value:

Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. . The return value is cast as an HINSTANCE for backward compatibility with 16-bit Microsoft® Windows® applications. It is not a true HINSTANCE, however.


Comments:

The following verbs are commonly used: edit, explore, find, open, print and properties.

See also: ShellExecuteEx, CreateProcess, AssocQueryString.