如何得到OCX的版本号 本人安装了一个MediaPlayer6的控件,请问如何在Delphi里面得到这个OCX控件的版本号,如6.4.0.53的。 希望各位能指点一二,谢谢了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 API函数GetFileVersionInfo可以得到————————————————————————————————————宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。———————————————————————————————————— function GetVisionInfo(aFileName:string = ''):string;--------------function TForm1.GetVisionInfo(aFileName: string): string;const SFInfo = '\StringFileInfo\';var strSelFile: string; InfoSize, Size: DWord; VersionInfo, Pt: Pointer; VersionValue: string; Translation: Pointer;begin Size := 0; if aFileName='' then strSelFile := Application.ExeName else strSelFile := aFileName; InfoSize := GetFileVersionInfoSize(PChar(strSelFile), Size); if InfoSize > 0 then begin GetMem(VersionInfo, InfoSize); try GetFileVersionInfo(PChar(strSelFile), 0, InfoSize, VersionInfo); VerQueryValue(VersionInfo, '\VarFileInfo\Translation', Translation, InfoSize); VersionValue := SFInfo + IntToHex(LoWord(Longint(Translation^)), 4) + IntToHex(HiWord(Longint(Translation^)), 4) + '\'; //文件版本 if VerQueryValue(VersionInfo, pchar(VersionValue + 'FileVersion'), Pt, InfoSize) then Result := string(pchar(Pt)); finally FreeMem(VersionInfo); end; end;end;-------procedure TForm1.Button5Click(Sender: TObject);var FileVersion: string;begin FileVersion := GetVisionInfo('test.dll'); showmessage(FileVersion);end; 有关dll的一个小问题,,,, ★★★★求日期函数 类似于Sql中的DATEADD BMP转换成 emf或 wmf格式???????????? 想找个CSDN上的朋友,帮忙测下UDP的即时通讯 第11题): 毕业设计救命?需要大家技术帮助!先谢啦! fastreprt4 中怎么处理被除数为0的情况。 Borland怎么了? 高手们能说说我写的哪错了呀 关于全局变量的问题 哪里有李维的书下载! 用MsComm控件时语句的写法 急需InfoPower 4000的下载地址和密码!
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
--------------
function TForm1.GetVisionInfo(aFileName: string): string;
const
SFInfo = '\StringFileInfo\';
var
strSelFile: string;
InfoSize, Size: DWord;
VersionInfo, Pt: Pointer;
VersionValue: string;
Translation: Pointer;
begin Size := 0; if aFileName='' then
strSelFile := Application.ExeName
else
strSelFile := aFileName; InfoSize := GetFileVersionInfoSize(PChar(strSelFile), Size); if InfoSize > 0 then
begin
GetMem(VersionInfo, InfoSize); try
GetFileVersionInfo(PChar(strSelFile), 0, InfoSize, VersionInfo); VerQueryValue(VersionInfo, '\VarFileInfo\Translation', Translation, InfoSize);
VersionValue := SFInfo + IntToHex(LoWord(Longint(Translation^)), 4) +
IntToHex(HiWord(Longint(Translation^)), 4) + '\';
//文件版本
if VerQueryValue(VersionInfo, pchar(VersionValue + 'FileVersion'), Pt, InfoSize) then
Result := string(pchar(Pt));
finally
FreeMem(VersionInfo);
end;
end;
end;
-------
procedure TForm1.Button5Click(Sender: TObject);
var
FileVersion: string;
begin
FileVersion := GetVisionInfo('test.dll');
showmessage(FileVersion);
end;