- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi截获和干扰窗体最小化﹑最大化和关闭消息
type
TForm1 = class(TForm)
......
public
{ Public declarations }
procedure WMSysCommand(var Message: TWMSysCommand);message WM_SYSCOMMAND;
end;
procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
if (Message.CmdType and $FFF0 = SC_MINIMIZE){ or
(Message.CmdType and $FFF0 = SC_CLOSE) or
(Message.CmdType and $FFF0 = SC_MAXIMIZE)} then
Form1.Visible:=False // 隐藏窗体
else
Inherited;
end;
http://blog.chinaunix.net/uid-20564848-id-74477.html