Delphi window losing focus after custom drag
问题 I've got this code that moves my Main Window around when I drag around MyThingThatDragsIt procedure TMainForm.ApplicationMessage(var Msg: TMsg; var Handled: Boolean); var ScreenPt : TPoint; DragControl : TControl; begin inherited; if Msg.message = WM_LBUTTONDOWN then begin ScreenPt := ScreenToClient(Msg.pt); DragControl := FindDragTarget(Msg.pt , false); if Assigned(DragControl) and ((DragControl = MyThingThatDragsIt) ) then begin ReleaseCapture; self.Perform(WM_SYSCOMMAND, SC_MOVE or $0002,