AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

When working on another window my script stop

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
feejo



Joined: 16 Jun 2007
Posts: 245

PostPosted: Thu Jan 24, 2008 7:40 pm    Post subject: When working on another window my script stop Reply with quote

My script work when I am working on the specific windows, as soon as I click on another window it stop to work.


Code:

settitlematchmode, 2  ;
WinWait, Le 2,
IfWinNotActive, Le 2, , WinActivate, Level 2,
WinWaitActive, Lel 2,
Winset, AlwaysOnTop, On, Le 2:     

1:


PixelGetColor, 3NB, 232, 195
If (3nb = 0x0080FF)
  num:=1
  Goto, fin
}

 
Else

Fin:
soundbeep
goto, 1
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Thu Jan 24, 2008 8:57 pm    Post subject: Reply with quote

Move the lines starting with WinWait to WinSet below the 1: label.
_________________

Back to top
View user's profile Send private message Visit poster's website
feejo



Joined: 16 Jun 2007
Posts: 245

PostPosted: Thu Jan 24, 2008 9:05 pm    Post subject: Reply with quote

Yes, it work, but I can't work on any other windows, cause it is switching back to the other one by itselve.
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Thu Jan 24, 2008 9:09 pm    Post subject: Reply with quote

You can't work with other windows in your script because PixelSearch requires that the target window be active and visible. Commands like Control and SendMessage don't have this limitation.
_________________

Back to top
View user's profile Send private message Visit poster's website
feejo



Joined: 16 Jun 2007
Posts: 245

PostPosted: Thu Jan 24, 2008 9:25 pm    Post subject: Reply with quote

I have 2x 17in screen the windows will be on one of them with nothing in front of it. Maby I will end up doing a sceen coord.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group