Okay, here’s my blog post about using AutoHotkey Windows Spy, written in a casual, personal style:
So, the other day I was messing around with AutoHotkey, trying to automate some repetitive tasks on my Windows machine. I needed to figure out the exact names of some windows and controls, and that’s when I remembered this little tool called “Windows Spy.” It comes bundled with AutoHotkey, which is super convenient.


First, I opened up my AutoHotkey installation folder. I was not sure where to find it. Then I found the folder, and then I looked for a program called “AU3_*”. I think older versions might call it something slightly different, like “AutoIt3 Window Spy” or something. Double-clicked it, and boom – the spy window popped up.
How I use this spy
It’s a pretty simple window. The magic happens when you start clicking around on other windows. I clicked into a setting windows I was trying to control. The Windows Spy window immediately updated with all sorts of information about it.
- I saw the full window title.
- I found out the “ahk_class” – that’s like a special identifier for that type of window.
- I got the window’s position and size.
- I even noticed the mouse coordinates, both relative to the window and the whole screen. Super useful!
- I also got the Class name and text of the control.
The “Control” section is where things get really interesting. When you move your mouse over different buttons, text boxes, or whatever within the target window, Windows Spy shows you information about that specific control. This is crucial for telling AutoHotkey, “Hey, click this specific button,” or “Type text into that specific box.”
I copied the control’s ClassNN (that’s its “class name” and “instance number”) and used it in my script. For example, something like this:
ControlClick, Button3, ahk_class MyWindowClassName
That line tells AutoHotkey to find a window with the class “MyWindowClassName” and click the control named “Button3” inside it. Without Windows Spy, I’d be completely guessing about those names!
My final thought
Honestly, Windows Spy is one of those tools that seems so simple, but it’s absolutely essential for more advanced AutoHotkey scripting. Any time I’m trying to automate something beyond the basics, I fire it up. Saved me a ton of time and frustration!