调用外部可执行*.exe文件的问题(20分)

D

dql_77

Unregistered / Unconfirmed
GUEST, unregistred user!
请问各位老师,怎样在delphi中调用外部exe文件,
例如:有一控件bibit1,按该控件就调用new.exe可执行文件。
请问代码如何写。谢谢!!
 
WinExeC(PChar(程序名 包含路径),0);
 
使用winexec
 
tianjh007,说的比我细,就是那样
 
procedure TFormContent.SpeedButtonAdd_LINK_URLClick(Sender: TObject);
var
LINK_URLParam : PChar ;
begin
//Screen.Cursor := StartCursor;
LINK_URLParam := PChar('www.sohu.com.cn');
ShellExecute(FormContent.Handle, 'Open', LINK_URLParam, '', '', SW_MAXIMIZE);
//Screen.Cursor := EndCursor;
end;

ShellExecute试最好的办法,
在Uses中加入ShellAPI单元
 
procedure TForm1.Button3Click(Sender: TObject);
begin
shellexecute(handle, 'open', 'XXXX.exe', NiL, NiL, SW_SHOWNORMAL);
end;
執行當前目錄下的exe文件
 
顶部