给你一个我自己写的一个程序片段<br>Procedure WMSysCommand(var msg1 : TMessage) ; message WM_SYSCOMMAND ;<br><br>procedure TForm1.WMSysCommand(var msg1: TMessage);<br>begin<br> if msg1.WParam =SC_MINIMIZE then<br> begin<br> form1.hide;<br> shell_NotifyIcon(NIM_ADD,@tray);<br> end<br> else DefWindowProc <br> (form1.Handle,WM_SYSCOMMAND,msg1.wparam,msg1.LParam);<br>end;<br>