Jump to content
Sign in to follow this  
The_Noob

make mouse click based on coordinates of the window?

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 :)

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...