Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Example #1: Maximize the active window and report its unique ID:
- WinGet, active_id, ID, A
- WinMaximize, ahk_id %active_id%
- MsgBox, The active window's ID is "%active_id%".
- ; Example #2: This will visit all windows on the entire system and display info about each of them:
- WinGet, id, list,,, Program Manager
- Loop, %id%
- {
- this_id := id%A_Index%
- WinActivate, ahk_id %this_id%
- WinGetClass, this_class, ahk_id %this_id%
- WinGetTitle, this_title, ahk_id %this_id%
- MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
- IfMsgBox, NO, break
- }
- ; Example #3: Extract the individual control names from a ControlList:
- WinGet, ActiveControlList, ControlList, A
- Loop, Parse, ActiveControlList, `n
- {
- MsgBox, 4,, Control #%a_index% is "%A_LoopField%". Continue?
- IfMsgBox, No
- break
- }
- ; Example #4: Display in real time the active window's control list:
- #Persistent
- SetTimer, WatchActiveWindow, 200
- return
- WatchActiveWindow:
- WinGet, ControlList, ControlList, A
- ToolTip, %ControlList%
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement