How can I minimalize to desktop (so everything is minimalized) from my program Maybe some APIs could be used??
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...
Mirno
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...
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 ?
I did it on a different PC, but it was something like this:
Its pretty much that... You need the IsWindowVisible, otherwise it tries to minimize things that are hidden (like a load of processes in 2K)...
Mirno
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
ret
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)...
Mirno
If you are fimiliar with COM, you can use the MinimizeAll() method of the Shell object.
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
James:alright:
James:alright:
SendMessage, HWND_BROADCAST, WM_MINIMIZED, 0, 0 ?