Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 2.19 KB

ShellExecuteEx.md

File metadata and controls

78 lines (54 loc) · 2.19 KB

Home

Function name : ShellExecuteEx

Group: Shell Functions - Library: shell32


Performs an action on a file.


Code examples:

How to display the Properties dialog box for a file (ShellExecuteEx)

Declaration:

BOOL ShellExecuteEx(
	LPSHELLEXECUTEINFO lpExecInfo
);  

FoxPro declaration:

DECLARE INTEGER ShellExecuteEx IN Shell32;
	STRING @lpExecInfo  

Parameters:

lpExecInfo Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed.


Return value:

Returns TRUE if successful, or FALSE otherwise.


Comments:

lpVerb in SHELLEXECUTEINFO Structure:
String, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs.

cBuffer = num2dword(INFO_SIZE) +;  
	num2dword(nFlag) +;  
	num2dword(hWindow) +;  
	num2dword(oVerb.GetAddr()) +;  
	num2dword(oFile.GetAddr()) +;  
	Repli(Chr(0), 40)  
  
= ShellExecuteEx(@cBuffer)

The following verbs are commonly used:

edit
Launches an editor and opens the document for editing.

explore
Explores the folder specified by lpFile.

find
Initiates a search starting from the specified directory.

open
Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder.

print
Prints the document file specified by lpFile.

properties
Displays the file or folder's properties.