13,825
社区成员
发帖
与我相关
我的任务
分享
//Form1中
//---------------------------------------------------------------------------
void __fastcall TForm1::WndProc(Messages::TMessage &Message)
{
if(Message.Msg==WM_MOVING)
{
RECT *rect;
rect=(RECT*)Message.LParam;
if(Form2!=NULL || !IsZoomed(Form2->Handle))
SetWindowPos(Form2->Handle,NULL, rect->right, rect->top, 0,0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
TForm::WndProc(Message);
}
//---------------------------------------------------------------------------
//Form2中
//---------------------------------------------------------------------------
void __fastcall TForm2::WndProc(Messages::TMessage &Message)
{
if(Message.Msg==WM_MOVING)
{
RECT *rect;
rect=(RECT*)Message.LParam;
if(Form1!=NULL || !IsZoomed(Form1->Handle))
SetWindowPos(Form1->Handle,NULL, rect->left-Form1->Width, rect->top, 0,0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
TForm::WndProc(Message);
}
//---------------------------------------------------------------------------