
18.04.2012, 08:35
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
-меню Project-Options...
-вкладка Version Info
-ставим галочку Include version information in project
-жмем кнопку Help
-читаем в файле справки Version Info (Project|Options)
-видим Note: For details on how to access version information programmatically, see Reading version information.
-кликаем на Reading version information
-читаем в файле справки Reading version information
-видим Delphi example
-кликаем на Delphi example
-изучаем код:
Код:
procedure TForm1.Button1Click(Sender: TObject);
const
InfoNum = 10;
InfoStr: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');
var
S: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem(n);
Memo1.Lines.Add('VersionInfoSize = ' + IntToStr(n));
GetFileVersionInfo(PChar(S), 0, n, Buf);
for i := 1 to InfoNum do
if VerQueryValue(Buf, PChar('StringFileInfo\040904E4\' + InfoStr[i]), Pointer(Value), Len) then
Memo1.Lines.Add(InfoStr[i] + ' = ' + Value);
FreeMem(Buf, n);
end
else
Memo1.Lines.Add('No version information found');
end;
__________________
Пишу программы за еду.
__________________
|