How to Minimize Windows from DesktopX

...and undo minimize

This was asked a while ago (I think) and in my quest to learn the shell application object better I stumbled upon some doc's in my knowledgebase.

This script is based on the "Accessing Windows Shell with WSH-Scripts" article under the samples section at http://freenet-homepage.de/gborn/WSHBazaar/WSHBazaar.htm.

This script will toggle minimize/undo minimize the windows.

Code: vbscript
  1. Dim blnMin
  2. blnMin=False ' Default to False. Eg. Windows are usually showing before use
  3. 'Called when L-click on object or its children
  4. Function Object_OnLButtonUpEx(obj, x, y, dragged)
  5. If Not dragged Then
  6. Call ToggleWindows
  7. End If
  8. End Function
  9. Sub ToggleWindows
  10. ' Create Shell Application Object
  11. Set oShell=CreateObject ("Shell.Application")
  12. If blnMin=False Then
  13. blnMin=True
  14. oShell.MinimizeAll
  15. 'oShell.TileVertically
  16. 'oShell.TileHorizontally
  17. 'oShell.CascadeWindows
  18. ElseIf blnMin=True Then
  19. blnMin=False
  20. oShell.UndoMinimizeAll
  21. End If
  22. End Sub

4,526 views 5 replies
Reply #1 Top
Cool.  Thanks!
Reply #2 Top
Thanks Sir. :)
Reply #3 Top
Thanks guys. ;)

The linked script shows how to tile & cascade and you just use the undominimizeall method to restore everything.
Reply #4 Top
very nice bud..
I love all the things DX can do
Reply #5 Top
I love all the things DX can do
So it's been a while . . lets see what you can do with it.   :CONGRAT: