However, AutoHotkey needed to recognize when a new window opens or an old window closes. I felt that updating the menu in the background whenever a window opened or closed would provide a good solution. While I added a Rescan Windows option to the top of the menu for manual updating, I didn’t want the one or two-second delay caused by rebuilding the menu. The menu appears in most-recently-used order from topmost down. The new WindowListMenu.ahk script creates both the new pop-up menu and the original GUI DropDownList-each displaying a list of open windows for quick access and navigation. When launched, AutoHotkey scans the open windows and builds the activation menu from that list. While the original script built a GUI DropDownList, I easily added the pop-up Menu commands to the Loop. Select from the WindowList menu to activate the open window. The command captures the Process ID (or windows handle- Hwnd) of the open windows in the order they appear on the Windows Desktop (from top to bottom). After screening out certain systems windows: If (Title != "" and Class != "BasicWindow" and Title != "Start" The WindowList.ahk script uses the WinGet, OutputVar, List command to build a list of all open windows-modeled after WinGet, …, List example found in the online AutoHotkey documentation. But what if I could maintain a menu of all open Windows available in a menu for instant activation? The WinGet, List Command It takes a second for the thumbnails to appear, then hovering over each helps me make my selection. Generally, I locate a window by hovering over the Windows Taskbar then selecting the image which looks right. I often keep numerous windows open simultaneously. The WindowList.ahk script moved the window back into my view.Īs I reviewed the script, I realized that building a pop-up menu of open windows could serve a purpose similar to the QuickLinks.ahk script-except, rather than launching apps and Web sites, the menu would activate open windows. The scriptwriter originally used a second monitor-which I didn’t have. The script had placed the target window somewhere off the screen. I could not find the GUI window generated by the code. Once, while testing someone’s script, it proved very useful. I originally used the WindowList.ahk script as a demonstration of how to use the GUI DropDownList control as a list of selection options for activating open windows (included in the Digging Deeper Into AutoHotkey book). With a Few Modifications, the WindowList.ahk Script Pops Up a Menu of Open Windows for Quick Activation-Plus, How to Detect When a Windows Opens or Closes
0 Comments
Leave a Reply. |