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 

basic winactivate and ifwinexist problems

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



Joined: 10 Nov 2006
Posts: 3

PostPosted: Fri Nov 10, 2006 1:07 am    Post subject: basic winactivate and ifwinexist problems Reply with quote

im trying to write a script that highlights one of my message boxes in trillian (an aim like program), and then runs some code. i cant get either ifwinexist or winactivate to recognize the title.

Code:
SetTitleMatchMode, 2
detecthiddenwindows on

IfWinExist, ;no matter what title or text i put, it wont recognise it
{
   WinActivate
}


active window info says:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Their User Name : AIM - My User Name
ahk_class icoAIM

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Unicode Trillian Window
Unicode Trillian Window

with our names obviously replaced. and yes, i know its case sensitive, and ive tried all combinations of title and text. ive used it with notepad, and it seems to work.

thanks in advance

-Aramil
Back to top
View user's profile Send private message
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Fri Nov 10, 2006 2:24 am    Post subject: Reply with quote

Try this.

Code:

SetTitleMatchMode, 2
detecthiddenwindows on

IfWinExist, : AIM -
{
   WinActivate
}
Return

Of course setup like this it would only work if the window Existed right as you run the script. If you want it to continously check to see if that window exists you need to put it in a loop.
Code:

SetTitleMatchMode, 2
detecthiddenwindows on

Loop {
Sleep 50
IfWinExist, : AIM -
   WinActivate
}
Return
Back to top
View user's profile Send private message Visit poster's website AIM Address
aramilmoonmist



Joined: 10 Nov 2006
Posts: 3

PostPosted: Fri Nov 10, 2006 2:31 am    Post subject: Reply with quote

nope, still doesnt select it at all

-Aramil
Back to top
View user's profile Send private message
aCkRiTe



Joined: 21 Jul 2006
Posts: 517

PostPosted: Fri Nov 10, 2006 2:33 am    Post subject: Reply with quote

Does .AHK's script activate the window though?
Back to top
View user's profile Send private message
aramilmoonmist



Joined: 10 Nov 2006
Posts: 3

PostPosted: Fri Nov 10, 2006 2:36 am    Post subject: Reply with quote

no, tired that too

-Aramil
Back to top
View user's profile Send private message
quicktest



Joined: 30 Jul 2004
Posts: 42

PostPosted: Fri Nov 10, 2006 2:44 pm    Post subject: Reply with quote

How about try the following for troubleshooting, to find out if it's the window detection or the activation that's failing. Just another 0.02 suggestion from me.

Code:
SetTitleMatchMode, 2
detecthiddenwindows on

IfWinExist, : AIM -
{
   MsgBox, Window Found
   WinActivate
}
Return
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