开发者

How to get the cursor position [duplicate]

This question already has answers here: Get current cursor position (2 answers) Closed 6 years ago.

I want to know how to get the cursor position on Windows in c++,

Reasons: I try to move the mouse position on X Y coordinate with the screen information

e.g: i want to set the mouse position in the offset x:576 y:854 on the screen.

The only method that I found for do that is:

mouse_event(MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE|MOUSEEVENTF_LEFTDOWN,x,y,0,开发者_开发百科0);

Normally the flag MOUSEEVENTF_ABSOLUTE is to do that but it doesn't work, that's why i try to get the absolute position of the mouse and try to calculate that !

Thank you for your answer !


Try GetCursorPos().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜