Link to home
Start Free TrialLog in
Avatar of omnipower321
omnipower321Flag for United States of America

asked on

Track mouse click from PowerShell

Hello,

I am able to track mouse X and Y coords within PowerShell by using the [System.Windows.Forms.Cursor]::Position assembely.  This can track X and Y coords outside of the PowerShell session.

Is there anyway to track the mouse click event, regardless of what is being clicked?  Ultimately I am looking to track X & Y at time of mouse click anywhere in the OS.

Thank you for any info.
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

kinda tricky but finally i found a tweak, what you do is using VBCodeProvider to run vb.net code which perform the low-level mouse hooking.

check this post as an example of low-level keyboard hooking via powershell:
http://waynes-world-it.blogspot.com/2008/06/powershell-low-level-keyboard-hook.html



ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of omnipower321

ASKER

Yikes, I think this is a bit out of my league, but I will attempt to decipher.  Thanks!