Top Description Inners Fields
com.sun.jna.platform.win32

public Interface ShellAPI

extends StdCallLibrary
Known Direct Subinterfaces
com.sun.jna.platform.win32.Shell32
Imports
com.sun.jna.Platform, .Pointer, .Structure, .Structure.FieldOrder, .TypeMapper, com.sun.jna.platform.win32.WinDef.DWORD, .WinDef.HINSTANCE, .WinDef.HWND, .WinDef.LPARAM, .WinDef.RECT, .WinDef.UINT, .WinNT.HANDLE, .WinReg.HKEY, com.sun.jna.win32.StdCallLibrary, .W32APITypeMapper

Ported from ShellAPI.h. Microsoft Windows SDK 6.0A.
Author
dblock[at]dblock.org

Nested and Inner Type Summary

Modifier and TypeClass 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.

Field Summary

Modifier and TypeField 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
Inherited from com.sun.jna.win32.StdCallLibrary:
FUNCTION_MAPPERSTDCALL_CONVENTION

Field Detail

ABE_BOTTOMback to summary
public static final int ABE_BOTTOM

Bottom edge.

ABE_LEFTback to summary
public static final int ABE_LEFT

Left edge.

ABE_RIGHTback to summary
public static final int ABE_RIGHT

Right edge.

ABE_TOPback to summary
public static final int ABE_TOP

Top edge.

ABM_ACTIVATEback 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_GETAUTOHIDEBARback 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_GETSTATEback to summary
public static final int ABM_GETSTATE

Sets the size and screen position of an appbar.

ABM_GETTASKBARPOSback to summary
public static final int ABM_GETTASKBARPOS

Retrieves the autohide and always-on-top states of the Windows taskbar.

ABM_NEWback to summary
public static final int ABM_NEW

Appbar message value to send. This parameter can be one of the following values.

ABM_QUERYPOSback to summary
public static final int ABM_QUERYPOS

Unregisters an appbar, removing the bar from the system's internal list.

ABM_REMOVEback 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_SETAUTOHIDEBARback to summary
public static final int ABM_SETAUTOHIDEBAR

Retrieves the handle to the autohide appbar associated with a particular edge of the screen.

ABM_SETPOSback to summary
public static final int ABM_SETPOS

Requests a size and screen position for an appbar.

ABM_SETSTATEback to summary
public static final int ABM_SETSTATE

Notifies the system when an appbar's position has changed.

ABM_WINDOWPOSCHANGEDback to summary
public static final int ABM_WINDOWPOSCHANGED

Registers or unregisters an autohide appbar for an edge of the screen.

FO_COPYback to summary
public static final int FO_COPY
FO_DELETEback to summary
public static final int FO_DELETE
FO_MOVEback to summary
public static final int FO_MOVE
FO_RENAMEback to summary
public static final int FO_RENAME
FOF_ALLOWUNDOback to summary
public static final int FOF_ALLOWUNDO
FOF_CONFIRMMOUSEback to summary
public static final int FOF_CONFIRMMOUSE
FOF_FILESONLYback to summary
public static final int FOF_FILESONLY
FOF_MULTIDESTFILESback to summary
public static final int FOF_MULTIDESTFILES
FOF_NO_CONNECTED_ELEMENTSback to summary
public static final int FOF_NO_CONNECTED_ELEMENTS
FOF_NO_UIback to summary
public static final int FOF_NO_UI
FOF_NOCONFIRMATIONback to summary
public static final int FOF_NOCONFIRMATION
FOF_NOCONFIRMMKDIRback to summary
public static final int FOF_NOCONFIRMMKDIR
FOF_NOCOPYSECURITYATTRIBSback to summary
public static final int FOF_NOCOPYSECURITYATTRIBS
FOF_NOERRORUIback to summary
public static final int FOF_NOERRORUI
FOF_NORECURSEREPARSEback to summary
public static final int FOF_NORECURSEREPARSE
FOF_NORECURSIONback to summary
public static final int FOF_NORECURSION
FOF_RENAMEONCOLLISIONback to summary
public static final int FOF_RENAMEONCOLLISION
FOF_SILENTback to summary
public static final int FOF_SILENT
FOF_SIMPLEPROGRESSback to summary
public static final int FOF_SIMPLEPROGRESS
FOF_WANTMAPPINGHANDLEback to summary
public static final int FOF_WANTMAPPINGHANDLE
FOF_WANTNUKEWARNINGback to summary
public static final int FOF_WANTNUKEWARNING
PO_DELETEback to summary
public static final int PO_DELETE
PO_PORTCHANGEback to summary
public static final int PO_PORTCHANGE
PO_REN_PORTback to summary
public static final int PO_REN_PORT
PO_RENAMEback to summary
public static final int PO_RENAME
STRUCTURE_ALIGNMENTback to summary
public static final int STRUCTURE_ALIGNMENT
TYPE_MAPPERback to summary
public static final TypeMapper TYPE_MAPPER
com.sun.jna.platform.win32 back to summary

public Class ShellAPI.APPBARDATA

extends Structure
Class Inheritance
Known Direct Subclasses
com.sun.jna.platform.win32.ShellAPI.APPBARDATA.ByReference
Annotations
@FieldOrder:cbSize, hWnd, uCallbackMessage, uEdge, rc, lParam

Contains information about a system appbar message.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public WinDef.DWORD
public WinDef.HWND
public WinDef.LPARAM
public WinDef.RECT
public WinDef.UINT
public WinDef.UINT
Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

cbSizeback to summary
public WinDef.DWORD cbSize
hWndback to summary
public WinDef.HWND hWnd
lParamback to summary
public WinDef.LPARAM lParam
rcback to summary
public WinDef.RECT rc
uCallbackMessageback to summary
public WinDef.UINT uCallbackMessage
uEdgeback to summary
public WinDef.UINT uEdge

Constructor Detail

APPBARDATAback to summary
public APPBARDATA()
APPBARDATAback to summary
public APPBARDATA(Pointer p)
com.sun.jna.platform.win32 back to summary

public Class ShellAPI.APPBARDATA.ByReference

extends APPBARDATA
implements ByReference
Class Inheritance
All Implemented Interfaces
com.sun.jna.Structure.ByReference

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

ByReferenceback to summary
public ByReference()
com.sun.jna.platform.win32 back to summary

public Class ShellAPI.SHELLEXECUTEINFO

extends Structure
Class Inheritance
Annotations
@FieldOrder:cbSize, fMask, hwnd, lpVerb, lpFile, lpParameters, lpDirectory, nShow, hInstApp, lpIDList, lpClass, hKeyClass, dwHotKey, hMonitor, hProcess

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;

Remarks

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".

Field Summary

Modifier and TypeField and Description
public int
cbSize

Type: DWORD

Required.

public int
dwHotKey

Type: DWORD

A keyboard shortcut to associate with the application.

public int
fMask

Type: ULONG

Flags that indicate the content and validity of the other structure members; a combination of the following values:

SEE_MASK_DEFAULT (0x00000000)

Use default values.

SEE_MASK_CLASSNAME (0x00000001)

Use the class name given by the lpClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used.

SEE_MASK_CLASSKEY (0x00000003)

Use the class key given by the hkeyClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used.

SEE_MASK_IDLIST (0x00000004)

Use the item identifier list given by the lpIDList member. The lpIDList member must point to an structure.

SEE_MASK_INVOKEIDLIST (0x0000000C)

Use the interface of the selected item's . Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use to invoke verbs from shortcut menu extensions instead of the static verbs listed in the registry.

Note   SEE_MASK_INVOKEIDLIST overrides and implies SEE_MASK_IDLIST.
public WinDef.HINSTANCE
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.HKEY
hKeyClass

Type: HKEY

A handle to the registry key for the file type.

public WinNT.HANDLE
hMonitor

This is actually a union:

union { HANDLE hIcon; HANDLE hMonitor; } DUMMYUNIONNAME;
public WinNT.HANDLE
hProcess

Type: HANDLE

A handle to the newly started application.

public WinDef.HWND
hwnd

Type: HWND

Optional.

public String
lpClass

Type: LPCTSTR

The address of a null-terminated string that specifies one of the following:

  • A ProgId. For example, "Paint.Picture".
  • A URI protocol scheme. For example, "http".
  • A file extension. For example, ".txt".
  • A registry path under HKEY_CLASSES_ROOT that names a subkey that contains one or more Shell verbs. This key will have a subkey that conforms to the Shell verb registry schema, such as

    shell\verb name .

public String
lpDirectory

Type: LPCTSTR

Optional.

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
lpParameters

Type: LPCTSTR

Optional.

public String
lpVerb

Type: LPCTSTR

A string, referred to as a verb, that specifies the action to be performed.

public int
nShow

Type: int

Required.

Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

cbSizeback to summary
public int cbSize

Type: DWORD

Required. The size of this structure, in bytes.

dwHotKeyback 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.

fMaskback 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:

SEE_MASK_DEFAULT (0x00000000)

Use default values.

SEE_MASK_CLASSNAME (0x00000001)

Use the class name given by the lpClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used.

SEE_MASK_CLASSKEY (0x00000003)

Use the class key given by the hkeyClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used.

SEE_MASK_IDLIST (0x00000004)

Use the item identifier list given by the lpIDList member. The lpIDList member must point to an structure.

SEE_MASK_INVOKEIDLIST (0x0000000C)

Use the interface of the selected item's . Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use to invoke verbs from shortcut menu extensions instead of the static verbs listed in the registry.

Note   SEE_MASK_INVOKEIDLIST overrides and implies SEE_MASK_IDLIST.

SEE_MASK_ICON (0x00000010)

Use the icon given by the hIcon member. This flag cannot be combined with SEE_MASK_HMONITOR.

Note  This flag is used only in Windows XP and earlier. It is ignored as of Windows Vista.

SEE_MASK_HOTKEY (0x00000020)

Use the keyboard shortcut given by the dwHotKey member.

SEE_MASK_NOCLOSEPROCESS (0x00000040)

Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed.

SEE_MASK_CONNECTNETDRV (0x00000080)

Validate the share and connect to a drive letter. This enables reconnection of disconnected network drives. The lpFile member is a UNC path of a file on a network.

SEE_MASK_NOASYNC (0x00000100)

Wait for the execute operation to complete before returning. This flag should be used by callers that are using ShellExecute forms that might result in an async activation, for example DDE, and create a process that might be run on a background thread. (Note: runs on a background thread by default if the caller's threading model is not Apartment.) Calls to ShellExecuteEx from processes already running on background threads should always pass this flag. Also, applications that exit immediately after calling ShellExecuteEx should specify this flag.

If the execute operation is performed on a background thread and the caller did not specify the SEE_MASK_ASYNCOK flag, then the calling thread waits until the new process has started before returning. This typically means that either has been called, the DDE communication has completed, or that the custom execution delegate has notified that it is done. If the SEE_MASK_WAITFORINPUTIDLE flag is specified, then ShellExecuteEx calls and waits for the new process to idle before returning, with a maximum timeout of 1 minute.

For further discussion on when this flag is necessary, see the Remarks section.

SEE_MASK_FLAG_DDEWAIT (0x00000100)

Do not use; use SEE_MASK_NOASYNC instead.

SEE_MASK_DOENVSUBST (0x00000200)

Expand any environment variables specified in the string given by the lpDirectory or lpFile member.

SEE_MASK_FLAG_NO_UI (0x00000400)

Do not display an error message box if an error occurs.

SEE_MASK_UNICODE (0x00004000)

Use this flag to indicate a Unicode application.

SEE_MASK_NO_CONSOLE (0x00008000)

Use to inherit the parent's console for the new process instead of having it create a new console. It is the opposite of using a CREATE_NEW_CONSOLE flag with .

SEE_MASK_ASYNCOK (0x00100000)

The execution can be performed on a background thread and the call should return immediately without waiting for the background thread to finish. Note that in certain cases ignores this flag and waits for the process to finish before returning.

SEE_MASK_NOQUERYCLASSSTORE (0x01000000)

Not used.

SEE_MASK_HMONITOR (0x00200000)

Use this flag when specifying a monitor on multi-monitor systems. The monitor is specified in the hMonitor member. This flag cannot be combined with SEE_MASK_ICON.

SEE_MASK_NOZONECHECKS (0x00800000)

Introduced in Windows XP. Do not perform a zone check. This flag allows to bypass zone checking put into place by .

SEE_MASK_WAITFORINPUTIDLE (0x02000000)

After the new process is created, wait for the process to become idle before returning, with a one minute timeout. See for more details.

SEE_MASK_FLAG_LOG_USAGE (0x04000000)

Introduced in Windows XP. Keep track of the number of times this application has been launched. Applications with sufficiently high counts appear in the Start Menu's list of most frequently used programs.

SEE_MASK_FLAG_HINST_IS_SITE (0x08000000)

Introduced in Windows 8. The hInstApp member is used to specify the of an object that implements . This object will be used as a site pointer. The site pointer is used to provide services to the function, the handler binding process, and invoked verb handlers.

hInstAppback to summary
public WinDef.HINSTANCE hInstApp

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.

SE_ERR_FNF (2)

File not found.

SE_ERR_PNF (3)

Path not found.

SE_ERR_ACCESSDENIED (5)

Access denied.

SE_ERR_OOM (8)

Out of memory.

SE_ERR_DLLNOTFOUND (32)

Dynamic-link library not found.

SE_ERR_SHARE (26)

Cannot share an open file.

SE_ERR_ASSOCINCOMPLETE (27)

File association information not complete.

SE_ERR_DDETIMEOUT (28)

DDE operation timed out.

SE_ERR_DDEFAIL (29)

DDE operation failed.

SE_ERR_DDEBUSY (30)

DDE operation is busy.

SE_ERR_NOASSOC (31)

File association not available.

hKeyClassback to summary
public WinReg.HKEY hKeyClass

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.

hMonitorback to summary
public WinNT.HANDLE hMonitor

This is actually a union:

union { HANDLE hIcon; HANDLE hMonitor; } DUMMYUNIONNAME;
DUMMYUNIONNAME
hIcon

Type: HANDLE

A handle to the icon for the file type. This member is ignored if fMask does not include SEE_MASK_ICON. This value is used only in Windows XP and earlier. It is ignored as of Windows Vista.

hMonitor

Type: HANDLE

A handle to the monitor upon which the document is to be displayed. This member is ignored if fMask does not include SEE_MASK_HMONITOR.

hProcessback to summary
public WinNT.HANDLE hProcess

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 .
hwndback to summary
public WinDef.HWND hwnd

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.

lpClassback to summary
public String lpClass

Type: LPCTSTR

The address of a null-terminated string that specifies one of the following:

  • A ProgId. For example, "Paint.Picture".
  • A URI protocol scheme. For example, "http".
  • A file extension. For example, ".txt".
  • A registry path under HKEY_CLASSES_ROOT that names a subkey that contains one or more Shell verbs. This key will have a subkey that conforms to the Shell verb registry schema, such as

    shell\verb name

    .

This member is ignored if fMask does not include SEE_MASK_CLASSNAME.

lpDirectoryback 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.

lpFileback 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.
lpIDListback 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.

lpParametersback 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.

lpVerbback 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:

edit

Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail.

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. If lpFile is not a document file, the function will fail.

properties

Displays the file or folder's properties.

nShowback 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.

Constructor Detail

SHELLEXECUTEINFOback to summary
public SHELLEXECUTEINFO()
com.sun.jna.platform.win32 back to summary

public Class ShellAPI.SHFILEOPSTRUCT

extends Structure
Class Inheritance
Annotations
@FieldOrder:hwnd, wFunc, pFrom, pTo, fFlags, fAnyOperationsAborted, pNameMappings, lpszProgressTitle

Contains information that the SHFileOperation function uses to perform file operations.

Field Summary

Modifier and TypeField 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.HANDLE
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.

Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Encoded paths
encodePaths
(String[]
Paths to encode
paths
)

Use this to encode pFrom/pTo paths.

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

fAnyOperationsAbortedback 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.

fFlagsback to summary
public short fFlags

Flags that control the file operation.

hwndback to summary
public WinNT.HANDLE hwnd

A window handle to the dialog box to display information about the status of the file operation.

lpszProgressTitleback to summary
public String lpszProgressTitle

A pointer to the title of a progress dialog box. This is a null-terminated string.

pFromback to summary
public String pFrom

A pointer to one or more source file names, double null-terminated.

pNameMappingsback 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.

pToback to summary
public String pTo

A pointer to the destination file or directory name.

wFuncback to summary
public int wFunc

An FO_* value that indicates which operation to perform.

Constructor Detail

SHFILEOPSTRUCTback to summary
public SHFILEOPSTRUCT()

Method Detail

encodePathsback to summary
public String encodePaths(String[] paths)

Use this to encode pFrom/pTo paths.

Parameters
paths:String[]

Paths to encode

Returns:String

Encoded paths