本文整理自网络,侵删。
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�⒆执�传入到windows目前窗口cursor所在位置
更多相关阅读请进入《Delphi》频道 >>