SendMessage 关闭计算器_2

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




你可能感兴趣的:(message)