I would like to minimize all visible windows on the desktop and restore them later ?

Can this be done without saving all positions of all the windows ?
Posted on 2001-07-19 01:34:28 by Rosky
You can use PostMessage to do this, instead of the first parameter being a hWnd handle, use the value HWND_BROADCAST, make wParam SIZE_MINIMIZED and lParam can be zero I think.

this should do it.

Posted on 2001-07-19 04:02:03 by umbongo
If I do that all the windows that are marked as hidden ar also restored or maximized and become visible vhen I want to restore them !

So. . . .:(
Posted on 2001-07-19 04:31:12 by Rosky
hmm.. well that was the simple way, but if you need greater control, then you'll have to use EnumDesktopWindows, this takes two parameters, the first is an address of a function to call, for each window, the second param is a 32-bit value you can define.

You'll need to check it's state by getting the properties of the window using GetWindowLong, if you use GWL_STYLE you can then determine what the state of the windows is - visible or other.

For each window which matches your criteria you need to use PostMessage as mentioned before. Then store it's handle. When you come to restore them, just iterate through this list and use PostMessage again.

Posted on 2001-07-19 04:43:26 by umbongo
you don't need to store the handle, you just EnumDesktopWindows again and show all you have to do is call IsVisible and restore/maximize only those windows (that is if you don't care about previously minimized windows that'll be restored)
Posted on 2001-07-19 07:40:10 by Unregistered
Yes i could do that but i would maximize all the windows even those that are minimized when i minimize the whole bunch of windows !
so...... :rolleyes: :eek:
Posted on 2001-07-23 10:41:08 by Rosky