![]() |
GetLongPathName
Hi,
GetLongPathName geht nicht, Delphi meint: "Undefinierter Bezeichner: 'GetLongPathName'"; Welche Unit brauche ich für GetLongPathName? GetShortPathName funktioniert ja. MFG Chris. |
Re: GetLongPathName
Moin,
Google hat das hier ausgespuckt:
Code:
Damit müsste es eigentlich gehen. ;)
unit PathGetLongName_Unit;
interface uses Windows, SysUtils; function PathGetLongName(const ShortPath: String): String; implementation type TGetLongPathName = function(lpszShortPath, lpszLongPath: PChar; cchBuffer: DWORD): DWORD; stdcall; // ----------------------------------------------------------------------------- function PathGetLongName(const ShortPath: String): String; var GetLongPathName: TGetLongPathName; hKernel32: THandle; begin hKernel32 := LoadLibrary(kernel32); try GetLongPathName := GetProcAddress(hKernel32, 'GetLongPathNameA'); if not Assigned(GetLongPathName) then RaiseLastWin32Error; SetLength(Result, GetLongPathName(PChar(ShortPath), nil, 0)); SetLength(Result, GetLongPathName(PChar(ShortPath), PChar(Result), Length(Result))); finally FreeLibrary(hKernel32); end; {end try/finally} end; {end function} // ----------------------------------------------------------------------------- end. |
Re: GetLongPathName
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:46 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz