[Delphi之未经证实的葵花宝典version 2.5]
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DragMove = $F012; { a magic number }
begin
ReleaseCapture;
panel1.perform(WM_SysCommand, SC_DragMove, 0);
end;
/////////////////////////////////////////////
procedure TForm1.Button1MouseDown(Sender: TObject; Button:
TMouseButton; Shift: TShiftState; X, Y: Integer);
{$IFNDEF WIN32}
var
pt : TPoint;
{$ENDIF}
begin
if ssCtrl in Shift then begin
ReleaseCapture;
SendMessage(Button1.Handle, WM_SYSCOMMAND, 61458, 0);
{$IFNDEF WIN32}
GetCursorPos(pt);
SendMessage(Button1.Handle,
WM_LBUTTONUP,
MK_CONTROL,
Longint(pt));
{$ENDIF}
end;
end;