Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Move cursor and left click

$
0
0
When a button is pressed, I want the mouse to move to a predetermined location on the screen, and left click.

I have tried:

    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4

mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
Mouse_Event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)


...for the mouse click, but the mouse moves immediately to the bottom right hand corner of the screen, (the very bottom-right pixel), instead of left-clicking at the current cursor location.

The moving of the cursor is working fine on it's own.

Any help much appreciated!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>