In Windows, I have a minimised window that is the foreground window (GetForegroundWindow). I now want to un-minimise the window so that it becomes visible again. How can I bring the window back to its previous state? I.e., if the window was "restored" before minimised, it should be restored, if it was maximised before being minimised, it should be maximised again and especially not restored or something.
It seems I can only determine the window's current state out of {minimised, restored, maximised}, but theoretically, minimised and maximised should be flags that can be set together.
How does the Explorer taskbar know in what state to show a window if the user clicks on it?