WM_SYSCOMMAND是TWinControl的消息,因为只有Win控件才需要处理系统命令消息嘛!

procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND; //在Public部分声明

procedure TForm1.WMSysCommand; 
begin 
if (Msg.CmdType = SC_MINIMIZE) then 
begin 
// 最小化消息 
end 
else if (Msg.CmdType = SC_MAXIMIZE) then 
begin 
// 最大化消息 
end 
else if (Msg.CmdType = SC_RESTORE) then 
begin 
// 还原消息 
end; 
DefaultHandler(Msg);// 默认处理 fixme 这样写似乎错误,应该使用inherited;
end;   
// 屏蔽关闭消息
procedure TForm1.WMSysCommand(var Msg: TMessage);
begin
if Msg.wParam <> SC_CLOSE then
inherited;
end;

其它用法,很清楚的列表:
http://www.cnblogs.com/del/category/134064.html

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-05-27
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案