试试下面的;可能不符合你的要求,自己修改一下吧。呵呵。
public
procedure WMNcLButtonDBLClk(var M: TMessage); message WM_NCLBUTTONDBLCLK;
procedure TForm1.WMNcLButtonDBLClk(var M: TMessage);
var
P : TPoint;
CBBtnRect : TRect;
begin
P.X := LOWORD(M.LParam) - Self.Left;
P.Y := HIWORD(M.LParam) - Self.Top;
CBBtnRect := Rect(Self.Left, Self.Top, Self.Left + Self.Width, Self.Top + Self.Height);
if not PtInRect(CBBtnRect, P) then
inherited
else
Self.WindowState := wsMinimized;
end;