Article ID: 141357
Article Last Modified on 10/24/2003
// Method one
// Check by timestamp of messages
void CMyView::OnMouseMove(UINT, CPoint point)
{
...
static DWORD lastTime = 0;
if (lastTime > GetCurrentMessage()->time)
return; // discard message
else
lastTime = GetCurrentMessage()->time;
// process message
}
// Method two
// Use native MacOS calls to track mouse movements
#ifdef _MAC
#include <macname1.h>
#include <Types.h>
#include <Events.h>
#include <macname2.h>
#endif
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
#ifdef _MAC
Point macPt; // Mac specific data type
CPoint winPt; // temp Windows Point var
while(StillDown()) {
GetMouse(&macPt); // Get GLOBAL mouse coordinates
winPt.x = macPt.h; // Convert to windows struct
winPt.y = macPt.v;
ScreenToClient(&winPt); // Convert to Client Coordinates
TRACE("Where? (%d,%d)\n", winPt.x, winPt.y);
}
#else
CView::OnLButtonDown(nFlags, point);
#endif
}
Keywords: kbbug kbfix kbuidesign KB141357