点击客户区也能拖动窗口

procedure WmNCHitTest(var Msg: TWMNCHitTest); message WM_NCHitTest;

procedure TForm1.WmNCHitTest(var Msg: TWMNCHitTest);
begin
DefaultHandler(Msg);
if Msg.Result = HTClient then
   Msg.Result := HTCaption;
end;

你可能感兴趣的:(窗口)