Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Example #1: Maximize the active window and report its unique ID:
  2. WinGet, active_id, ID, A
  3. WinMaximize, ahk_id %active_id%
  4. MsgBox, The active window's ID is "%active_id%".
  5.  
  6. ; Example #2: This will visit all windows on the entire system and display info about each of them:
  7. WinGet, id, list,,, Program Manager
  8. Loop, %id%
  9. {
  10.     this_id := id%A_Index%
  11.     WinActivate, ahk_id %this_id%
  12.     WinGetClass, this_class, ahk_id %this_id%
  13.     WinGetTitle, this_title, ahk_id %this_id%
  14.     MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
  15.     IfMsgBox, NO, break
  16. }
  17.  
  18. ; Example #3: Extract the individual control names from a ControlList:
  19. WinGet, ActiveControlList, ControlList, A
  20. Loop, Parse, ActiveControlList, `n
  21. {
  22.     MsgBox, 4,, Control #%a_index% is "%A_LoopField%". Continue?
  23.     IfMsgBox, No
  24.         break
  25. }
  26.  
  27. ; Example #4: Display in real time the active window's control list:
  28. #Persistent
  29. SetTimer, WatchActiveWindow, 200
  30. return
  31. WatchActiveWindow:
  32. WinGet, ControlList, ControlList, A
  33. ToolTip, %ControlList%
  34. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement