How can I minimalize to desktop (so everything is minimalized) from my program Maybe some APIs could be used??
Posted on 2002-10-25 09:45:16 by slonik
Yes you are right, some APIs can be used!

I managed using 4, and one of those may not really be needed, it was just there to be safe!

Look at EnumWindows, and ShowWindow in particular...

Posted on 2002-10-25 12:49:05 by Mirno
I tried using EnumWindows and minimalizing (ShowWindow) all windows which handles were returned by the first function. But it definetley wasn't what I expected to achieve :). Then I tried checking first if the window is maximalized (IsZoomed) and only then did I minimalize windows. It worked quite good but when I run a game and then try to minimalize it does not work :( Maybe you could show me some source code ?
Posted on 2002-10-26 01:14:27 by slonik
I did it on a different PC, but it was something like this:

invoke EnumWindows, ADDR MyEWP, NULL
invoke ExitProcess, 0

MyEWP proc hWnd:DWORD, LParam:DWORD
invoke IsWindowVisible
or eax, eax
jz @F
invoke ShowWindow, hWnd, BLAH_MINIMIZED ; can't remember the constant!
mov eax, 1
MyEWP endp

Its pretty much that... You need the IsWindowVisible, otherwise it tries to minimize things that are hidden (like a load of processes in 2K)...

Posted on 2002-10-26 04:37:18 by Mirno
If you are fimiliar with COM, you can use the MinimizeAll() method of the Shell object.
Posted on 2002-10-26 06:23:52 by death
I think (never tested) you could (if you didn't want to use APIs) send the ToggleDesktop command to explorer just like the shortcut does in the taskbar

Posted on 2002-10-26 14:17:48 by JamesE
Posted on 2002-10-26 15:34:08 by bazik