Two ways come to mind; you can call GetCursorPos, which is part of the WinAPI, or you can check for WM_MOUSEMOVE in your message loop and pick up the position from lParam.