GetFileVersion

function GetFileVersion(FileName:string):string;var V1,V2,V3,V4:Word; VerInfoSize:DWORD; VerInfo:Pointer; VerValueSize:DWORD; VerValue:PVSFixedFileInfo; Dummy:DWORD;begin VerInfoSize:=GetFileVersionInfoSize(PChar(FileName),Dummy); if VerInfoSize =0 then Exit; GetMem(VerInfo,VerInfoSize); GetFileVersionInfo(PChar(FileName),0,VerInfoSize,VerInfo); VerQueryValue(VerInfo,'/',Pointer(VerValue), VerValueSize); with VerValue^ do begin V1:=dwFileVersionMS shr 16; V2:=dwFileVersionMS and $FFFF; V3:=dwFileVersionLS shr 16; V4:=dwFileVersionLS and $FFFF; end; FreeMem(VerInfo,VerInfoSize); result:=(Format('%d.%d.%d.%d',[v1,v2,v3,v4]));end;

你可能感兴趣的:(文件类型)