Kernel32GetShortPathName Method
Retrieves the short path form of the specified path.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static uint GetShortPathName(
string longPath,
StringBuilder shortPath,
uint bufferLen
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetShortPathName (
longPath As String,
shortPath As StringBuilder,
bufferLen As UInteger
) As UInteger
Dim longPath As String
Dim shortPath As StringBuilder
Dim bufferLen As UInteger
Dim returnValue As UInteger
returnValue = Kernel32.GetShortPathName(longPath,
shortPath, bufferLen)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static unsigned int GetShortPathName(
String^ longPath,
StringBuilder^ shortPath,
unsigned int bufferLen
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetShortPathName :
longPath : string *
shortPath : StringBuilder *
bufferLen : uint32 -> uint32
No code example is currently available or this language may not be supported.
- longPath String
-
The path string.
- shortPath StringBuilder
-
A pointer to a buffer to receive the null-terminated short form of the path that longPath parameter specifies.
Passing for this parameter and zero for bufferLen parameter,
will always return the required buffer size for a specified longPath parameter.
- bufferLen UInt32
-
The size of the buffer that shortPath points to.
Set this parameter to zero if shortPath is set to .
UInt32
If the function succeeds, the return value is the length of the string that is copied to
shortPath,
not including the terminating null character.
If the
shortPath buffer is too small to contain the path,
the return value is the size of the buffer that is required to hold the path and the terminating null character.
If the function fails for any other reason, the return value is zero.
To get extended error information, call
GetLastWin32Error.