Delphi获取文件版本号

| |
[不指定 2009/04/10 23:16 | by 袁旭东 ]
  曾经在写的一个程序里面用到过,今天又用到了,顺便写在这里。
引用
procedure TfrmMain.FormShow(Sender: TObject);
var
   BufSize, Len: DWORD;
   Buf, Value: PChar;
begin
   BufSize := GetFileVersionInfoSize(PChar(Application.ExeName), BufSize);
   if BufSize > 0 then
   begin
      Buf := AllocMem(BufSize);
      GetFileVersionInfo(PChar(Application.ExeName), 0, BufSize, Buf);
      if VerQueryValue(Buf, PChar('StringFileInfo\080403A8\ProductVersion'), Pointer(Value), Len) then
         Self.Caption := Self.Caption + ' ' + Value;
   end;
   Application.Title := Self.Caption;
end;

Tags:
纯技术分类 » C/C++/Delphi | 评论(0) | 引用(0) | 阅读(1169)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]