Jump to content

make mouse click based on coordinates of the window?


The_Noob
 Share

Recommended Posts

ok i want to sense pixels of an IE window that im moving offscreen, and when those pixels change i want the mouse to click part of that window which is also offscreen. I think i got the detecting the pixels part, but i cant seem to make it click the mouse based on where the window is...

#include <IE.au3> 
Opt("PixelCoordMode", 0)       ;1=absolute, 0=relative, 

;ok so this should fix the pixel thing right? just checking...
;the program runs good through most of the program, im not going to post it here...

Do
    sleep(500)
    $check = Pixelgetcolor(439,628)
    tooltip($check,1,1)
until $check > 1

WinActivate("MyWindow")
mouseclick("left",466, 846,1)

;this is where it messes up, it doesnt want to click based on the position of my window, it clicks based on the coordinates of the desktop... how do i change this?

So thats it. Suggestions are welcome :)

Link to comment
Share on other sites

Once the window is offscreen there are no pixel colours to check for.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

ok lets try a different approach...

lets say i wanted the program to run in the background...

How would i get autoit to detect what window is active, so it could switch to the other window to do the mouseclick, then switch back?

also how do i get autoit to detect pixels of a window that is not active?

Also my original problem still stands... how do i make the mouse click based on the co-ords inside the window rather than the whole screen...

Edited by The_Noob
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...