Hello, What you've encountered might seem like a bug, but it is actually a feature behaving as expected in line with the documentation of the GetWindowPlacement() and SetWindowPlacement() functions. You're betting on flags == 0 when a window is in minimized state, but actually, when the window is minimized manually, it doesn't automatically set WPF_SETMINPOSITION flag. The WPF_SETMINPOSITION flag (as per MSDN documents) is defined as "The coordinates of the minimized window may be specified. This flag must be specified if the coordinates are set in the ptMinPosition member." This means if you setup ptMinPosition and you want it to be used, you must define this flag. The reason for your program behaving as it is, is because of how...