Shell32 Class

Platform Invocation methods (P/Invoke), access unmanaged code.

Shell32.dll.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[HideModuleNameAttribute]
public sealed class Shell32
Inheritance
Object    Shell32

Methods

CommandLineToArgvW Parses a Unicode command line string and returns an array of pointers to the command line arguments, along with a count of such arguments, in a way that is similar to the standard C run-time argv and argc values.
DuplicateIcon Creates a duplicate of a specified icon.
EmptyRecycleBin(IntPtr, String, SHEmptyRecycleBinFlags) Empties the Recycle Bin on the specified drive.
EmptyRecycleBin(SafeHandle, String, SHEmptyRecycleBinFlags) Empties the Recycle Bin on the specified drive.
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
ExtractIconEx Creates an array of handles to large or small icons extracted from the specified executable file, DLL, or icon file.
FindExecutable Retrieves the name of and handle to the executable (.exe) file associated with a specific document file.
GetCurrentProcessExplicitAppUserModelID Retrieves the application-defined, explicit Application User Model ID (AppUserModelID) for the current process.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
ILClone Clones an ITEMIDLIST structure.
ILCloneFirst Clones the first SHITEMID structure in an ITEMIDLIST structure.
ILCloneIntPtr Clones an ITEMIDLIST structure.
ILCombine Combines two ITEMIDLIST structures.
ILCombineIntPtr Combines two ITEMIDLIST structures.
ILCreateFromPath Returns the ITEMIDLIST structure associated with a specified file path.
ILCreateFromPathIntPtr Returns the ITEMIDLIST structure associated with a specified file path.
ILFindChild(IntPtr, IntPtr) Determines whether a specified ITEMIDLIST structure is the child of another ITEMIDLIST structure.
ILFindChild(PIDL, PIDL) Determines whether a specified ITEMIDLIST structure is the child of another ITEMIDLIST structure.
ILFindLastID Returns a pointer to the last SHITEMID structure in an ITEMIDLIST structure.
ILFree Frees an ITEMIDLIST structure allocated by the Shell.
ILGetNext Retrieves the next SHITEMID structure in an ITEMIDLIST structure.
ILGetSize Returns the size, in bytes, of an ITEMIDLIST structure.
ILIsEqual Tests whether two ITEMIDLIST structures are equal in a binary comparison.
ILIsParent Tests whether an ITEMIDLIST structure is the parent of another ITEMIDLIST structure.
ILLoadFromStreamEx(IStream, PIDL) Loads an absolute ITEMIDLIST from an IStream.
ILLoadFromStreamEx(IStream, IntPtr) Loads an absolute ITEMIDLIST from an IStream.
ILRemoveLastID Removes the last SHITEMID structure from an ITEMIDLIST structure.
ILSaveToStream(IStream, PIDL) Saves an ITEMIDLIST structure to a stream.
ILSaveToStream(IStream, IntPtr) Saves an ITEMIDLIST structure to a stream.
InitNetworkAddressControl Initializes the network address control window class.
IsUserAnAdmin Determine whether the current user is a member of the Administrator's group.
NotifyIconGetRect(NotifyIconIdentifier, NativeRectangle) Gets the screen coordinates of the bounding rectangle of a notification icon.
NotifyIconGetRect(NotifyIconIdentifier, Rectangle) Gets the screen coordinates of the bounding rectangle of a notification icon.
PathGetShortPath Retrieves the short path form of a specified input path.
PathIsExe Determines whether a file is an executable by examining the file name extension.
PathIsSlow Determines whether a file path is a high-latency network connection.
PathMakeUniqueName Creates a unique path name from a template.
PathResolve Converts a relative or unqualified path name to a fully qualified path name.
PathYetAnotherMakeUniqueName Creates a unique filename based on an existing filename.
PickIconDlg(IntPtr, String, Int32, Int32) Displays a dialog box that allows the user to choose an icon from the selection available embedded in a resource such as an executable or DLL file.
PickIconDlg(IntPtr, StringBuilder, Int32, Int32) Displays a dialog box that allows the user to choose an icon from the selection available embedded in a resource such as an executable or DLL file.
QueryRecycleBin Retrieves the accumulated size of the Recycle Bin and the number of items in it, for a specified drive.
SetCurrentProcessExplicitAppUserModelID Specifies a unique application-defined Application User Model ID (AppUserModelID) that identifies the current process to the taskbar.

This identifier allows an application to group its associated processes and windows under a single taskbar button.

This method must be called during an application's initial startup routine before the application presents any UI or makes any manipulation of its Jump Lists. This includes any call to SHAddToRecentDocs(ShellAddToRecentDocsFlags, PIDL) function.

SHAddToRecentDocs(ShellAddToRecentDocsFlags, PIDL) Notifies the system that an item has been accessed, for the purposes of tracking those items used most recently and most frequently.

This function can also be used to clear all usage data.

SHAddToRecentDocs(ShellAddToRecentDocsFlags, IShellItem) Notifies the system that an item has been accessed, for the purposes of tracking those items used most recently and most frequently.

This function can also be used to clear all usage data.

SHAddToRecentDocs(ShellAddToRecentDocsFlags, IShellLinkW) Notifies the system that an item has been accessed, for the purposes of tracking those items used most recently and most frequently.

This function can also be used to clear all usage data.

SHAddToRecentDocs(ShellAddToRecentDocsFlags, String) Notifies the system that an item has been accessed, for the purposes of tracking those items used most recently and most frequently.

This function can also be used to clear all usage data.

SHAppBarMessage Sends an appbar message to the system.
SHChangeNotify(SHChangeNotifyEventID, SHChangeNotifyFlags, IntPtr, IntPtr) Notifies the system of an event that an application has performed.

An application should use this function if it performs an action that may affect the Shell.

SHChangeNotify(SHChangeNotifyEventID, SHChangeNotifyFlags, String, String) Notifies the system of an event that an application has performed.

An application should use this function if it performs an action that may affect the Shell.

SHCreateItemFromIDList(PIDL, Guid, IShellItem) Creates and initializes a Shell item object from a pointer to an item identifier list (PIDL).

The resulting shell item object supports the IShellItem interface.

SHCreateItemFromIDList(PIDL, Guid, Object) Creates and initializes a Shell item object from a pointer to an item identifier list (PIDL).

The resulting shell item object supports the IShellItem interface.

SHCreateItemFromParsingName(String, IntPtr, Guid, IShellItem) Creates and initializes a Shell item object from a parsing name.
SHCreateItemFromParsingName(String, IntPtr, Guid, Object) Creates and initializes a Shell item object from a parsing name.
SHCreateItemFromParsingName(String, IBindCtx, Guid, IShellItem) Creates and initializes a Shell item object from a parsing name.
SHCreateItemFromParsingName(String, IBindCtx, Guid, Object) Creates and initializes a Shell item object from a parsing name.
SHCreateItemFromRelativeName(IShellItem, String, IBindCtx, Guid, IShellItem) Creates and initializes a Shell item object from a relative parsing name.
SHCreateItemFromRelativeName(IShellItem, String, IBindCtx, Guid, Object) Creates and initializes a Shell item object from a relative parsing name.
SHCreateItemWithParent(PIDL, IShellFolder, PIDL, Guid, IShellItem) Create a Shell item, given a parent folder and a child item ID.
SHCreateItemWithParent(PIDL, IShellFolder, PIDL, Guid, Object) Create a Shell item, given a parent folder and a child item ID.
SHCreateShellItem Creates an IShellItem object.

Note: It is recommended that you use SHCreateItemWithParent(PIDL, IShellFolder, PIDL, Guid, IShellItem) or SHCreateItemFromIDList(PIDL, Guid, IShellItem) instead of this function.

SHDefExtractIcon Provides a default handler to extract an icon from a file.
SHDoDragDrop Executes a drag-and-drop operation. Supports drag source creation on demand, as well as drag images.
ShellAbout(IntPtr, String, String, IntPtr) Displays a ShellAbout dialog box.
ShellAbout(SafeHandle, String, String, IntPtr) Displays a ShellAbout dialog box.
ShellExecuteEx Performs an operation on a specified file..
SHFindFiles Displays the Search window UI.
SHFlushSFCache Flushes the special folder cache.
SHGetDesktopFolder Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace.
SHGetFileInfo(IntPtr, FileAttributes, ShellFileInfo, UInt32, SHGetFileInfoFlags) Retrieves information about an object in the file system, such as a file, folder, directory, or drive root.
SHGetFileInfo(String, FileAttributes, ShellFileInfo, UInt32, SHGetFileInfoFlags) Retrieves information about an object in the file system, such as a file, folder, directory, or drive root.
SHGetIDListFromObject(Object, PIDL) Retrieves the pointer to an item identifier list (PIDL) of an object.
SHGetIDListFromObject(Object, IntPtr) Retrieves the pointer to an item identifier list (PIDL) of an object.
SHGetInstanceExplorer Retrieves an interface that allows hosted Shell extensions and other components to prevent their host process from closing prematurely.

The host process is typically Windows Explorer or Windows Internet Explorer, but this function can also be used by other applications.

SHGetNameFromIDList(IntPtr, ShellItemGetDisplayName, StringBuilder) Retrieves the display name of an item identified by its IDList.
SHGetNameFromIDList(PIDL, ShellItemGetDisplayName, StringBuilder) Retrieves the display name of an item identified by its IDList.
SHGetNewLinkInfo Creates a name for a new shortcut based on the shortcut's proposed target. This function does not create the shortcut, just the name.
SHGetPathFromIDList Converts an item identifier list to a file system path.
SHGetPathFromIDListEx Converts an item identifier list to a file system path.

This function extends SHGetPathFromIDList(IntPtr, StringBuilder) by allowing you to set the initial size of the string buffer and declare the options below.

SHGetSetSettings Sets or retrieves Shell state settings.

This function may be altered or unavailable in subsequent Windows versions.

SHLoadNonloadedIconOverlayIdentifiers Signals the Shell that during the next operation requiring overlay information, it should load icon overlay identifiers that either failed creation or were not present for creation at startup.

Identifiers that have already been loaded are not affected.

SHMultiFileProperties Displays a merged property sheet for a set of files.

Property values common to all the files are shown while those that differ display the string (multiple values).

SHObjectProperties Invokes the Properties context menu command on a Shell object.
SHOpenFolderAndSelectItems Opens a Windows Explorer window with specified items in a particular folder selected.
SHOpenWithDialog Displays the Open With dialog box.
SHParseDisplayName(String, IntPtr, PIDL, ShellItemAttributesMask, ShellItemAttributesMask) Translates a Shell namespace object's display name into an item identifier list (PIDL) and returns the attributes of the object.

This function is the preferred method to convert a string to a pointer to an item identifier list (PIDL).

SHParseDisplayName(String, IBindCtx, PIDL, ShellItemAttributesMask, ShellItemAttributesMask) Translates a Shell namespace object's display name into an item identifier list (PIDL) and returns the attributes of the object.

This function is the preferred method to convert a string to a pointer to an item identifier list (PIDL).

SHQueryUserNotificationState Checks the state of the computer for the current user to determine whether sending a notification is appropriate.
SHSetInstanceExplorer Provides an interface that allows hosted Shell extensions and other components to prevent their host process from closing prematurely.

The host process is typically Windows Explorer or Windows Internet Explorer, but this function can also be used by other applications.

SHSimpleIDListFromPath Returns a pointer to an ITEMIDLIST structure when passed a path.
Obsolete.
SHSimpleIDListFromPathIntPtr Returns a pointer to an ITEMIDLIST structure when passed a path.
Obsolete.
SHUpdateImage Notifies the Shell that an image in the system image list has changed.
SignalFileOpen(IntPtr) Sends a notification to the Shell that the specified file has been opened.
SignalFileOpen(PIDL) Sends a notification to the Shell that the specified file has been opened.
ToString Returns a string that represents the current object.
(Inherited from Object)
UpdateRecycleBinIcon Updates the Recycle Bin icon on the desktop to reflect the state of the systemwide Recycle Bin, for example if an error occurs during an EmptyRecycleBin(IntPtr, String, SHEmptyRecycleBinFlags) call.

But since the other Recycle Bin management functions will update this icon on their own, there's almost no reason why your applications would need to call this function explicitly.

Win32DeleteFile Deletes a file.

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also