ShlwApi Class

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

ShlwApi.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 ShlwApi
Inheritance
Object    ShlwApi

Methods

AssocQueryString Searches for and retrieves a file or protocol association-related string from the registry.
ColorHLSToRGB Converts colors from hue-luminance-saturation (HLS) to RGB format.
ColorRGBToHLS Converts colors from RGB to hue-luminance-saturation (HLS) format
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetMenuPosFromID Determines the position of an item in a menu. Used in the case where the item's ID is known.
GetType Gets the Type of the current instance.
(Inherited from Object)
HashData Hashes an array of data.
IsCharSpace Determines whether a character represents a space.
IUnknown_QueryService Retrieves an interface for a service from a specified object.
PathAddBackslash Adds a backslash to the end of a string to create the correct syntax for a path.

If the source path already has a trailing backslash, no backslash will be added.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchAddBackslash(StringBuilder, UInt32) or PathCchAddBackslashEx(StringBuilder, UInt32, IntPtr, UInt32) function in its place
Obsolete.

PathAddExtension Adds a file name extension to a path string.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchAddExtension(StringBuilder, UInt32, String) function in its place.
Obsolete.

PathAppend Appends one path to the end of another.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchAppend(StringBuilder, UInt32, String) or PathCchAppendEx(StringBuilder, UInt32, String, PathOptions) function in its place.
Obsolete.

PathBuildRoot Creates a root path from a given drive number.
PathCanonicalize Simplifies a path by removing navigation elements such as "." and ".." to produce a direct, well-formed path.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchCanonicalize(StringBuilder, UInt32, String) or PathCchCanonicalizeEx(StringBuilder, UInt32, String, PathOptions) function in its place.
Obsolete.

PathCombine Concatenates two strings that represent properly formed paths into one path; also concatenates any relative path elements.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchCombine(StringBuilder, UInt32, String, String) or PathCchCombineEx(StringBuilder, UInt32, String, String, PathOptions) function in its place.
Obsolete.

PathCompactPath Truncates a file path to fit within a given pixel width by replacing path components with ellipses.
PathCompactPathEx Truncates a path to fit within a certain number of characters by replacing path components with ellipses.
PathFileExists Determines whether a path to a file system object such as a file or folder is valid.
PathGetDriveNumber Searches a path for a drive letter within the range of 'A' to 'Z' and returns the corresponding drive number.
PathIsContentType Determines if a file's registered content type matches the specified content type.

This function obtains the content type for the specified file type and compares that string with the contentType. The comparison is not case-sensitive.

PathIsDirectory Verifies that a path is a valid directory.
PathIsDirectoryEmpty Determines whether a specified path is an empty directory.
PathIsNetworkPath Determines whether a path string represents a network resource.
PathIsRelative Searches a path and determines if it is relative.
PathIsRoot Determines whether a path string refers to the root of a volume.
PathIsSameRoot Compares two paths to determine if they have a common root component.
PathIsSystemFolder(String, FileAttributes) Determines if an existing folder contains the attributes that make it a system folder.

Alternately, this function indicates if certain attributes qualify a folder to be a system folder.

PathIsSystemFolder(String, UInt32) Determines if an existing folder contains the attributes that make it a system folder.

Alternately, this function indicates if certain attributes qualify a folder to be a system folder.

PathIsUNC Determines if a path string is a valid Universal Naming Convention (UNC) path, as opposed to a path based on a drive letter.
PathIsUNCServer Determines if a string is a valid Universal Naming Convention (UNC) for a server path only.
PathIsUNCServerShare Determines if a string is a valid Universal Naming Convention (UNC) share path, \server<i>share.
PathIsURL Tests a given string to determine if it conforms to a valid URL format.
PathMakePretty Converts an all-uppercase path to all lowercase characters to give the path a consistent appearance.
PathMakeSystemFolder Gives an existing folder the proper attributes to become a system folder.
PathQuoteSpaces Searches a path for spaces. If spaces are found, the entire path is enclosed in quotation marks.
PathRelativePathTo Creates a relative path from one file or folder to another.
PathRemoveBackslash Removes the trailing backslash from a given path.

Note: This function is deprecated. We recommend the use of the PathCchRemoveBackslash(StringBuilder, UInt32) or PathCchRemoveBackslashEx(StringBuilder, UInt32, IntPtr, UInt32) function in its place
Obsolete.

PathRemoveBlanks Removes all leading and trailing spaces from a string.
PathRemoveExtension Removes the file name extension from a path, if one is present.

Note: This function is deprecated. We recommend the use of the PathCchRemoveExtension(StringBuilder, UInt32) function in its place.
Obsolete.

PathRemoveFileSpec Removes the trailing file name and backslash from a path, if they are present.

Note: This function is deprecated. We recommend the use of the PathCchRemoveFileSpec(StringBuilder, UInt32) function in its place.
Obsolete.

PathRenameExtension Replaces the extension of a file name with a new extension.

If the file name does not contain an extension, the extension will be attached to the end of the string.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchRenameExtension(StringBuilder, UInt32, String) function in its place.
Obsolete.

PathSetDlgItemPath Sets the text of a child control in a window or dialog box, using PathCompactPath function to ensure the path fits in the control.
PathStripPath Removes the path portion of a fully qualified path and file.
PathStripToRoot Removes all file and directory elements in a path except for the root information.

Note: Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchStripToRoot(StringBuilder, UInt32) function in its place.
Obsolete.

PathUnExpandEnvStrings Replaces certain folder names in a fully qualified path with their associated environment string.
PathUnmakeSystemFolder Removes the attributes from a folder that make it a system folder. This folder must actually exist in the file system.
PathUnquoteSpaces Removes quotes from the beginning and end of a path.
SHAutoComplete Instructs system edit controls to use AutoComplete to help complete URLs or file system paths.
SHCreateStreamOnFile(String, StorageModeFlags, FsiStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFile(String, StorageModeFlags, IStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, CreateFileFlags, Boolean, FsiStream, FsiStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, CreateFileFlags, Boolean, IStream, IStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, FileAttributes, Boolean, FsiStream, FsiStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, FileAttributes, Boolean, IStream, IStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, UInt32, Boolean, FsiStream, FsiStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateStreamOnFileEx(String, StorageModeFlags, UInt32, Boolean, IStream, IStream) Opens or creates a file and retrieves a stream to read or write to that file.
SHCreateThreadRef Creates a per-thread reference to a Component Object Model (COM) object.
SHGetThreadRef Retrieves the per-thread object reference set by SHSetThreadRef(Object).
SHReleaseThreadRef Releases a thread reference before the thread procedure returns.
SHSetThreadRef Stores a per-thread reference to a Component Object Model (COM) object.

This allows the caller to control the thread's lifetime so that it can ensure that Windows won't shut down the thread before the caller is ready.

StrCmpLogicalW Compares two Unicode strings. Digits in the strings are considered as numerical content rather than text. This test is not case-sensitive.
StrFormatByteSize64A Converts a numeric value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, gigabytes, petabytes or exabytes, depending on the size.
StrFormatByteSizeEx Converts a numeric value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, gigabytes, petabytes or exabytes, depending on the size.

Extends StrFormatByteSizeW by offering the option to round to the nearest displayed digit or to discard undisplayed digits.

StrFormatKBSize Converts a numeric value into a string that represents the number expressed as a size value in kilobytes.
StrFromTimeInterval Converts a time interval, specified in milliseconds, to a string.
ToString Returns a string that represents the current object.
(Inherited from Object)
UrlHash Hashes a URL string.

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