title: Maximum and minimum window sizes in WINAPI
body: <p>I've found some more questions on StackOverflow about my topic. One of them is <a href="https://stackoverflow.com/questions/5794630/setting-a-windows-minimum-and-maximum-size-using-winapi">here</a>.</p>
  
  <p>I have also read the Microsoft Documentation about <code>MINMAXINFO</code> and the message associated with this structure. I simply can't make it work... Here is what I've tried so far:</p>
  
  <pre><code>case WM_PAINT:
  {
      MINMAXINFO mmi = { 0 };
      SendMessage(hWnd, WM_GETMINMAXINFO, NULL, (LPARAM)&amp;mmi);
      POINT sz = { 640, 480 };
      mmi.ptMaxSize = sz; 
  }
  break;
  </code></pre>
  
  <p>I think this is completely wrong, since it is not having any effect on the window...</p>
  
  <p>How can I get this working, for a minimum size of <code>W: 450, H: 250</code>, and a maximum of <code>W:800, H: 600</code>?</p>
  
  <p>Further explanation of the effect that I need: when the user drags one corner, or border of the window, and the window has the maximum/minimum size, the user cannot make the window larger or smaller than the <code>minimum_size</code>/<code>maximum_size</code></p>