function GetTempDirectory: String; //获得windows临时目录
var
TempDir: array[0..255] of Char;
begin
; ; GetTempPath(255, @TempDir);
; ; Result := StrPas(TempDir);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
; ;PathBuffer: array[0..255] of char; ; // holds path names
; ;FilePart: PChar; ; ; ; ; ; ; ; ; ; ; // a pointer to the filename
begin
; ; GetShortPathName(PChar(GetTempDirectory), PathBuffer, 255);
; ; showmessage(PathBuffer);
; ; GetFullPathName(PChar(GetTempDirectory), 255, PathBuffer, FilePart);
; ; showmessage(string(PathBuffer));
end;
上面使用了GetFullPathName,结果不对,why???