参考一个例子:<br>procedure TForm1.CloseVAppClick(Sender: TObject);//标题不确定<br>var ExeHandle:Thandle;<br>begin<br>//获得句柄-->标题不确定<br>ExeHandle:=FindWindow('notepad',nil);//'');//返回句柄<br>//关闭程序<br>if ExeHandle<>0 then<br>SendMessage(ExeHandle,WM_Close,0,0)<br>else<br>Application.MessageBox('没有打开“记事本”程序!','提示',<br>MB_IconInformation+MB_OK);<br>end;<br>