This is my very first contribution to this forum. At my job, I use a very poor proprietary software daily, to do many repetitive tasks. Unfortunately, I couldn't manage to make it work with controlgettext, controlclick, controlgetfocus, postmessage, sendmessage. I managed to find a way that works. I use controlgetpos and check the coordinates:
1:: ; make coordinates blank, run controlgetpos, if classnn is active, x is not blank
CoordMode, Mouse, Window
CoordMode, Pixel, Window
CoordMode, Caret, Window
CoordMode, Menu, Window
ControlGetPos, x, y, w, h, YOURCLASSNN, YOURTITLE, , , ,;
MsgBox YOURCLASSNN is active!
MsgBox YOURCLASSNN isn't active!
Hopefully this will be useful to somebody! Try this if you can't get other things to work!!!