When users resize and adjust the location of my program's window (Winforms), they expect to see the window in that same position, even after closing and reopening the program. What I do is store the form's Width, Height, Location.X and Location.Y properties, and set these back when the program is reopened.
The problem is when a window is maximized, Width, Height, X, Y refer not to the non-maximized Width/Height/X/Y, but instead to the Maximized dimensions.
Thus when a user has the window maximized, closes and reopens the program, and the proceeds to un-maximize the window, instead of it returning to the original position/size, it sticks at the full size/position.
So without using a kludge to store variables after certain events execute, how can I obtain the non-maximized position and size when the window is maximized?