You mean, AutoIt shall send a Keypress to InternetExplorer but only if 2moons is Active?
Code:
HotKeySet("+{F9}", "_Terminate") ;
Call("Test")
Func Test()
While 1
If WinActivate("2moons") Then
Sleep(1000)
Send('{ò}')
Else
Sleep(500)
EndIf
WEnd
EndFunc
Func _Terminate()
Exit
EndFunc
OK, you can delete the "Else" because if you do not write some code for else, you will net need it! But here the while will ckeck every 500 millisecund if 2moons runs and active. If it is active it will sleep 1 secund and will send "o". If not it will sleep half an secund and check again!
BUT, please give me an example what you want to do?