type <br>TForm1 = class(TForm) <br>private <br>{ Private declarations } <br>procedure WMSysCommand(var Msg: TWMSysCommand); <br>message WM_SYSCOMMAND; <br>public <br>{ Public declarations } <br>end; <br><br>var <br>Form1: TForm1; <br><br>implementation <br><br>{$R *.DFM} <br><br>procedure TForm1.WMSysCommand; <br>begin <br>if (Msg.CmdType = SC_MINIMIZE) or <br>(Msg.CmdType = SC_MAXIMIZE) then <br>MessageBeep(0) //写你要处理的代码<br> else <br>inherited; <br>end