Sign in to follow this  
Followers 0
ss26

Mouse doesn't interact with window (send command either)

3 posts in this topic

#1 ·  Posted (edited)

G'Day,

I needed to automate one of those 'problem' applications. I guess it is similar to that which is mentioned by OP >here (mouse doesn't work).

Even custom mouse functions by Zedna didn't help me. I was ready to give up on automating app with Autoit but then i found some kind of workaround on Stackoverflow - run Autoit script with admin privileges.

And that is a solution (it is strange because UAC is disabled here). Nevertheless, i wanted to underline possible solution with "mouse problems" and send key problems, too:

1. Run script as admin

2. Use Zedna's custom functions (for mouse events):

Try these my functions (instead of MouseClick/MouseMove):
 

Func _MouseClickFast($x, $y)
    $x = $x*65535/@DesktopWidth
    $y = $y*65535/@DesktopHeight

    _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), $x, $y)
    _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTDOWN), $x, $y)
    _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTUP), $x, $y)
EndFunc

Func _MouseMoveFast($x, $y)
    $x = $x*65535/@DesktopWidth
    $y = $y*65535/@DesktopHeight

    _WinAPI_Mouse_Event(BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), $x, $y)
EndFunc

 

 

May be of some help for those who will struggle for days to make mouse or keyboard work in some applications.

PS: Thanks to Zedna for his custom mouse functions, without this code i was not able to make it work.

Edited by ss26

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

However, this is not the case here. App is launched without admin rights. But it cannot be controled by Autoit unless Autoit script is run with admin rights.

edit: In fact i just noticed Windows shield (sign of elevated priviliges) on app shortcut (despite shortcut is not configured to "run as admin"). Seems like JohnOne is right.

Edited by ss26

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  
Followers 0