zoukankan      html  css  js  c++  java
  • delphi内取文件版本信息

    unit UVersionInfo;

    interface

    uses Windows, SysUtils;

    function GetVersionValue(FileName,QueryName:
    string):String;

    implementation

    function GetVersionValue(FileName,QueryName:
    string):String;
    var
      InfoSize, Wnd: DWORD;
      VerBuf: Pointer;
      szName: array[
    0..255] of Char;
      Value: Pointer;
      Len: UINT;
      TransString:
    string;
    begin
      InfoSize :
    = GetFileVersionInfoSize(PChar(FileName), Wnd);
      
    if InfoSize <> 0 then
      begin
        GetMem(VerBuf, InfoSize);
        
    try
          if GetFileVersionInfo(PChar(FileName), Wnd, InfoSize, VerBuf) then
          begin
            Value :
    =nil;
            VerQueryValue(VerBuf, 
    'VarFileInfoTranslation', Value, Len);
            
    if Value <> nil then
               TransString :
    = IntToHex(MakeLong(HiWord(Longint(Value^)), LoWord(Longint(Value^))), 8);
            Result :
    = '';
            StrPCopy(szName, 
    'StringFileInfo'+Transstring+''+QueryName);
            if VerQueryValue(VerBuf, szName, Value, Len) then
               Result :
    = StrPas(PChar(Value));
          end;
        
    finally
          FreeMem(VerBuf);
        end;
      end;
    end;

    end.

  • 相关阅读:
    THINKPHP3.2视频教程
    PHPCMS 学习
    PHPCMS 后台学习
    phpcms 模板学习
    二叉树的创建与遍历(链式存储)
    MySQL基础~~增、删、改、简单查
    队列的基本操作(链队列)
    MySQL基础~~表结构操作
    行编辑程序
    循环链表的基本操作
  • 原文地址:https://www.cnblogs.com/martian6125/p/9631495.html
Copyright © 2011-2022 走看看