public
Created

Uses the "CloseWindow" API call to minimize all of the windows.

  • Download Gist
close_minimize.rb
Ruby
1 2 3 4
windows = client.extapi.window.enumerate
windows.each do |winder|
result = client.railgun.user32.CloseWindow(winder[:handle])
end

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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.