给你一个例子:可以判断用户按了窗体右上角的三个按钮 procedure WMSysCommand(var msg:TMessage);message WM_SysCommand;//消息载获 procedure TForm1.WMSysCommand(var msg:Tmessage); begin if msg.Wparam=sc_close then ShowMessage('关闭') else if msg.Wparam=sc_maximize then ShowMessage('最大化') else if msg.Wparam=sc_minimize then ShowMessage('最小化'); end;
Delphi自带的帮助里也有,就是什么Win32SDK什么的,里面找WM_SYSCOMMAND,肯定有,还很详细。
procedure TForm1.WMSysCommand(var msg:Tmessage);
begin
if msg.Wparam=sc_close then
ShowMessage('关闭')
else
if msg.Wparam=sc_maximize then
ShowMessage('最大化')
else
if msg.Wparam=sc_minimize then
ShowMessage('最小化');
end;
http://ywbtaxi.home.sohu.com