delphi中怎么打开外部的程序?

来源:百度知道 编辑:UC知道 时间:2024/05/16 18:40:59

使用ShellExecute函数,比如:你要打开一个IE,并浏览www.baidu.com的话:
1.先uses shellapi单元
2.在按钮的OnClick事件中:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Self.handle,'open',PChar('IEXPLORE.EXE'),'http://www.baidu.com','',sw_shownormal);
end;