Form顶部的最大化、最小化所在的地方,Form.Caption显示的地方,它属于窗体部分吗?鼠标的onMouseDown,onClick,onMouseUp,onMouseMove事件都没反应,这一部分有什么相关事件呢?

解决方案 »

  1.   

    WM_NCHITTEST ,WM_NCLBUTTONDOWN,WM_NCLBUTTONDBLCLK
    鼠标移动,单击,双击,在sdk里有详细说明
      

  2.   

    鼠标右击
    private
        { Private declarations }
        procedure WMNCRButtonDown(var Msg : TWMNCRButtonDown); message WM_NCRBUTTONDOWN;procedure TForm1.WMNCRButtonDown(var Msg : TWMNCRButtonDown);
    begin
      if (Msg.HitTest = htCaption) then
      begin
        showmessage('caption');
        Msg.HitTest := 0;
      end
      else if (Msg.HitTest =HTMINBUTTON) then
      begin
        showmessage('minbutton');
        Msg.HitTest := 0;
      end
      else if (Msg.HitTest =HTMAXBUTTON) then
      begin
        showmessage('MAXbutton');
        Msg.HitTest := 0;
      end
      else if (Msg.HitTest = HTCLOSE) then
      begin
        showmessage('close');
        Msg.HitTest := 0;
      end
      else
        inherited;
    end;
      

  3.   

    type
      TForm1 = class(TForm)
      public
        procedure WMEXITSIZEMOVE(var Message: TMessage);
        message WM_EXITSIZEMOVE;
      end;
    var
      Form1: TForm1;implementationprocedure TForm1.WMEXITSIZEMOVE(var Message: TMessage);
    begin
      if self.Top <0 then self.Top := 0;
    end;
      

  4.   

    他不是客户,所以客户区的消息对他不好用,同意lion_lh(xmanx) ( ) 的函数,这些函数用来处理非客户消息的响应