If the window has a unique title then it could be done with a few lines of AHK
That is if it is just a plain old window that has a caption bar. If it is a toolbar that may be another story.
The mother of almost everything for real programmers.
How many years i have been in donationcoder.com ?
Have I put a proper single line of programmation ?
I remember so many years ago with AutoIt. Even translating the commands and tutorials to spanish.
And when I needed a script allways have been programmers better prepared than me.
I began to forget the tutorials and the commands.
Seems more easy try to find the scripts written by others that try to write anything.
The more difficult script I have done may be of the number of lines like the above one.
Or the adapted scripts from Phrase Express.
The longest scripts i have written have been in dBASE III , 16 bits.
Curiously I remember allmost every command of that language.
Certainly is an advantage for the professional programmer have such a lot of programming languages ( C+, Cobol, Java, HTML5, etc etc).
But for not real programmer is a way to kill any real possibility.
As you know for a while MilesAhead i have been a beggar for scripts in DC for years.
And trying to document constantly I feel now more free.
In this case I fear that I fail again because autoclicker and similar software was a target for me in june 2012
But now i am documenting again and trying to remember better than the last time.