#define MAGIC_TOP_NUMBER 797
void CGsPreviewCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
HWND hWnd = GetParent()->GetSafeHwnd();
RECT rcChild;
::GetWindowRect(GetSafeHwnd(), &rcChild);
::MapWindowPoints(NULL, hWnd, (LPPOINT)&rcChild, 2);
mpAcEdViewCube->onLButtonDown(nFlags, CPoint(point.x, point.y + MAGIC_TOP_NUMBER - (rcChild.bottom - rcChild.top)));
...
}
void CGsPreviewCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
HWND hWnd = GetParent()->GetSafeHwnd();
RECT rcChild;
::GetWindowRect(GetSafeHwnd(), &rcChild);
::MapWindowPoints(NULL, hWnd, (LPPOINT)&rcChild, 2);
mpAcEdViewCube->onLButtonUp(nFlags, CPoint(point.x, point.y + MAGIC_TOP_NUMBER - (rcChild.bottom - rcChild.top)));
...
}
void CGsPreviewCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
HWND hWnd = GetParent()->GetParent()->GetSafeHwnd();
RECT rcChild;
::GetWindowRect(GetSafeHwnd(), &rcChild);
::MapWindowPoints(NULL, hWnd, (LPPOINT)&rcChild, 2);
mpAcEdViewCube->onMouseMove(nFlags, CPoint(point.x, point.y + MAGIC_TOP_NUMBER - (rcChild.bottom - rcChild.top)));
...
}