External Mouse Clicks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • eXecallibur
    Forum Member
    • May 2004
    • 4

    External Mouse Clicks

    Hi there,

    I've been looking into executing remote mouse clicks outside of the application itself. I searched the forums and found a lot of information regarding help for this situation.

    Cursorpos.dll <-- to find out where the x,y position is for the mouse click
    (on timer every 1 second to get the coordinates)
    Keystrokes.dll <-- to execute the mouse click
    (gets coordinates from cursorpos.dll)

    Here's the problem. Everytime I start the program, it works great until I start changing the active application. So say I use it to open a folder works until I bring another program on top of the z-order. My goal is to use this with other programs.

    The actual problem is when the active window changes the cursor_y always jumps up sparatically. Not sure why. Could use some help if anyone has any ideas.
  • holtgrewe
    Indigo Rose Customer
    • Jul 2002
    • 779

    #2
    I attempted something like this several years ago using a different language. I ended up using a keystroke file - I gave up on the mouse action. Some of issues I remember, were not knowing exactly where the object was on the screen that I needed to 'click', and I kept losing 'focus' of the active screen. Other than that I can't give any guidance. Good luck with it, I hope you're able to share some of your findings when you get it working.

    Comment

    • eXecallibur
      Forum Member
      • May 2004
      • 4

      #3
      Thanks for your reply holtgrewe. For my project I use either a predetermined area for the mouse clicks. I use the cursorpos.dll to get focus of where the mouse should be when its ready to be clilcked and save the information to a variable. Once all my settings have been confirmed I start the project and on a timer, it performs its actions.

      So, does Keystrokes.dll work by assuming the mouse clicks will be in the original program's handle ? (Meaning the program that called the .dll itself). Perhaps if this is true, then when the Cursorpos.dll finds the axes (x,y) that the keystrokes.dll coordinates are out of bounds and then it shifts the mouse click to an offset amount.

      After further checking, I also notice after I start switching between active windows, that the Cursorpos.dll starts to give off a false position. Where instead of the position starting at 0,0 it now stats that at the middle of screen, say 600, 500 it will state that the x or y cursor position is at 0. Kinda misleading. I was thinking this was due to the Cursorpos.dll taking the application handle of the currently open program and remapping the x,y starting position thus changing where the cursor would end up clicking with Keystrokes.dll.

      Should we have Keystrokes.dll use the AppActivate WindowName command to make sure that the keystrokes.dll is issusing the mouse clicks to the right application. I seen a .dll by intrigue that identifies the active window. I tried to use it to get the handles of the active windows with no success. (Pulls up a blank variable)

      Still waiting for some help. Perhaps Worm can shed some light on this. Thanks again.

      Comment

      • bule
        Indigo Rose Customer
        • May 2005
        • 1116

        #4
        You might also try AutoIT...

        AutoIt is a freeware BASIC-like scripting language designed for automating the Windows GUI and general purpose scripting.
        Never know what life is gonna throw at you. ZubTech

        Comment

        • eXecallibur
          Forum Member
          • May 2004
          • 4

          #5
          Im looking into the AutoIT program. It looks pretty neat. Would like to know though if Worms program can just send the mouse click itself without the need for the X, Y coordinates.

          In the meantime I am scrounging through the forums over at AutoIT to see what I can come up with.

          Comment

          • Intrigued
            Indigo Rose Customer
            • Dec 2003
            • 6138

            #6
            User Buffman (if I can put you in the spotlight Buffman) has had some luck with AutoIt 3, you may want to ask him for some assistance.

            :yes
            Intrigued

            Comment

            Working...
            X