问题
To access and control a window, dialog or popup with Autohotkey the title of that specific window is needed. For some windows the title can be read directly if its visible, but some windows hide it. The window class and the exe (ahk_class and ahk_exe) aren't visible at all. How to gather this information reliable?
回答1:
Use the Window Spy tool, which is installed together with AHK, it can be started various ways:
- Right click the tray icon of a running AHK script and select
Window Spy
- Start the
AU3_Spy.exe
in the AHK installation folder - Use the Windows search to search for
Window Spy
You will get a window called Active Window Info
with various infos about your current active (topmost) window. The first box is the one you need.
Example
The box gives title, class and .exe to detect the target window of which every line can be used to identify the window. Now you should activate the window you want to address and copy the information.
Hint: You can (un-)freeze the display with Win + A
来源:https://stackoverflow.com/questions/35071472/how-to-determine-title-and-additional-infos-from-an-open-window-for-use-with-aut