implementation区里不用 message WM_SYSCOMMAND,并且要加TForm<br><br>Unit Unit2;<br> <br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs;<br><br>type<br> TForm2 = class(TForm)<br> private<br> procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;<br> public<br> end;<br><br>var <br> Form2: TForm2;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm2.WMSysCommand(var Msg: TWMSysCommand);<br>begin<br> if Msg.CmdType = SC_MINIMIZE then <br> Application.Minimize;<br> inherited;<br>end;<br><br>end.