title: GetWindowPlacement gives the incorrect window position
body: <p>How to find out whether a window was resized using <a href="http://windows.microsoft.com/en-US/windows7/products/features/snap" rel="noreferrer">Aero Snap feature</a>? <a href="http://msdn.microsoft.com/en-us/library/ms633518%28VS.85%29.aspx" rel="noreferrer"><code>GetWindowPlacement</code></a> function gives the latest "restored" window size. I use it as follows:</p>
  
  <pre><code>WINDOWPLACEMENT wp = {};
  wp.length = sizeof(WINDOWPLACEMENT);
  ::GetWindowPlacement( hWnd, &amp;wp );
  </code></pre>
  
  <p>For instance, it gives <code>wp.rcNormalPosition = {top=208 bottom=520 left=152 right=510}</code>, when it should be 
  <code>{top=0 bottom=1920 left=152 right=510}</code>.</p>
  
  <p><strike>Please, note that <code>GetWindowRect</code> gives exactly the same incorrect result.</strike> That was my fault, <code>GetWindowRect</code> gives the right result.</p>
  
  <p>I need to save window state on the program exit and load it on start, so I need to know how windows are placed. How can I find out actual window coordinates?</p>
  
  <hr>
  
  <p>Well, I made several tests with <code>notepad.exe</code>(and some other standard Windows components) and it saves its state in the same way &mdash; it doesn't remember whether it was "snapped". So I suppose this is intended behavior of Windows programs.</p>