获取鼠标划过的控件指针,并发此控件发送消息
TControl *CaptureControl;
TPoint P;
GetCursorPos(&P);
TControl* Result = FindDragTarget(P, true);
CaptureControl = GetCaptureControl();
if (FMouseControl != Result)
{
if (((FMouseControl != NULL) && (CaptureControl == NULL)) ||
((CaptureControl != NULL) && (FMouseControl == CaptureControl)))
{
FMouseControl->Perform(CM_MOUSELEAVE, 0, 0);
}
FMouseControl = Result;
if (((FMouseControl != NULL) && (CaptureControl == NULL)) ||
((CaptureControl != NULL) && (FMouseControl == CaptureControl)))
{
FMouseControl->Perform(CM_MOUSEENTER, 0, 0);
}
}