How to move mouse with c++

后端 未结 2 1244
独厮守ぢ
独厮守ぢ 2021-02-10 14:11

I want to move the mouse cursor with a c++ script. I am using Visual C++ 2010 Express in a Windows 7 inside Parallels and I created a console application.

I know SetCurs

相关标签:
2条回答
  • 2021-02-10 14:50

    I found the problem. It turns out Parallels has a feature called Smart Mouse that allows you move freely between OSX and Windows. Once I deactivated it, mouse moved as expected.

    0 讨论(0)
  • 2021-02-10 14:59

    This happens in Parallels because of SmartMouse is On or on Auto. In order for a program in Parallels VM to control the mouse with SetCursorPos you need to hide cursor first. You can do that with ShowCursor(0); before you do any mouse movement e.g. SetCursorPos. Now you will be able to control the mouse while SmartMouse is set to Auto or Off.

    0 讨论(0)
提交回复
热议问题