Quantcast
Channel: Windows Wide Open
Viewing all articles
Browse latest Browse all 3110

Reading the mouse position of a Hyper-V VM

$
0
0

Last week I showed you how to automate setting the mouse position in a virtual machine.  You can also read the current position of the mouse cursor using this code:

$VMName = “Windows 10 Enterprise”
$VMCS = Get-WmiObject -Namespace rootvirtualizationv2 -Class Msvm_ComputerSystem -Filter “ElementName=’$($VMName)'”
$mouse = $VMCS.GetRelated(“Msvm_SyntheticMouse”)
$mouse.HorizontalPosition
$mouse.VerticalPosition

Cheers,
Ben

The post Reading the mouse position of a Hyper-V VM appeared first on Windows Wide Open.


Viewing all articles
Browse latest Browse all 3110

Trending Articles