delphi内取文件版本信息
来源:互联网 发布:mac os如何切换输入法 编辑:程序博客网 时间:2024/05/15 23:47
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.
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.
- delphi内取文件版本信息
- Delphi 取JPG图片内的Exif信息
- Delphi 取JPG图片内的Exif信息
- Delphi 获取文件的版本等信息
- 内存中取PE文件版本信息
- delphi获取Exe文件版本信息的函数[转]
- delphi 获取Exe或DLL的文件版本信息
- Delphi 取Jpg图片内的Exif信息(需要GDI Plus)
- delphi 取文件版本号
- VC取程序版本信息
- Delphi 开发 ArcGis 取坐标信息
- 获取文件版本信息
- 获取文件版本信息
- 获取文件版本信息
- 获得文件版本信息
- vc 取windows系统信息 版本 cpu信息 内存信息 ie版本信息 office版本
- vc 取windows系统信息 版本 cpu信息 内存信息 ie版本信息 office版本
- SHGetFileInfo取windows文件信息
- FlashMX2004精彩特效:网格式复制
- 优化的一个编程题:123456789九个数组成三行三列撇捺等于15 2007-4-9
- 组件封装为mxp文件的方法
- 第十七届全国青年招聘大会无锡分会场
- Flash 缓存问题的解决
- delphi内取文件版本信息
- CSS图象滤镜之实用版
- php怎样实现转向页面?就像asp里面的response.redirect一样
- Nokia的J2ME文档
- 改变Jtree节点的图标
- 继续努力
- window.location方法获取URL各部分
- C语言运算符的“优先级口诀”
- C语言学习笔记-scanf