Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.025 c
1-1106119659
vega
2005-01-19 10:27
2005.01.30
Закрываемая панель


1-1106040214
syte_ser78
2005-01-18 12:23
2005.01.30
Присвоение значения закладке в Word


1-1105691044
Zilog
2005-01-14 11:24
2005.01.30
Можно ли текстоввый файл запихнуть в DLL?


1-1106035263
Алексей34
2005-01-18 11:01
2005.01.30
TDBGrid и индекс выбранное строки


1-1105938239
Bobby Digital
2005-01-17 08:03
2005.01.30
Help File pt.2




   Наверх