A程序利用ShellExecute調用B.exe和C.exe,那麼如何實現當A退出的時候B、C也同時關閉!!!
解决方案 »
- 如何清除Combobox的所有元素。
- dll动态调用dll传参数的问题
- 在Edit中怎样将光标定位文本的最后?
- 请问哪有Rave的使用介绍?
- 请问actionManger、actionmainmenubar,actiontoolbar怎么用呀?
- 传统三层MIDAS客户端怎么向ACTIVEFORM转换? 急用!! 谢谢!
- 能否把NMFTP控件下载下来的图片文件直接保存到内存?
- 请大家一定帮帮我,谢谢……我只有77分,关于ListView的问题!!!!!!
- 最近正在研究Smart Card,谁有读写卡的例子,我的读卡器是Alcor Micro的?
- 高手请教:如何实现VB的new的功能?
- 大家看看,给个思路!
- TList能释放所有类型的对象吗?
var
hPreWnd:HWND;
begin
hPreWnd:=FindWindow(PChar(AClass),PChar(ACaption));
if hPreWnd<>0 then
PostMessage(hPreWnd,WM_QUIT,0,0);
end;//AClass是类名,ACaption是标题 MClossWindow('这是A程序的主窗口类名如TForm1','这是A程序的主窗口标题');
lppe:tprocessentry32;
sshandle:thandle;
hh:hwnd;
found:boolean;
begin
sshandle:=createtoolhelp32snapshot(TH32CS_SNAPALL,0);
found:=process32first(sshandle,lppe);
while found do
begin
if uppercase(extractfilename(lppe.szExeFile))='PROJECT2.EXE' then
begin
hh:=OpenProcess(PROCESS_ALL_ACCESS,true,lppe.th32ProcessID);
TerminateProcess(hh,0);
end;
found:=process32next(sshandle,lppe);
end;
end;