Skip to content

Instantly share code, notes, and snippets.

@mubix
Created December 20, 2013 04:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mubix/8050500 to your computer and use it in GitHub Desktop.
Save mubix/8050500 to your computer and use it in GitHub Desktop.
Window Roulette
# Code loops around each of the windows
# that the current user has open and switches
# focus to each of them in rotation... 100 times.
(0..100).each do |x|
windows = client.extapi.window.enumerate
windows.each do |winder|
if winder[:title] != 'Default IME'
result = client.railgun.user32.SetForegroundWindow(winder[:handle])
end
end
print_status("Round #{x}")
end
@seuros
Copy link

seuros commented Jan 13, 2014

I updated the code @ https://gist.github.com/seuros/8397005
Your current code loops 101 times instead of 100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment