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 

Windows activate message

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



Joined: 03 Oct 2007
Posts: 155
Location: UK

PostPosted: Fri Jan 29, 2010 6:10 pm    Post subject: Windows activate message Reply with quote

Hi, is there any message that the system sends when a new window is activated? I need to detect when the user changes from window to window and I'm hoping to do this via onmessage hopefully. I've looked at the message list in the documentation but most seems to only apply to the scripts own windows. Thanks
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Jan 29, 2010 6:50 pm    Post subject: Reply with quote

WinWaitActive / WinWaitNotActive
or WinGet to keep track of the active window
Back to top
tuna



Joined: 03 Oct 2007
Posts: 155
Location: UK

PostPosted: Fri Jan 29, 2010 6:53 pm    Post subject: Reply with quote

Thanks, but I need to detect when any window is being activated, not just keep tracking a particular one.
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Jan 29, 2010 7:00 pm    Post subject: Reply with quote

WinGet example:
Code:

#Persistent
settimer, check, 200
return
check:
WinGet, active_id, ID, A
if (active_id != old_id)
{
tooltip, Different
sleep 1000
}
tooltip,
old_id = %active_id%
return
Back to top
tuna



Joined: 03 Oct 2007
Posts: 155
Location: UK

PostPosted: Sat Jan 30, 2010 12:35 am    Post subject: Reply with quote

Sorry, I forgot to mention that I was hoping to avoid timers. Thanks.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Sat Jan 30, 2010 2:24 am    Post subject: Reply with quote

How to Hook on to Shell to receive its messages?
http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
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