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
- Dim blnMin
- blnMin=False ' Default to False. Eg. Windows are usually showing before use
- 'Called when L-click on object or its children
- Function Object_OnLButtonUpEx(obj, x, y, dragged)
- If Not dragged Then
- Call ToggleWindows
- End If
- End Function
- Sub ToggleWindows
- ' Create Shell Application Object
- Set oShell=CreateObject ("Shell.Application")
- If blnMin=False Then
- blnMin=True
- oShell.MinimizeAll
- 'oShell.TileVertically
- 'oShell.TileHorizontally
- 'oShell.CascadeWindows
- ElseIf blnMin=True Then
- blnMin=False
- oShell.UndoMinimizeAll
- End If
- End Sub