Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.01.30;
Скачать: CL | DM;

Вниз

Как узнать версию программы?   Найти похожие ветки 

 
Zahar   (2004-12-11 22:28) [0]

При разработке проекта можно указывать его версию (Project | Options | Version Info). Как потом программно извлечь эту информацию (ну чтобы на форме About автоматически указывать версию программы, особенно, если установлен флаг Auto-increment build number).


 
Игорь Шевченко ©   (2004-12-11 23:13) [1]


 procedure GetFileVersion(FileName: string; var Major1, Major2,
                Minor1, Minor2: Integer);
 { Helper function to get the actual file version information }
 var
   Info: Pointer;
   InfoSize: DWORD;
   FileInfo: PVSFixedFileInfo;
   FileInfoSize: DWORD;
   Tmp: DWORD;
 begin
   // Get the size of the FileVersionInformatioin
   InfoSize := GetFileVersionInfoSize(PChar(FileName), Tmp);
   // If InfoSize = 0, then the file may not exist, or
   // it may not have file version information in it.
   if InfoSize = 0 then
     raise Exception.Create("Can""t get file version information for "
                    + FileName);
   // Allocate memory for the file version information
   GetMem(Info, InfoSize);
   try
     // Get the information
     GetFileVersionInfo(PChar(FileName), 0, InfoSize, Info);
     // Query the information for the version
     VerQueryValue(Info, "\", Pointer(FileInfo), FileInfoSize);
     // Now fill in the version information
     Major1 := FileInfo.dwFileVersionMS shr 16;
     Major2 := FileInfo.dwFileVersionMS and $FFFF;
     Minor1 := FileInfo.dwFileVersionLS shr 16;
     Minor2 := FileInfo.dwFileVersionLS and $FFFF;
   finally
     FreeMem(Info, FileInfoSize);
   end;
 end;



С уважением,


 
Zahar   (2004-12-11 23:37) [2]

THX!!! Очень помогло!!! Просто супер!!!



Страницы: 1 вся ветка

Текущий архив: 2005.01.30;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
3-1103794357
ks13
2004-12-23 12:32
2005.01.30
Проблема с таблицами, или с приложением?


1-1106046599
Ser_max
2005-01-18 14:09
2005.01.30
свойстваTchart


14-1105690239
vopros
2005-01-14 11:10
2005.01.30
Подскажите сервис


1-1105961360
Кабан
2005-01-17 14:29
2005.01.30
Где взять иконки с палитры компонентов Delphi?


1-1105774192
Phantomouse
2005-01-15 10:29
2005.01.30
Как отследить закрытие программы