本文整理自网络,侵删。
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 xe android的所有权限按照分类总结说明
Delphi indy 组件包里的 idhttp 组件使用 get 方法下载文件限速的方法
Delphi 辨析 field、fielddef、fields、fielddefs、fieldlist、fielddeflist
更多相关阅读请进入《Delphi》频道 >>