Delphi 不重复运行外部程序exe


本文整理自网络,侵删。

 

procedure RunSysExe(const exeprocessname: String;exeTitle:String);
var  //引用单元shellapi
  OFile:String;
  HWndCalculator:HWnd;
begin
  HWndCalculator:=FindWindow(nil,pwidechar(exeTitle));
  if (HWndCalculator=0) then
  begin
    OFile:=exeprocessname;
    Shellexecute(application.handle,'Open',pchar(OFile),nil,pchar(ExtractFilePath(OFile)),SW_SHOWNORMAL);
  end;
end;


用法:RunSysExe('calc.exe','计算器');

相关阅读 >>

Delphi base32 的加密和解密

Delphi文件是否正在使用

Delphi绘制标题栏

Delphi 检测应用程序是否已停止响应

Delphi 让"显示桌面"功能对你的窗口无效

Delphi copy 从字符串中复制指定范围中的字符

Delphi中判断字符串是否为数字

Delphi xe android的所有权限按照分类总结说明

Delphi indy 组件包里的 idhttp 组件使用 get 方法下载文件限速的方法

Delphi 辨析 field、fielddef、fields、fielddefs、fieldlist、fielddeflist

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



打赏

取消

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

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

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

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

评论

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