参考一下<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs;<br><br>type<br> TForm1 = class(TForm)<br> procedure WMSYSCOMMAND(var Msg:TWMSYSCOMMAND);<br> message WM_SYSCOMMAND;<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br>procedure TForm1.WMSYSCOMMAND(var Msg:TWMSYSCOMMAND);<br>begin<br> if Msg.CmdType=SC_CLOSE<br> then<br> ShowMessage('不能最小化!!!')<br> //inherited<br> else<br> if Msg.CmdType=SC_MINIMIZE<br> then<br> ShowMessage('不能最小化!!!')<br> else<br> if Msg.CmdType=SC_RESTORE<br> then<br> ShowMessage('不能最小化!!!')<br>end;<br><br>end.