Community discussion forum

Simulating User Actions

This is a comment thread discussing Simulating User Actions
  • 10 years ago

    This thread is for discussions of Simulating User Actions.

  • 6 years ago

    I wan to to do this but with a captionless button on crystal reports preview windows to force click event search button

  • 5 years ago

    Many many thanks for this.


    I had found something somewhere else on calling API procedures but couldn't get it to work.


    I had been searching for ages for something like this and am very grateful for it.


    I was trying to create something in Excel that does a screen scrape of a payments system developed in-house, but one of the pages that contained the info I needed called for a right mouse click with no shortcut-key.  Another thing required a mouse-click into a field that had neither an accelerator nor was it a tab-stop.  So emulating a mouse move and click was the only thing I could do.


    Oh the possibilities!  


  • 5 years ago

    I can't make it work.
    I'm using this code:

    Code:
    Private Sub tMover_Timer()
       Select Case tMover.Tag
       Case 0
           MoveMouse GetCurrentX + 10, GetCurrentY
           tMover.Tag = 1
       Case 1
           MoveMouse GetCurrentX + 10, GetCurrentY + 10
           tMover.Tag = 2
       Case 2
           MoveMouse GetCurrentX, GetCurrentY + 10
           tMover.Tag = 3
       Case 3
           MoveMouse GetCurrentX - 10, GetCurrentY + 10
           tMover.Tag = 4
       Case 4
           MoveMouse GetCurrentX - 10, GetCurrentY
           tMover.Tag = 5
       Case 5
           MoveMouse GetCurrentX - 10, GetCurrentY - 10
           tMover.Tag = 6
       Case 6
           MoveMouse GetCurrentX, GetCurrentY - 10
           tMover.Tag = 7
       Case 7
           MoveMouse GetCurrentX + 10, GetCurrentY - 10
           tMover.Tag = 0
       End Select
    End Sub

    To move the mouse around in a circle with a timer. But all it do is moving the mouse towards the bottom right corner. What am I doing wrong?


    [edit] Nevermind. I thought that positions were absolute. They're relative

  • 5 years ago

    I can't make it work.
    I'm using this code:

    Code:
    Private Sub tMover_Timer()
       Select Case tMover.Tag
       Case 0
           MoveMouse GetCurrentX + 10, GetCurrentY
           tMover.Tag = 1
       Case 1
           MoveMouse GetCurrentX + 10, GetCurrentY + 10
           tMover.Tag = 2
       Case 2
           MoveMouse GetCurrentX, GetCurrentY + 10
           tMover.Tag = 3
       Case 3
           MoveMouse GetCurrentX - 10, GetCurrentY + 10
           tMover.Tag = 4
       Case 4
           MoveMouse GetCurrentX - 10, GetCurrentY
           tMover.Tag = 5
       Case 5
           MoveMouse GetCurrentX - 10, GetCurrentY - 10
           tMover.Tag = 6
       Case 6
           MoveMouse GetCurrentX, GetCurrentY - 10
           tMover.Tag = 7
       Case 7
           MoveMouse GetCurrentX + 10, GetCurrentY - 10
           tMover.Tag = 0
       End Select
    End Sub

    To move the mouse around in a circle with a timer. But all it do is moving the mouse towards the bottom right corner. What am I doing wrong?

  • 4 years ago
    It might be a good idea to drop the second 'n' from ShiftOnn and CtrlOnn
  • 3 years ago

    Will this code prevent the screensaver from beeing activated (if I just use the mouse movement now and then)?

    /Max

  • 2 years ago
    Hi, is there a C# version of this code, by the way thanks a lot for this code too, it helps me too much.

  • 2 years ago
    This is col and all and im happy wit all the keys used i it, except for one, y is it that enter is not in the list when i type KeyPress(vbKey?

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!