Trying to make VBS scripts for Minimize and UnMinimize all windows, help!

ZappDogg

Senior member
Jul 18, 2005
761
0
0
Well, the hard part is done for the most part. Below are what I'm using as scripts for each function. What I would like is to somehow combine these two into a single toggle button, similar to Show Desktop. Any ideas?

Minimize all windows
Set shell = wscript.CreateObject("Shell.Application")
Shell.MinimizeAll

UnMinimize all windows
dim objShell

set objShell = CreateObject("Shell.Application")
objShell.UndoMinimizeALL
set objShell = nothing
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
Well you'll need to detect what the current state is in order to make a decision to minimize or maximize all. Short of being able to call a method which tells you, you might have to loop through each application window and check their state.
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
As snapster said you would need to loop through each windows and check their current status. Take a look at http://msdn.microsoft.com/en-u...y/bb776890(VS.85).aspx to see how to get the windows.



In case you didn't know Windows Keyboards have shortcuts to do these functions:

Windows Logo+M: Minimize all
SHIFT+Windows Logo+M: Undo minimize all
 

ZappDogg

Senior member
Jul 18, 2005
761
0
0
I know about the key shortcuts, but I'd like an icon that can toggle the commands, since Show Desktop minimizes Rocketdock, and this method does not.