The IDirectDrawSurface7::GetClipper method retrieves the DirectDrawClipper object associated with this surface and increments the reference count of the returned clipper.HRESULT GetClipper( LPDIRECTDRAWCLIPPER FAR *lplpDDClipper );please search msdn yourself
up
详细:
CRect clientrect;
GetClientRect(clientrect);
//clientrect就保存了你要得数
用LPtoDP()得到客户区坐标,ClientToScreen得到屏幕坐标。
GetCursorPos(&pt);
LPDIRECTDRAWCLIPPER FAR *lplpDDClipper
);please search msdn yourself
我将InitInstance中创建的HWND保存在一个全局变量中,然后在需要他时调用这些API,请问我这时应该怎么做?////////////////////////////////////////////////////不必,在用时可以用AfxGetInstanceHandle()得到帖出你的问题代码!
point.y = g_pMouse->GetY();
GetClientRect(g_hWnd, &r);
point.x = point.x-r.left;
point.y = point.y-r.top;g_pMouse->GetX()得到的是相对于屏幕的坐标,我想做的事情是将其转化为相对于窗口的坐标,r的类型是RECT,g_hWnd就是那个全局变量。
RECT Rect;
::GetClientClient(hWnd, &Rect);
::MapWindowPoints(hWnd, NULL, (POINT*)&Rect, 2);