SHELLEXECUTEINFO

This structure specifies an enumerated type that defines flags used with the IShellFolder::EnumObjects method.

The SHELLEXECUTEINFO structure contains information used by the ShellExecuteEx function.

At a Glance

Header file: Shellapi.h
Windows CE versions: 1.0 and later

Syntax

typedef struct _SHELLEXECUTEINFO {
DWORD
cbSize;
ULONG
fMask;
HWND
hwnd;
LPCSTR
lpVerb;
LPCSTR
lpFile;
LPCSTR
lpParameters;
LPCSTR
lpDirectory;
int
nShow;
HINSTANCE
hInstApp;

// Optional members
LPVOID
lpIDList;
LPCSTR
lpClass;
HKEY
hkeyClass;
DWORD
dwHotKey;
HANDLE
hIcon;
HANDLE
hProcess;
} SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;

Members

cbSize

Size of the structure, in bytes.

fMask

Array of flags that indicate the content and validity of the other structure members. For Windows CE versions 1.0 and 1.01, fMask flags are unsupported. For Windows CE versions 2.0 and later, fMask can be a combination of the following values:

Value Description
SEE_MASK_FLAG_NO_UI Does not display an error message box if an error occurs.
SEE_MASK_NOCLOSEPROCESS Leaves the process running after the ShellExecuteEx function exits. The hProcess member receives the handle to the process.

hwnd

Window handle to any message boxes that the system may produce while executing this function.

lpVerb

Long pointer to a string specifying the name of a verb. The verb specifies an action for the application to perform. The set of available verbs depends on the particular file or folder. It includes the commands listed in the context menu and the registry. This member defaults to Open if no verb is specified. The following verbs are usually valid:

Value Description
edit Opens an editor. If lpFile is not a document file, the function will fail.
explore The function explores the folder specified by lpFile.
open The function opens the file specified by the lpFile parameter. The file can be an executable file or a document file. It can also be a folder.
print The function prints the document file specified by lpFile. If lpFile is not a document file, the function will fail.
properties Displays the file or folder's properties.

lpFile

Long pointer to a null-terminated string that specifies the name of the file to open or print. The function can open an executable file or a document file, but it can only print a document file. If the path is not included with the name, the current directory is assumed.

lpParameters

Long pointer to a null-terminated string that contains the application parameters. The parameters must be separated by spaces. To include double quotation marks, you must enclose the marks in double quotation marks, as in the following code example:

sei.lpParameters = "An example: \"\"\"quoted text\"\"\"";

In this case, the application receives three parameters: An, example:, and “quoted text”.

If the lpFile member specifies a document file, this member should be NULL.

lpDirectory

Pointer to a null-terminated string that specifies the name of the working directory. If this member is not specified, the current directory is used as the working directory.

nShow

Show flags. Can be one of the SW_* values described for the ShowWindow function. If the lpFile specifies an executable file, this member specifies how the application is to be shown when it is opened.

hInstApp

Instance handle to the application that the ShellExecuteEx function started. If the function fails, this member receives one of the following error values, which are less than or equal to 32:

Value Description
SE_ERR_FNF File not found.
SE_ERR_PNF Path not found.
SE_ERR_ACCESSDENIED Access denied.
SE_ERR_OOM Out of memory.
SE_ERR_DLLNOTFOUND Dynamic-link library not found.
SE_ERR_SHARE Cannot share an open file.
SE_ERR_ASSOCINCOMPLETE File association information not complete.
SE_ERR_DDETIMEOUT DDE operation timed out.
SE_ERR_DDEFAIL DDE operation failed.
SE_ERR_DDEBUSY DDE operation is busy.
SE_ERR_NOASSOC File association not available.

lpIDList

Ignored.

lpClass

Ignored.

hkeyClass

Ignored.

dwHotKey

Ignored.

hIcon

Ignored.

hProcess

Handle to the newly started application. This member is set on return and is always NULL if fMask is not set to SEE_MASK_NOCLOSEPROCESS.

See Also

ITEMIDLIST, ShellExecuteEx, ShowWindow