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 

show a message when a certain control appears

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






PostPosted: Sat May 17, 2008 1:08 pm    Post subject: show a message when a certain control appears Reply with quote

Hi, I'm trying to show a message when some controls (button) appear in different windows I have open.

I've done something like this, but it's not working. I'm using x>0 to determine if the control is present or not. Any help appreciated.

Loop
{
GoSub, controllo
}

controllo:
ControlGetPos, x, y, w, h, Button13
if (x>0)
{
Tooltip, BUTTON PRESENT, x, y
return
}
ControlGetPos, x, y, w, h, Button17
if (x>0)
{ Tooltip, BUTTON PRESENT, x, y
return
}
Back to top
Guest






PostPosted: Sat May 17, 2008 1:31 pm    Post subject: Reply with quote

updating this

Code:

GroupAdd, winzz, AllWindows


Loop
{
    GoSub, controllo
}

controllo:
ControlGetPos, x, y, w, h, Button13, ahk_group winzz
if (x>0)
{   
Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button16, ahk_group winzz
if (x>0)
{   
Tooltip, MESSAGE, x, y
return
}
else return


ControlGetPos, x, y, w, h, Button17, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button18, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button19, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button16, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button11, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button47, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button48, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button49, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return

ControlGetPos, x, y, w, h, Button50, ahk_group winzz
if (x>0)
{   Tooltip, MESSAGE, x, y
return
}
else return
Back to top
keybored



Joined: 18 Jun 2006
Posts: 90
Location: Phoenix, AZ

PostPosted: Sat May 17, 2008 1:37 pm    Post subject: missing parameter? Reply with quote

Guest. It seems the window title is missing from ControlGetPos. Using "A" takes the current active window so it may work for you.

ControlGetPos, x, y, w, h, Button12, A
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