Sign in to follow this  
Followers 0
petrolea

Problems with active window and clicks

5 posts in this topic

Hi everyone!

I'm having some difficulties with a script running in Windows 7. The script is working fine but there's one big problem.

The mouse is hovering over the program just fine and moving from one point to another but only if the program that was supposed to recieve the clicks is not focused. But if I click on the window and make it "active" the script stops. If I click outside the window it just starts running again. It is like it is totally ignoring the window it was supposed to click on and it sends clicks to the desktop.

Btw, I'm using a picture editing software and I want it to click on the pixels of some color to change them to some other color (I know it's not useful but I'm just practicing).

Any help would be greatly appreciated :mellow:

This is the code if it helps:

HotKeySet("{f6}", "_Exit")
while 1
sleep(1000)
  $var = PixelSearch(642, 83, 1663, 855, 0xDEA34A)
  if IsArray($var) Then
   MouseMove($var[0], $var[1], 15)
   MouseClick("primary", $var[0], $var[1], 1)
  Else
   sleep(1000)
   ConsoleWrite("Can't find pixel!")
  EndIf
WEnd
Func _Exit()
Exit
EndFunc

Share this post


Link to post
Share on other sites



I found a similiar thread with same problem, it looks like it could be Windows 7 problem. Anyone knows about this?

Share this post


Link to post
Share on other sites

Tiny bump, really want to know what's wrong.

Share this post


Link to post
Share on other sites

another bump, help would really be highly appreciated.

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  
Followers 0