附件:http://files.cnblogs.com/xe2011/OnMinsize.rar
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls; type TForm1 = class(TForm) TrayIcon1: TTrayIcon; procedure TrayIcon1Click(Sender: TObject); private procedure OnMinsize(var msg: twmsyscommand); message wm_syscommand; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.OnMinsize(var msg: twmsyscommand); begin if msg.CmdType = SC_MINIMIZE then begin // 此处添加对最小化事件的处理过程 Hide(); msg.CmdType := SC_DEFAULT; end; inherited; end; procedure TForm1.TrayIcon1Click(Sender: TObject); begin Visible := not Visible; end; end.