
![]() |
Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
|
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.218.79.102] |
![]() |
|
![]() |
Сообщ.
#1
,
|
|
P.O.D, круто
![]() Но вот так, думаю, будет попроще: ![]() ![]() unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; function GetLongPathNameA(lpszShortPath, lpszLongPath: PChar; cchBuffer: DWORD): DWORD; stdcall; external kernel32; var Form1: TForm1; implementation {$R *.dfm} function ExpandFileName(Path: String): String; begin SetLength(Result, MAX_PATH); if GetLongPathNameA(PChar(Path), @Result[1], MAX_PATH) = 0 then RaiseLastOSError; Result := Trim(Result); end; procedure TForm1.Button1Click(Sender: TObject); var S: String; begin // Получаем полное имя S := ExpandFileName('C:\DOCUME~1\'); ShowMessage(S); // Получаем урезанное имя GetShortPathName(PChar(S), PChar(S), MAX_PATH); ShowMessage(S); end; end. |