ExtractShortPathName ' Den Dönen Değeri Long Hale Getirme???
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
ExtractShortPathName ' Den Dönen Değeri Long Hale Getirme???
s.a Kısaltılmış Dizinleri Normal uzun hale nasıl getiririz yani ExtractShortPath Den Dönen Değer Gibi Dizinleri Nasıl Uzun Normal Haline Getirebiliriz ?
Re: ExtractShortPathName ' Den Dönen Değeri Long Hale Getirme???
Torry NET adresinden alıntıdır. ref: http://www.swissdelphicenter.ch/torry/s ... hp?id=1928
Kod: Tümünü seç
function GetLongPathName(const ShortName : string) : string;
var
pcBuffer: PChar;
iHandle, iLen : Integer;
GetLongPathName: function (ShortPathName: PChar; LongPathName: PChar;
cchBuffer: Integer): Integer stdcall;
begin
Result := ShortName;
iHandle := GetModuleHandle('kernel32.dll');
if (iHandle <> 0) then begin
@GetLongPathName := GetProcAddress(iHandle, 'GetLongPathNameA');
if Assigned(GetLongPathName) then begin
pcBuffer := StrAlloc(MAX_PATH + 1);
iLen := GetLongPathName(PChar(ShortName), pcBuffer, MAX_PATH);
// if result = 0 : conversion failed
// if result > MAX_PATH ==> conversion failed, buffer not large enough
if (iLen > 0) and (iLen <= MAX_PATH) then begin
Result := StrPas(pcBuffer);
end; // if (iLen <= MAX_PATH) then
StrDispose(pcBuffer);
end; // if Assigned(GetLongPathName) then
FreeLibrary(iHandle);
end; // if (iHandle <> 0) then
end;
Re: ExtractShortPathName ' Den Dönen Değeri Long Hale Getirme???
Allah razı olsun hocam aramayı bulmayı bilmediğimizden durum bumrmarman yazdı:Torry NET adresinden alıntıdır. ref: http://www.swissdelphicenter.ch/torry/s ... hp?id=1928
Kod: Tümünü seç
function GetLongPathName(const ShortName : string) : string; var pcBuffer: PChar; iHandle, iLen : Integer; GetLongPathName: function (ShortPathName: PChar; LongPathName: PChar; cchBuffer: Integer): Integer stdcall; begin Result := ShortName; iHandle := GetModuleHandle('kernel32.dll'); if (iHandle <> 0) then begin @GetLongPathName := GetProcAddress(iHandle, 'GetLongPathNameA'); if Assigned(GetLongPathName) then begin pcBuffer := StrAlloc(MAX_PATH + 1); iLen := GetLongPathName(PChar(ShortName), pcBuffer, MAX_PATH); // if result = 0 : conversion failed // if result > MAX_PATH ==> conversion failed, buffer not large enough if (iLen > 0) and (iLen <= MAX_PATH) then begin Result := StrPas(pcBuffer); end; // if (iLen <= MAX_PATH) then StrDispose(pcBuffer); end; // if Assigned(GetLongPathName) then FreeLibrary(iHandle); end; // if (iHandle <> 0) then end;
