Delphi 如何使用程序标识符检查程序是否已安装


本文整理自网络,侵删。

 

如果安装了给定程序ID的程序并在系统中注册,则以下代码将返回True;否则,则返回False。

uses  System.Win.ComObj,ActiveX;

 {
 Access.Application
Excel.Application
FrontPage.Application
Outlook.Application
PowerPoint.Application
MSProject.Application
Word.Application
//delphitop.com
}

function ProgIDInstalled(const PID: string): Boolean;
var
  WPID: WideString;  // PID as wide string
  Dummy: TGUID;      // unused out value from CLSIDFromProgID function
begin
  WPID := PID;
  Result := ActiveX.Succeeded(ActiveX.CLSIDFromProgID(PWideChar(WPID), Dummy)
  );
end;

function IsIEInstalled: Boolean;
begin
  Result := ProgIDInstalled('FrontPage.Application');
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
if IsIEInstalled then
begin
  memo1.Lines.Add('FrontPage已安装');
  end
  else
  begin
   memo1.Lines.Add('FrontPage没安装');
end;
end;

相关阅读 >>

Delphi 屏幕截屏

Delphi 判断系统服务是否运行

Delphi wm_copydata 用法

Delphi with do和for do语句

Delphi使用idhttp模拟提交页面方法总结

Delphi 判断一个数组的长度用 length 还是 sizeof ?

Delphi判断ip地址是否正确

Delphi 检测文件数字签名

Delphi 隐藏进程的单元 unit hideprocess.pas

Delphi win7下超级管理员创建普通权限任务

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...