| Modifier and Type | Class and Description |
|---|---|
| public static class | ShellAPI.APPBARDATA
Contains information about a system appbar message. |
| public static class | ShellAPI.SHELLEXECUTEINFO
Contains information used by ShellExecuteEx. |
| public static class | ShellAPI.SHFILEOPSTRUCT
Contains information that the SHFileOperation function uses to perform file operations. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ABE_BOTTOM
Bottom edge. |
| public static final int | ABE_LEFT
Left edge. |
| public static final int | ABE_RIGHT
Right edge. |
| public static final int | ABE_TOP
Top edge. |
| public static final int | ABM_ACTIVATE
Retrieves the bounding rectangle of the Windows taskbar. |
| public static final int | ABM_GETAUTOHIDEBAR
Notifies the system to activate or deactivate an appbar. |
| public static final int | ABM_GETSTATE
Sets the size and screen position of an appbar. |
| public static final int | ABM_GETTASKBARPOS
Retrieves the autohide and always-on-top states of the Windows taskbar. |
| public static final int | ABM_NEW
Appbar message value to send. |
| public static final int | ABM_QUERYPOS
Unregisters an appbar, removing the bar from the system's internal list. |
| public static final int | ABM_REMOVE
Registers a new appbar and specifies the message identifier that the system should use to send notification messages to the appbar. |
| public static final int | ABM_SETAUTOHIDEBAR
Retrieves the handle to the autohide appbar associated with a particular edge of the screen. |
| public static final int | ABM_SETPOS
Requests a size and screen position for an appbar. |
| public static final int | ABM_SETSTATE
Notifies the system when an appbar's position has changed. |
| public static final int | ABM_WINDOWPOSCHANGED
Registers or unregisters an autohide appbar for an edge of the screen. |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final TypeMapper |
| ABE_BOTTOM | back to summary |
|---|---|
| public static final int ABE_BOTTOM Bottom edge. | |
| ABE_LEFT | back to summary |
|---|---|
| public static final int ABE_LEFT Left edge. | |
| ABE_RIGHT | back to summary |
|---|---|
| public static final int ABE_RIGHT Right edge. | |
| ABE_TOP | back to summary |
|---|---|
| public static final int ABE_TOP Top edge. | |
| ABM_ACTIVATE | back to summary |
|---|---|
| public static final int ABM_ACTIVATE Retrieves the bounding rectangle of the Windows taskbar. Note that this applies only to the system taskbar. Other objects, particularly toolbars supplied with third-party software, also can be present. As a result, some of the screen area not covered by the Windows taskbar might not be visible to the user. To retrieve the area of the screen not covered by both the taskbar and other app bars -- the working area available to your application --, use the GetMonitorInfo function. | |
| ABM_GETAUTOHIDEBAR | back to summary |
|---|---|
| public static final int ABM_GETAUTOHIDEBAR Notifies the system to activate or deactivate an appbar. The lParam member of the APPBARDATA pointed to by pData is set to TRUE to activate or FALSE to deactivate. | |
| ABM_GETSTATE | back to summary |
|---|---|
| public static final int ABM_GETSTATE Sets the size and screen position of an appbar. | |
| ABM_GETTASKBARPOS | back to summary |
|---|---|
| public static final int ABM_GETTASKBARPOS Retrieves the autohide and always-on-top states of the Windows taskbar. | |
| ABM_NEW | back to summary |
|---|---|
| public static final int ABM_NEW Appbar message value to send. This parameter can be one of the following values. | |
| ABM_QUERYPOS | back to summary |
|---|---|
| public static final int ABM_QUERYPOS Unregisters an appbar, removing the bar from the system's internal list. | |
| ABM_REMOVE | back to summary |
|---|---|
| public static final int ABM_REMOVE Registers a new appbar and specifies the message identifier that the system should use to send notification messages to the appbar. | |
| ABM_SETAUTOHIDEBAR | back to summary |
|---|---|
| public static final int ABM_SETAUTOHIDEBAR Retrieves the handle to the autohide appbar associated with a particular edge of the screen. | |
| ABM_SETPOS | back to summary |
|---|---|
| public static final int ABM_SETPOS Requests a size and screen position for an appbar. | |
| ABM_SETSTATE | back to summary |
|---|---|
| public static final int ABM_SETSTATE Notifies the system when an appbar's position has changed. | |
| ABM_WINDOWPOSCHANGED | back to summary |
|---|---|
| public static final int ABM_WINDOWPOSCHANGED Registers or unregisters an autohide appbar for an edge of the screen. | |
| FO_COPY | back to summary |
|---|---|
| public static final int FO_COPY | |
| FO_DELETE | back to summary |
|---|---|
| public static final int FO_DELETE | |
| FO_MOVE | back to summary |
|---|---|
| public static final int FO_MOVE | |
| FO_RENAME | back to summary |
|---|---|
| public static final int FO_RENAME | |
| FOF_ALLOWUNDO | back to summary |
|---|---|
| public static final int FOF_ALLOWUNDO | |
| FOF_CONFIRMMOUSE | back to summary |
|---|---|
| public static final int FOF_CONFIRMMOUSE | |
| FOF_FILESONLY | back to summary |
|---|---|
| public static final int FOF_FILESONLY | |
| FOF_MULTIDESTFILES | back to summary |
|---|---|
| public static final int FOF_MULTIDESTFILES | |
| FOF_NO_CONNECTED_ELEMENTS | back to summary |
|---|---|
| public static final int FOF_NO_CONNECTED_ELEMENTS | |
| FOF_NO_UI | back to summary |
|---|---|
| public static final int FOF_NO_UI | |
| FOF_NOCONFIRMATION | back to summary |
|---|---|
| public static final int FOF_NOCONFIRMATION | |
| FOF_NOCONFIRMMKDIR | back to summary |
|---|---|
| public static final int FOF_NOCONFIRMMKDIR | |
| FOF_NOCOPYSECURITYATTRIBS | back to summary |
|---|---|
| public static final int FOF_NOCOPYSECURITYATTRIBS | |
| FOF_NOERRORUI | back to summary |
|---|---|
| public static final int FOF_NOERRORUI | |
| FOF_NORECURSEREPARSE | back to summary |
|---|---|
| public static final int FOF_NORECURSEREPARSE | |
| FOF_NORECURSION | back to summary |
|---|---|
| public static final int FOF_NORECURSION | |
| FOF_RENAMEONCOLLISION | back to summary |
|---|---|
| public static final int FOF_RENAMEONCOLLISION | |
| FOF_SILENT | back to summary |
|---|---|
| public static final int FOF_SILENT | |
| FOF_SIMPLEPROGRESS | back to summary |
|---|---|
| public static final int FOF_SIMPLEPROGRESS | |
| FOF_WANTMAPPINGHANDLE | back to summary |
|---|---|
| public static final int FOF_WANTMAPPINGHANDLE | |
| FOF_WANTNUKEWARNING | back to summary |
|---|---|
| public static final int FOF_WANTNUKEWARNING | |
| PO_DELETE | back to summary |
|---|---|
| public static final int PO_DELETE | |
| PO_PORTCHANGE | back to summary |
|---|---|
| public static final int PO_PORTCHANGE | |
| PO_REN_PORT | back to summary |
|---|---|
| public static final int PO_REN_PORT | |
| PO_RENAME | back to summary |
|---|---|
| public static final int PO_RENAME | |
| STRUCTURE_ALIGNMENT | back to summary |
|---|---|
| public static final int STRUCTURE_ALIGNMENT | |
| TYPE_MAPPER | back to summary |
|---|---|
| public static final TypeMapper TYPE_MAPPER | |
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public WinDef. | |
| public WinDef. | |
| public WinDef. | |
| public WinDef. | |
| public WinDef. | |
| public WinDef. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| cbSize | back to summary |
|---|---|
| public WinDef. | |
| hWnd | back to summary |
|---|---|
| public WinDef. | |
| lParam | back to summary |
|---|---|
| public WinDef. | |
| rc | back to summary |
|---|---|
| public WinDef. | |
| uCallbackMessage | back to summary |
|---|---|
| public WinDef. | |
| uEdge | back to summary |
|---|---|
| public WinDef. | |
| APPBARDATA | back to summary |
|---|---|
| public APPBARDATA() | |
| APPBARDATA | back to summary |
|---|---|
| public APPBARDATA(Pointer p) | |
| Access | Constructor and Description |
|---|---|
| public |
| ByReference | back to summary |
|---|---|
| public ByReference() | |
Contains information used by ShellExecuteEx.
typedef struct _SHELLEXECUTEINFO { DWORD cbSize; ULONG fMask; HWND hwnd; LPCTSTR lpVerb; LPCTSTR lpFile; LPCTSTR lpParameters; LPCTSTR lpDirectory; int nShow; HINSTANCE hInstApp; LPVOID lpIDList; LPCTSTR lpClass; HKEY hkeyClass; DWORD dwHotKey; union { HANDLE hIcon; HANDLE hMonitor; } DUMMYUNIONNAME; HANDLE hProcess; } SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
The SEE_MASK_NOASYNC flag must be specified if the thread calling ShellExecuteEx does not have a message loop or if the thread or process will terminate soon after ShellExecuteEx returns. Under such conditions, the calling thread will not be available to complete the DDE conversation, so it is important that ShellExecuteEx complete the conversation before returning control to the calling application. Failure to complete the conversation can result in an unsuccessful launch of the document.
If the calling thread has a message loop and will exist for some time after the call to ShellExecuteEx returns, the SEE_MASK_NOASYNC flag is optional. If the flag is omitted, the calling thread's message pump will be used to complete the DDE conversation. The calling application regains control sooner, since the DDE conversation can be completed in the background.
When populating the most frequently used program list using the SEE_MASK_FLAG_LOG_USAGE flag in fMask, counts are made differently for the classic and Windows XP-style Start menus. The classic style menu only counts hits to the shortcuts in the Program menu. The Windows XP-style menu counts both hits to the shortcuts in the Program menu and hits to those shortcuts' targets outside of the Program menu. Therefore, setting lpFile to myfile.exe would affect the count for the Windows XP-style menu regardless of whether that file was launched directly or through a shortcut. The classic style-which would require lpFile to contain a .lnk file name-would not be affected.
To include double quotation marks in lpParameters, enclose each mark in a pair of quotation marks, as in the following example.
sei.lpParameters = "An example: \"\"\"quoted text\"\"\"";
In this case, the application receives three parameters: An, example:, and "quoted text".
| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public int | |
| public int | fMask
Type: ULONG Flags that indicate the content and validity of the other structure members; a combination of the following values:
|
| public WinDef. | hInstApp
Type: HINSTANCE [out] If SEE_MASK_NOCLOSEPROCESS is set and the call succeeds, it sets this member to a value greater than 32. |
| public WinReg. | |
| public WinNT. | |
| public WinNT. | |
| public WinDef. | |
| public String | lpClass
Type: LPCTSTR The address of a null-terminated string that specifies one of the following:
|
| public String | |
| public String | lpFile
Type: LPCTSTR The address of a null-terminated string that specifies the name of the file or object on which will perform the action specified by the lpVerb parameter. |
| public Pointer | lpIDList
Type: LPVOID The address of an absolute ITEMIDLIST structure (PCIDLIST_ABSOLUTE) to contain an item identifier list that uniquely identifies the file to execute. |
| public String | |
| public String | |
| public int |
| Access | Constructor and Description |
|---|---|
| public |
| cbSize | back to summary |
|---|---|
| public int cbSize Type: DWORD Required. The size of this structure, in bytes. | |
| dwHotKey | back to summary |
|---|---|
| public int dwHotKey Type: DWORD A keyboard shortcut to associate with the application. The low-order word is the virtual key code, and the high-order word is a modifier flag (HOTKEYF_). For a list of modifier flags, see the description of the WM_SETHOTKEY message. This member is ignored if fMask does not include SEE_MASK_HOTKEY. | |
| fMask | back to summary |
|---|---|
| public int fMask Type: ULONG Flags that indicate the content and validity of the other structure members; a combination of the following values:
| |
| hInstApp | back to summary |
|---|---|
| public WinDef. Type: HINSTANCE [out] If SEE_MASK_NOCLOSEPROCESS is set and the call succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an int and compared to either 32 or the following SE_ERR_XXX error codes.
| |
| hKeyClass | back to summary |
|---|---|
| public WinReg. Type: HKEY A handle to the registry key for the file type. The access rights for this registry key should be set to KEY_READ. This member is ignored if fMask does not include SEE_MASK_CLASSKEY. | |
| hMonitor | back to summary |
|---|---|
| public WinNT. This is actually a union:
DUMMYUNIONNAME
| |
| hProcess | back to summary |
|---|---|
| public WinNT. Type: HANDLE A handle to the newly started application. This member is set on return and is always NULL unless fMask is set to SEE_MASK_NOCLOSEPROCESS. Even if fMask is set to SEE_MASK_NOCLOSEPROCESS, hProcess will be NULL if no process was launched. For example, if a document to be launched is a URL and an instance of Internet Explorer is already running, it will display the document. No new process is launched, and hProcess will be NULL. Note
ShellExecuteEx
does not always return an hProcess, even if a
process is launched as the result of the call. For example, an
hProcess does not return when you use
SEE_MASK_INVOKEIDLIST to invoke
IContextMenu
.
| |
| hwnd | back to summary |
|---|---|
| public WinDef. Type: HWND Optional. A handle to the parent window, used to display any message boxes that the system might produce while executing this function. This value can be NULL. | |
| lpClass | back to summary |
|---|---|
| public String lpClass Type: LPCTSTR The address of a null-terminated string that specifies one of the following:
This member is ignored if fMask does not include SEE_MASK_CLASSNAME. | |
| lpDirectory | back to summary |
|---|---|
| public String lpDirectory Type: LPCTSTR Optional. The address of a null-terminated string that specifies the name of the working directory. If this member is NULL, the current directory is used as the working directory. | |
| lpFile | back to summary |
|---|---|
| public String lpFile Type: LPCTSTR The address of a null-terminated string that specifies the name of the file or object on which will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include "open" for executable files and document files and "print" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as "play" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter. Note If the
SEE_MASK_INVOKEIDLIST flag is set, you can use
either lpFile or lpIDList to
identify the item by its file system path or its PIDL respectively.
One of the two values-lpFile or
lpIDList-must be set.
Note If the path is not
included with the name, the current directory is assumed.
| |
| lpIDList | back to summary |
|---|---|
| public Pointer lpIDList Type: LPVOID The address of an absolute ITEMIDLIST structure (PCIDLIST_ABSOLUTE) to contain an item identifier list that uniquely identifies the file to execute. This member is ignored if the fMask member does not include SEE_MASK_IDLIST or SEE_MASK_INVOKEIDLIST. | |
| lpParameters | back to summary |
|---|---|
| public String lpParameters Type: LPCTSTR Optional. The address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. If the lpFile member specifies a document file, lpParameters should be NULL. | |
| lpVerb | back to summary |
|---|---|
| public String lpVerb Type: LPCTSTR A 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. This parameter can be NULL, in which case the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry. The following verbs are commonly used:
| |
| nShow | back to summary |
|---|---|
| public int nShow Type: int Required. Flags that specify how an application is to be shown when it is opened; one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. | |
| SHELLEXECUTEINFO | back to summary |
|---|---|
| public SHELLEXECUTEINFO() | |
| Modifier and Type | Field and Description |
|---|---|
| public boolean | fAnyOperationsAborted
When the function returns, this member contains TRUE if any file operations were aborted before they were completed; otherwise, FALSE. |
| public short | fFlags
Flags that control the file operation. |
| public WinNT. | hwnd
A window handle to the dialog box to display information about the status of the file operation. |
| public String | lpszProgressTitle
A pointer to the title of a progress dialog box. |
| public String | pFrom
A pointer to one or more source file names, double null-terminated. |
| public Pointer | pNameMappings
When the function returns, this member contains a handle to a name mapping object that contains the old and new names of the renamed files. |
| public String | pTo
A pointer to the destination file or directory name. |
| public int | wFunc
An FO_* value that indicates which operation to perform. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| fAnyOperationsAborted | back to summary |
|---|---|
| public boolean fAnyOperationsAborted When the function returns, this member contains TRUE if any file operations were aborted before they were completed; otherwise, FALSE. An operation can be manually aborted by the user through UI or it can be silently aborted by the system if the FOF_NOERRORUI or FOF_NOCONFIRMATION flags were set. | |
| fFlags | back to summary |
|---|---|
| public short fFlags Flags that control the file operation. | |
| hwnd | back to summary |
|---|---|
| public WinNT. A window handle to the dialog box to display information about the status of the file operation. | |
| lpszProgressTitle | back to summary |
|---|---|
| public String lpszProgressTitle A pointer to the title of a progress dialog box. This is a null-terminated string. | |
| pFrom | back to summary |
|---|---|
| public String pFrom A pointer to one or more source file names, double null-terminated. | |
| pNameMappings | back to summary |
|---|---|
| public Pointer pNameMappings When the function returns, this member contains a handle to a name mapping object that contains the old and new names of the renamed files. This member is used only if the fFlags member includes the FOF_WANTMAPPINGHANDLE flag. | |
| pTo | back to summary |
|---|---|
| public String pTo A pointer to the destination file or directory name. | |
| wFunc | back to summary |
|---|---|
| public int wFunc An FO_* value that indicates which operation to perform. | |
| SHFILEOPSTRUCT | back to summary |
|---|---|
| public SHFILEOPSTRUCT() | |
| encodePaths | back to summary |
|---|---|
| public String encodePaths(String[] paths) Use this to encode | |