procedure TForm1.Button1Click(Sender: TObject);<br>var<br> HWndCalculator : HWnd;<br>begin<br>// find the exist calculator window<br> HWndCalculator := FindWindow(nil, 'Form.Caption'); // close the exist Calculator<br> if HWndCalculator<>0 then<br> PostMessage(HWndCalculator, WM_CLOSE, 0, 0);<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> form2.Show;<br>end;