Below is the steps to do that :
- Create function to get version info:
function GetAppVersion:string; var Size, Size2: DWord; Pt, Pt2: Pointer; begin Size := GetFileVersionInfoSize(PChar (ParamStr (0)), Size2); if Size > 0 then begin GetMem (Pt, Size); try GetFileVersionInfo (PChar (ParamStr (0)), 0, Size, Pt); VerQueryValue (Pt, '\', Pt2, Size2); with TVSFixedFileInfo (Pt2^) do begin Result:= ' Ver '+ IntToStr (HiWord (dwFileVersionMS)) + '.' + IntToStr (LoWord (dwFileVersionMS)) + '.' + IntToStr (HiWord (dwFileVersionLS)) + '.' + IntToStr (LoWord (dwFileVersionLS)); end; finally FreeMem (Pt); end; end; end;
- To make it display in form caption, write this script OnCreate events form
Form1.Caption:=Form1.Caption+GetAppVersion;
get version on form caption |
No comments:
Post a Comment