Reputation: 191
How does one read the current position of mouse in windows using C++ ?
I want to access the the raw data from mouse and display the coordinates.
Upvotes: 0
Views: 114
Reputation: 741
Using the Windows API, you could GetCursorPos(). I can't compile the code right now to test it, but it should work out something like this:
POINT cursor;
if (GetCursorPos(&cursor)) {
// Print out cursor.x and cursor.y
}
I'm sure you've done this, but be sure to include windows.h
.
Upvotes: 2