Mega Code Archive

 
Categories / Delphi / Algorithm Math
 

How to convert a short path in a long one

Title: How to convert a short path in a long one //declaration function GetLongPathName(lpszShortPath: PChar; lpszLongPath: PChar; cchBuffer: DWORD): DWORD; stdcall; //implementation function GetLongPathName; external kernel32 Name 'GetLongPathNameA'; // ----------------------------------------------------------------------------- function WinAPI_GetLongPathName(const ShortName: string): string; begin SetLength(Result, MAX_PATH); SetLength(Result, GetLongPathName(PChar(ShortName), PChar(Result), MAX_PATH)); end;