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 ?
Can this be done without saving all positions of all the windows ?
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.
umbongo.
this should do it.
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. . . .:(
So. . . .:(
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.
umbongo
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.
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)
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:
so...... :rolleyes: :eek: