Mouse Move Through A Remote Session

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Mouse Move Through A Remote Session

Post by tommystery » Tue Jul 08, 2008 1:34 am

So I took a break from programming in macroscheduler as I was waiting for my server to arrive which will be running the program (a laptop with a smashed screen; $50 on ebay :D)

And I've run into a problem which makes me somewhat happy that I haven't yet purchased the software.

Sending key functions in a remote session on the host computer works fine, however using the mousemove command does absolutely nothing. Is there a work-around for this?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 08, 2008 7:33 am

Actually the mousemove probably IS working, but the local cursor just isn't being updated. I've seen this in some remote environments. To demonstrate, try running this script:

Code: Select all

MouseMove>200,400

GetCursorPos>X,Y

Dialog>Dialog1
  Caption=Dialog1
  Width=224
  Height=65
  Top=%Y%
  Left=%X%
  Max=0
  Min=0
  Close=1
  Resize=0
  Edit=,0,0,121,
  Edit=msEdit1,0,0,169,Cursor pos is %X%;%Y%
EndDialog>Dialog1

Show>Dialog1,r
If I'm right you'll see the dialog appear at the position that the remote cursor is in. Modify the first MouseMove accordingly.

So your scripts will still work fine. The remote cursor IS moving. But because it wasn't moved by the remote control software (i.e. it wasn't moved by YOU) your local cursor doesn't move.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Tue Jul 08, 2008 8:59 pm

Well, I have loops in my program which move to points on the screen.

ex:
Label>go1
FindImagePos>C:\macrolive\automate\donotword.bmp,SCREEN,0,0,XPos,YPos,NumFound
If>NumFound=0
Goto>go1
Endif
Let>XMove=XPos_0+20
Let>YMove=YPos_0+5
Label>go2
MouseMove>XMove,YMove
GetCursorPos>XC,YC
If>{(%XC%%XMove%) OR (%YC%go2
Endif

The program hangs in this loop, so I'm assuming that the mouse is never moved to the proper co-ordinates. I also don't see the mouse move...

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 08, 2008 9:05 pm

Would you humour me by running the script I posted and tell me what happens? I predict the dialog will appear at the MouseMove position thus proving the remote mouse is moving. Then we can look at why your script is stuck in a loop.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Wed Jul 16, 2008 1:38 am

After finally having time to troubleshoot the problem, I've found that it isn't in fact the mouse which isn't moving but the needle image which isn't being found on the screen.

{Thanks for the test code Marcus}

The problem which occurs is that as soon as I minimize or exit the remote session any screenshots which are taken will just be taken as black. This seems to be a limitation with XP and not your software itself.

Please let me know if you know of a way to make this work. Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jul 16, 2008 4:59 am

When the session is minimized or exited the window station ceases to exist so there is no UI. The only solution is not to minimize or exit it. Leave it open. You can always make it very small and even move it off screen. But don't minimize or exit it. Minimizing a terminal services session does much the same as locking your desktop.

As you say, this is a "feature" of Windows. See:
http://www.mjtnet.com/msfaq171.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Wed Jul 16, 2008 9:47 pm

Hmm.. then is there any way to take control of the 'local' windows session much like you would do through MSN and remote assistance?

I've searched the ineternet for a while but haven't been able to find a way to do it.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts