1

I develop an application, which automates some simple tasks inside Virtual PC. Now I faced with problem: I can't figure out how I can manipulate mouse inside VPC. I do something like this:

HWND hDW = (HWND)0x000B03E0; // handle to virtual machine screen    

int x = 70;
int y = 130;

SendMessage(hDW, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y));
SendMessage(hDW, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(x, y));

SendMessage(hDW, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(x, y));
SendMessage(hDW, WM_RBUTTONUP, MK_RBUTTON, MAKELPARAM(x, y));

But it doesn't work. Can anyone show me how perform this task?

4

1 回答 1

1

这可能是您正在寻找的。

我已经用mouse_input来做你正在寻找的东西,但它似乎已被弃用,你应该改用它SendInput

鼠标输入

发送输入

编辑:

您可以像这样在移动过程中隐藏光标(参考)

SetCrusor( GetCursor() );
ShowCursor(false);
// SendInput()  move mouse do stuff
ShowCursor(true);
于 2010-02-17T16:50:46.970 回答