If special windows active:
do something(such as send keystroke)
If special windows quit:
do something
Now, the software has only a few hidden if condition(if windows create and minimize first time). I hope add more if condition and action. Wish there is a if condition dialog to explain it.