那个描述是记录在版本信息里的,不是所有的程序都有版本信息,delphi编译的exe默认是没有版本信息的
你可以用记事本的那个exe来试试下面的代码
procedure TForm1.Button1Click(Sender: TObject);
const
SFInfo= '/StringFileInfo/';
var
VersionInfo: Pointer;
InfoSize: DWORD;
InfoPointer: Pointer;
Translation: Pointer;
VersionValue: string;
unused: DWORD;
fname:string;
begin
if OpenDialog1.Execute then
begin
fname:=OpenDialog1.FileName;
InfoSize := GetFileVersionInfoSize(pchar(fname), unused);
if InfoSize > 0 then
begin
GetMem(VersionInfo, InfoSize);
if GetFileVersionInfo(pchar(fname), 0, InfoSize, VersionInfo) then
begin
VerQueryValue(VersionInfo, '/VarFileInfo/Translation', Translation, InfoSize);
VersionValue := SFInfo + IntToHex(LoWord(Longint(Translation^)), 4) +
IntToHex(HiWord(Longint(Translation^)), 4) + '/';
VerQueryValue(VersionInfo, pchar(VersionValue + 'FileDescription'), InfoPointer, InfoSize);
self.Caption := string(pchar(InfoPointer));
end;
FreeMem(VersionInfo);
end;
end;
end;