com.mucommander.file.util
Interface Shell32API

All Superinterfaces:
com.sun.jna.AltCallingConvention, com.sun.jna.Library, com.sun.jna.win32.StdCall, com.sun.jna.win32.StdCallLibrary, com.sun.jna.examples.win32.W32API, com.sun.jna.examples.win32.W32Errors

public interface Shell32API
extends com.sun.jna.examples.win32.W32API

Exposes parts of the Windows Shell32 API using the JNA (Java Native Access) library. The Shell32 class should be used to retrieve an instance of this interface.

Author:
Maxence Bernard
See Also:
Shell32

Nested Class Summary
static class Shell32API.SHFILEOPSTRUCT
          This structure contains information that the SHFileOperation function uses to perform file operations.
static class Shell32API.SHQUERYRBINFO
          Contains the size and item count information retrieved by the SHQueryRecycleBin function.
 
Nested classes/interfaces inherited from interface com.sun.jna.examples.win32.W32API
com.sun.jna.examples.win32.W32API.DWORD, com.sun.jna.examples.win32.W32API.HANDLE, com.sun.jna.examples.win32.W32API.HANDLEByReference, com.sun.jna.examples.win32.W32API.HBITMAP, com.sun.jna.examples.win32.W32API.HDC, com.sun.jna.examples.win32.W32API.HICON, com.sun.jna.examples.win32.W32API.HINSTANCE, com.sun.jna.examples.win32.W32API.HMODULE, com.sun.jna.examples.win32.W32API.HRGN, com.sun.jna.examples.win32.W32API.HWND, com.sun.jna.examples.win32.W32API.LONG_PTR, com.sun.jna.examples.win32.W32API.LPARAM, com.sun.jna.examples.win32.W32API.LRESULT, com.sun.jna.examples.win32.W32API.SIZE_T, com.sun.jna.examples.win32.W32API.SSIZE_T, com.sun.jna.examples.win32.W32API.UINT_PTR, com.sun.jna.examples.win32.W32API.ULONG_PTR, com.sun.jna.examples.win32.W32API.WORD, com.sun.jna.examples.win32.W32API.WPARAM
 
Nested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibrary
com.sun.jna.win32.StdCallLibrary.StdCallCallback
 
Nested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler
 
Field Summary
static int FO_COPY
          Copies the files specified in the pFrom member to the location specified in the pTo member.
static int FO_DELETE
          Deletes the files specified in pFrom.
static int FO_MOVE
          Copies the files specified in the pFrom member to the location specified in the pTo member.
static int FO_RENAME
          Renames the file specified in pFrom.
static int FOF_ALLOWUNDO
          Preserve Undo information, if possible.
static int FOF_CONFIRMMOUSE
          Not supported.
static int FOF_FILESONLY
          Not supported.
static int FOF_MULTIDESTFILES
          Not supported.
static int FOF_NOCONFIRMATION
          Respond with "Yes to All" for any dialog box that is displayed.
static int FOF_NOCONFIRMMKDIR
          Do not confirm the creation of a new directory if the operation requires one to be created.
static int FOF_NOCOPYSECURITYATTRIBS
          Not supported.
static int FOF_NOERRORUI
          Do not display a user interface if an error occurs.
static int FOF_RENAMEONCOLLISION
          Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
static int FOF_SILENT
          Do not display a progress dialog box.
static int FOF_SIMPLEPROGRESS
          Display a progress dialog box but do not show the file names.
static int FOF_WANTMAPPINGHANDLE
          Not supported.
static int SHERB_NOCONFIRMATION
          No dialog box confirming the deletion of the objects will be displayed.
static int SHERB_NOPROGRESSUI
          No dialog box indicating the progress will be displayed.
static int SHERB_NOSOUND
          No sound will be played when the operation is complete.
static int STRUCTURE_ALIGNMENT
          Custom alignment of structures.
 
Fields inherited from interface com.sun.jna.examples.win32.W32API
ASCII_OPTIONS, DEFAULT_OPTIONS, HWND_BROADCAST, INVALID_HANDLE_VALUE, UNICODE_OPTIONS
 
Fields inherited from interface com.sun.jna.win32.StdCallLibrary
FUNCTION_MAPPER, STDCALL_CONVENTION
 
Fields inherited from interface com.sun.jna.Library
OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
 
Fields inherited from interface com.sun.jna.examples.win32.W32Errors
ERROR_FILE_NOT_FOUND, ERROR_INVALID_FUNCTION, ERROR_PATH_NOT_FOUND, NO_ERROR
 
Method Summary
 int SHEmptyRecycleBin(com.sun.jna.examples.win32.W32API.HANDLE hwnd, java.lang.String pszRootPath, int dwFlags)
          Empties the Recycle Bin on the specified drive.
 int SHFileOperation(Shell32API.SHFILEOPSTRUCT lpFileOp)
          This function can be used to copy, move, rename, or delete a file system object.
 int SHQueryRecycleBin(java.lang.String pszRootPath, Shell32API.SHQUERYRBINFO pSHQueryRBInfo)
          Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive.
 

Field Detail

STRUCTURE_ALIGNMENT

static final int STRUCTURE_ALIGNMENT
Custom alignment of structures.

See Also:
Constant Field Values

FO_MOVE

static final int FO_MOVE
Copies the files specified in the pFrom member to the location specified in the pTo member.

See Also:
Constant Field Values

FO_COPY

static final int FO_COPY
Copies the files specified in the pFrom member to the location specified in the pTo member.

See Also:
Constant Field Values

FO_DELETE

static final int FO_DELETE
Deletes the files specified in pFrom.

See Also:
Constant Field Values

FO_RENAME

static final int FO_RENAME
Renames the file specified in pFrom. You cannot use this flag to rename multiple files with a single function call. Use FO_MOVE instead.

See Also:
Constant Field Values

FOF_MULTIDESTFILES

static final int FOF_MULTIDESTFILES
Not supported.

See Also:
Constant Field Values

FOF_CONFIRMMOUSE

static final int FOF_CONFIRMMOUSE
Not supported.

See Also:
Constant Field Values

FOF_SILENT

static final int FOF_SILENT
Do not display a progress dialog box.

See Also:
Constant Field Values

FOF_RENAMEONCOLLISION

static final int FOF_RENAMEONCOLLISION
Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.

See Also:
Constant Field Values

FOF_NOCONFIRMATION

static final int FOF_NOCONFIRMATION
Respond with "Yes to All" for any dialog box that is displayed.

See Also:
Constant Field Values

FOF_WANTMAPPINGHANDLE

static final int FOF_WANTMAPPINGHANDLE
Not supported.

See Also:
Constant Field Values

FOF_ALLOWUNDO

static final int FOF_ALLOWUNDO
Preserve Undo information, if possible. If pFrom does not contain fully qualified path and file names, this flag is ignored.

See Also:
Constant Field Values

FOF_FILESONLY

static final int FOF_FILESONLY
Not supported.

See Also:
Constant Field Values

FOF_SIMPLEPROGRESS

static final int FOF_SIMPLEPROGRESS
Display a progress dialog box but do not show the file names.

See Also:
Constant Field Values

FOF_NOCONFIRMMKDIR

static final int FOF_NOCONFIRMMKDIR
Do not confirm the creation of a new directory if the operation requires one to be created.

See Also:
Constant Field Values

FOF_NOERRORUI

static final int FOF_NOERRORUI
Do not display a user interface if an error occurs.

See Also:
Constant Field Values

FOF_NOCOPYSECURITYATTRIBS

static final int FOF_NOCOPYSECURITYATTRIBS
Not supported.

See Also:
Constant Field Values

SHERB_NOCONFIRMATION

static final int SHERB_NOCONFIRMATION
No dialog box confirming the deletion of the objects will be displayed.

See Also:
Constant Field Values

SHERB_NOPROGRESSUI

static final int SHERB_NOPROGRESSUI
No dialog box indicating the progress will be displayed.

See Also:
Constant Field Values

SHERB_NOSOUND

static final int SHERB_NOSOUND
No sound will be played when the operation is complete.

See Also:
Constant Field Values
Method Detail

SHFileOperation

int SHFileOperation(Shell32API.SHFILEOPSTRUCT lpFileOp)
This function can be used to copy, move, rename, or delete a file system object.

Remarks: You should use fully qualified path names with this function. Using it with relative path names is not thread-safe.
When used to delete a file, SHFileOperation attempts to place the deleted file in the Recycle Bin. If you wish to delete a file and guarantee that it is not placed in the Recycle Bin, use the DeleteFile function.

Parameters:
lpFileOp - a SHFILEOPSTRUCT structure that contains information this function needs to carry out the specified operation.
Returns:
Returns zero if successful, or nonzero otherwise.

SHEmptyRecycleBin

int SHEmptyRecycleBin(com.sun.jna.examples.win32.W32API.HANDLE hwnd,
                      java.lang.String pszRootPath,
                      int dwFlags)
Empties the Recycle Bin on the specified drive.

Parameters:
hwnd - A handle to the parent window of any dialog boxes that might be displayed during the operation. This parameter can be NULL.
pszRootPath - a null-terminated string of maximum length MAX_PATH that contains the path of the root drive on which the Recycle Bin is located. This parameter can contain a string formatted with the drive, folder, and subfolder names, for example c:\windows\system\, etc. It can also contain an empty string or NULL. If this value is an empty string or NULL, all Recycle Bins on all drives will be emptied.
dwFlags - a bitwise combination of SHERB_NOCONFIRMATION, SHERB_NOPROGRESSUI and SHERB_NOSOUND.
Returns:
Returns S_OK (0) if successful, or a COM-defined error value otherwise.

SHQueryRecycleBin

int SHQueryRecycleBin(java.lang.String pszRootPath,
                      Shell32API.SHQUERYRBINFO pSHQueryRBInfo)
Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive.

Remarks: With Microsoft Windows 2000, if NULL is passed in the pszRootPath parameter, the function fails and returns an E_INVALIDARG error code. In earlier versions of the operating system, you can pass an empty string or NULL. If pszRootPath contains an empty string or NULL, information is retrieved for all Recycle Bins on all drives.

Parameters:
pszRootPath - a null-terminated string of maximum length MAX_PATH to contain the path of the root drive on which the Recycle Bin is located. This parameter can contain a string formatted with the drive, folder, and subfolder names (C:\Windows\System...).
pSHQueryRBInfo - a SHQUERYRBINFO structure that receives the Recycle Bin information. The cbSize member of the structure must be set to the size of the structure before calling this API.
Returns:
Returns S_OK (0) if successful, or a COM-defined error value otherwise.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard