Jump to content
Sign in to follow this  

MouseClick to Virtual Machine

Recommended Posts


I've had a look in the forums but I cant seem to solve this issue that I'm having....

Is there a way to send mouseclicks to a VM running on your machine. I've been using Autoit in a VirtualBox Win 7 machine on OSX and no joy. I've also tested on a Windows 7 Machine with VMware Player.

Any hints or tips? Thanks guys.

EDIT: Just to clarify. I have a script that I want to run solely in a VM and provide mouseclicks in the VM only so no interaction at all with the host machine

Edited by jamesjimartin

Share this post

Link to post
Share on other sites

as far as i know autoit inside Virtual PC dont have problems with XP as its OS. Don't know about win 7 version or any version on VMware

edit: just quick note that Virtual PC is name of program http://www.microsoft.com/windows/virtual-pc/support/virtual-pc-2007.aspx so that i don't get confused

if your using win7 as primary OS then please read http://www.microsoft.com/windows/virtual-pc/download.aspx but i don't think there will be any problems of installing old Virtual PC 2007 on win 7 and running XP on it.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


Share this post

Link to post
Share on other sites

I'll try Installing XP tonight as the Virtual Machine OS and see if that works okay. Will get back with more details later.

Share this post

Link to post
Share on other sites

I'm running Windows 7 in a VirtualBox on Ubuntu.

The following script shows the correct result even if the mouse isn't controlled by the VM.

MouseMove(10, 100)
MsgBox(0, "Test 1: Mouse position", "x: " & MouseGetPos(0) & @CRLF & "y: " & MouseGetPos(1))
MouseMove(700, 700, 0)
MsgBox(0, "Test 2: Mouse position", "x: " & MouseGetPos(0) & @CRLF & "y: " & MouseGetPos(1))

When using VirtualBox you can specify if the keyboard and mouse are "captured". For the mouse you have to activate "Mouse integration" and the mouse will be moved.

Edited by water

My UDFs and Tutorials:


Active Directory (NEW 2017-04-18 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version - Download - General Help & Support

ADO - Wiki


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.