Top Description Constructors Methods
com.sun.jna.platform.win32

public abstract Class Shell32Util

extends Object
Class Inheritance
Imports
com.sun.jna.Native, .Pointer, .WString, com.sun.jna.platform.win32.Guid.GUID, .WinDef.DWORD, .WinDef.HWND, .WinNT.HANDLE, .WinNT.HRESULT, com.sun.jna.ptr.IntByReference, .PointerByReference

Shell32 Utility API.
Authors
dblock[at]dblock.org, markus[at]headcrashing[dot]eu

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final String[]

Returns:

An array of strings, similar to argv.
CommandLineToArgv
(String
A string that contains the full command line. If this parameter is an empty string the function returns the path to the current executable file.
cmdLine
)

Parses a command line string and returns an array of Strings of the command line arguments.

public static String

Returns:

Special folder.
getFolderPath
(WinDef.HWND
Parent window.
hwnd
,
int
Folder CSLID.
nFolder
,
WinDef.DWORD
Flags.
dwFlags
)

Get a special folder path.

public static String

Returns:

Special folder path.
getFolderPath
(int
Folder CSLID.
nFolder
)

Get a special folder path.

public static String

Returns:

the path of the known folder. The returned path does not include a trailing backslash. For example, "C:\Users" is returned rather than "C:\Users\".
getKnownFolderPath
(Guid.GUID
the KNOWNFOLDERS GUID as defined in KnownFolders
guid
)

Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID.

public static final String

Returns:

The drive and path of the specified folder
getSpecialFolderPath
(final int
A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
csidl
,
final boolean
Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder is created. If this value is zero, the folder is not created.
create
)

Retrieves the path of a special folder, identified by its CSIDL.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Shell32Utilback to summary
public Shell32Util()

Method Detail

CommandLineToArgvback to summary
public static final String[] CommandLineToArgv(String cmdLine)

Parses a command line string and returns an array of Strings of the command line arguments.

Parameters
cmdLine:String

A string that contains the full command line. If this parameter is an empty string the function returns the path to the current executable file.

Returns:String[]

An array of strings, similar to argv.

getFolderPathback to summary
public static String getFolderPath(WinDef.HWND hwnd, int nFolder, WinDef.DWORD dwFlags)

Get a special folder path.

Parameters
hwnd:WinDef.HWND

Parent window.

nFolder:int

Folder CSLID.

dwFlags:WinDef.DWORD

Flags.

Returns:String

Special folder.

getFolderPathback to summary
public static String getFolderPath(int nFolder)

Get a special folder path.

Parameters
nFolder:int

Folder CSLID.

Returns:String

Special folder path.

getKnownFolderPathback to summary
public static String getKnownFolderPath(Guid.GUID guid) throws Win32Exception

Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID. This function replaces getFolderPath. That older function is now simply a wrapper for getKnownFolderPath

Parameters
guid:Guid.GUID

the KNOWNFOLDERS GUID as defined in KnownFolders

Returns:String

the path of the known folder. The returned path does not include a trailing backslash. For example, "C:\Users" is returned rather than "C:\Users\".

Exceptions
Win32Exception:
if the guid references a KNOWNFOLDERID which does not have a path (such as a folder marked as KF_CATEGORY_VIRTUAL) or that the KNOWNFOLDERID is not present on the system. Not all KNOWNFOLDERID values are present on all systems.
getSpecialFolderPathback to summary
public static final String getSpecialFolderPath(final int csidl, final boolean create)

Retrieves the path of a special folder, identified by its CSIDL.

Parameters
csidl:int

A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.

create:boolean

Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder is created. If this value is zero, the folder is not created.

Returns:String

The drive and path of the specified folder