title: Moving a caption-less window by using a "drag area"
body: <p>I would like to have my own caption bar and therefore I am using basically a panel (Name: pnCaption) and remove the original caption bar in CreateParams. But the ability to move the window by MouseDown-MouseMove in the new panel is a problem.</p>
  
  <p>Normally you would use the NCHITTEST message. BUT this isn't signaled if the mouse is over the panel (my own caption).  See code ...</p>
  
  <pre><code>procedure TForm1.CreateParams(var params: TCreateParams);  
  begin  
    inherited Createparams(Params);  
    with Params do  
      Style := (Style or WS_POPUP) and (not WS_DLGFRAME);  
  end;  
  
  procedure TForm1.WM_NCHitTest(var Msg: TWMNcHitTest);  
  begin  
    inherited;  
    if PtInRect(pnCaption.BoundsRect, ScreenToClient(Point(Msg.XPos, Msg.YPos)))  
        then Msg.Result := HTCAPTION;  
  end;  
  </code></pre>
  
  <p>I would appreciate any hints how to accomplish that task.</p>
  
  <p>Christian</p>