请问各位同仁,如何关闭SHELLEXECUTE()打开的应用程序。

airenlong 2003-09-12 11:30:46
比如

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(handle,'open',‘c:\bz.exe','nil','nil',SW_SHOWNORMAL);
end;
现在希望在关闭FORM1时,或关闭FORM1所在的工程时,C:\BZ.EXE 能够自动关闭。
...全文
109 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
gold_future 2003-09-12
  • 打赏
  • 举报
回复
To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
///////////////////////////////////////////
WINSHELLAPI BOOL WINAPI ShellExecuteEx(
LPSHELLEXECUTEINFO lpExecInfo
);

Performs an action on a file.

Returns a nonzero value if successful, or zero otherwise. To get extended error information, call theGetLastError function.
lpExecInfo
Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed.
If the function succeeds, it sets the hInstApp member of the SHELLEXECUTEINFO structure to the instance handle to the application that the function started. If the function fails, hInstApp is one of the SE_ERR_ error values indicating the cause of the failure. (An instance handle will always be greater than 32 and an error value less than 32.) Note that the SE_ERR_ error values are for compatibility with the ShellExecute function; use theGetLastError function to retrieve error information.



airenlong 2003-09-12
  • 打赏
  • 举报
回复
gold_future(金色未来)
同志:稍微给点中文解释吗,我有点菜啊,仿佛已经看到正确答案了,麻烦了

2,496

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧