void __fastcall TForm1::Button2Click(TObject *Sender)<br>{<br> HWND temp;<br> temp=FindWindow(NULL,"Project1");<br> if (temp) SendMessage(temp,WM_KEWDOWN,VK_F3,0);//没反应 ???<br> else ShowMessage("找不到指定的窗口");<br>}<br>//---------------------------------------------------------------------------<br>void __fastcall TForm1::Button3Click(TObject *Sender)<br>{<br> HWND temp;<br> temp=FindWindow(NULL,"Project1");<br> if (temp) SendMessage(temp,WM_CLOSE,0,0);<br> else ShowMessage("找不到指定的窗口");//程序关闭<br><br><br>}