procedure TFormLogin.FormCreate(Sender: TObject);
var
MyVersion,: string;
Block: ^VS_FIXEDFILEINFO;
PDatA: pointer;
Dsize, Dlen: Dword;
begin
// 版本检查开关
MYDEBUG := DebugHook = 1;
DLen := GetFileVersioninfoSize(Pchar(ParamStr(0)), Dsize);
GetMem(Pdata, Dlen);
try
if GetFileVersionInfo(pchar(ParamStr(0)), Dsize, Dlen, Pdata) then begin
Block := nil;
VerQueryValue(pdata,‘\‘, pointer(Block), Dsize);
if Block <> nil then begin
MyVersion := Format(‘%d.%d.%d.%d‘,
[Block^.dwFileVersionMS shr 16,Block^.dwFileVersionMS and $0000ffff,
Block^.dwFileVersionLS shr 16,Block^.dwFileVersionLS and $0000ffff]);
end;
end;
finally
freemem(pdata, DLEN);
end;
lblAbout.Caption := ‘V ‘ + MyVersion;
end;
时间: 2024-10-09 15:06:14