I'm working on a screensaver which minimizes all windows and then plays around with the desktop icons.

The problem is, that if I minimize a window which isn't minimizable, the window is resized to it's minimum size and positioned at the bottom of the desktop, and when I try to maximize or restore the window, it's size and position isn't restored. I need to activate it and press the enter button to restore the original size.

How can I find out if this window is not minimizable (or doesn't have a minimize button), so I can restore it to it's original size afterwards?