一个小问题,不太好用简短的话描述,麻烦大家进来看看,指点一下。 最近在做程序时遇到一个问题,已简化如下:做了一个窗体Form1,窗体上有一个按钮Button1。现在想达到这样的效果:单击该按钮后,实现打开(即双击)d:\test\test.exe的效果(该文件是我为了描述问题假想的一个可执行文件)。我不知这该怎么实现,也不知道怎样用简短的话描述这一问题,所以也查不到相关资料。请各位帮帮忙,谢谢了!!想多给点分的,可惜可用分只有这些了,请各位见量。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ShellExecute(Application.MainForm.Handle, nil, FileName, '', FilePath, SW_Show) procedure TForm1.Button1Click(Sender: TObject);begin ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show);end; 记得包含ShellAPI单元,即Uses里加ShellAPI。 Uses ShellAPI;ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show); 用winexec也可以实现winexec(PChar('d:\test\test.exe'), SW_SHOWNORMAL); Uses ShellAPI;ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show); 包含ShellAPI单元,即Uses里加ShellAPI。Uses ShellAPI;ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show); winexec(PChar('d:\test\test.exe'), SW_SHOWNORMAL); ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show); TreeView 使用方法。连接access数据库。。。 急! 寻C++、Delphi双修高手(10.01.14) 问1个有关DBGrid控件的问题 Delphi中对清华深讯短信路由 cmpp2.0的开发(救命)!!! 关于easygrid的问题,很简单(但是我是新手)[给50分] 隐藏的控件怎么让它显示出来 救命呀!!!窗体不能显示了:( 用Install Shield建立别名时如何设置路径 服务器程序是什么东西??? 我是新手,help me!! 在cxgrid中如何不显示已经连接上的表中的已有的数据,用的是dbexpress? 我想做个自动更新管理软件,请教大家!
begin
ShellExecute(handle, 'open', PChar('d:\test\test.exe'), nil, nil, sw_show);
end;
winexec(PChar('d:\test\test.exe'), SW_SHOWNORMAL);