GetLongPathName
Esta función la podemos usar para convertir un nombre corto (tipo MS-DOS 8.3) en uno largo.
Ejemplos para VB6 y Visual Basic .NET
y C#
Declaración en el API de Windows:
DWORD GetLongPathName(
LPCTSTR lpszShortPath, // Pointer to a null-terminated path to be converted
LPTSTR lpszLongPath, // Pointer to the buffer to receive the long path.
// You can use the same buffer you used for the lpszShortPath parameter
DWORD cchBuffer // Specifies the size of the buffer, in characters
);
Declaración para VB6:
Private Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" _
(ByVal lpszShortPath As String, _
ByVal lpszLongPath As String, _
ByVal cchBuffer As Long) As Long
Declaración
para VB .NET:
<System.Runtime.InteropServices.DllImport("kernel32.dll")> _
Private Shared Function GetLongPathName( _
ByVal lpszShortPath As String, _
ByVal lpszLongPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer
End Function
Declaración
para C#:
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private extern static int GetLongPathName(
string lpszShortPath,
System.Text.StringBuilder lpszLongPath,
int cchBuffer);