Wait for new control to exist, ignore older ones w/same name
Posted: 10 Mar 2015, 02:26
I'm attempting to have ahk wait for a new control to exist, while making sure that any controls with the same name are ignored at the start of the script. (In other words, ahk should only respond to new instances of the control--which arise only after the script begins.) Below is the code I am currently using. Any help is greatly appreciated.
Code: Select all
^J::
SetTimer, CtrlWait, 100
CtrlWait:
ControlGet, COut, Hwnd, , <<ClassNN>>, <<ahk_class>>
if !COut
return
else
{
SetTimer, CtrlWait, Off
}