|
|||||||
|
|
|
|||||
|
|
|||||||
VC++ (MFC) Tips : Mouse and Cursor
Key Functions: SetCapture(); // Causes all subsequent mouse input to be sent to the current CWnd object regardless of the position of the cursor
SetCapture();
//other codes
ReleaseCapture(); //release mouse cursor
Key Functions: ClipCursor(&rect);
RECT rect;
GetClientRect(&rect); // Copies the client coordinates of the CWnd client area into the structure pointed to by lpRect.
ClientToScreen(&rect); // Converts the client coordinates of a given point or rectangle on the display to screen coordinates.
ClipCursor(&rect); // The cursor is a shared resource. If this parameter is NULL, the cursor is free to move anywhere on the screen.
//other codes
ClipCursor(NULL); //release mouse cursor
Copyright (c) 1999 - 2001, robert han, all rigths are reserved.