procedure TForm1.FormCreate(Sender: TObject); begin Application.OnMessage:=AppMessage; end;
procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean); begin //(GetKeyState(vk_CONTROL) < 0) if (Msg.message=WM_LButtonDown) and (DefWindowProc(Handle,WM_NCHitTest, 0,GetMessagePos)=HTClient) and (True) then begin SendMessage(Handle,WM_NCLButtonDown, HTCaption,GetMessagePos); //发送鼠标在标题栏内按下的消息 Handled:=true; end; end;