Skip to content

Instantly share code, notes, and snippets.

@mubix
Created December 20, 2013 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mubix/8050653 to your computer and use it in GitHub Desktop.
Save mubix/8050653 to your computer and use it in GitHub Desktop.
Uses the "CloseWindow" API call to minimize all of the windows.
windows = client.extapi.window.enumerate
windows.each do |winder|
result = client.railgun.user32.CloseWindow(winder[:handle])
end
@OJ
Copy link

OJ commented Dec 21, 2013

This can cause a few problems for users...

windows = client.extapi.window.enumerate
windows.each do |winder|
    result = client.railgun.user32.DestroyWindow(winder[:handle])
end

but if you're not keen on destroying, you can minimise, which makes the desktop pretty unusable.

windows = client.extapi.window.enumerate
windows.each do |winder|
    result = client.railgun.user32.ShowWindow(winder[:handle], 6)
end

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