procedure TForm1.Button1Click(Sender: TObject); var HWndCalculator : HWnd;begin HWndCalculator := FindWindow(nil, '计算器'); // 查找计算器句柄 if HWndCalculator <> 0 then SendMessage(HWndCalculator, WM_CLOSE, 0, 0); //关闭计算器end;