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 fmx中获取窗口比例

Delphi webbrowser 实用代码收集

Delphi 从记事本导入记录

Delphi�⒆执�传入到windows目前窗口cursor所在位置

Delphi使用sqlite数据库时的中文路径问题

Delphi 数字转换成中文

Delphi winsock downloader

Delphi中的字符串

Delphi 串口控制继电器

Delphi xe版本 运行cmd命令,并取得输出字符

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



打赏

取消

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

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

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

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

评论

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