title: Why do RESTORED, MINIMIZED, MAXIMIZED notifications all get sent when they shouldn't be?
body: <p>I am fairly new to C(only 3 months), and I have gotten into Windows programming. After playing with it, I tried responding to the WM_SIZE message. In a simple program, my WndProc() looked like this:</p>
  
  <pre><code>LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
  switch(msg) {
    case WM_SIZE:
      switch(wParam) {
        case SIZE_MINIMIZED:
             MessageBox(NULL, "You minimized the window!", "Minimized", MB_ICONEXCLAMATION | MB_OK);
        case SIZE_MAXIMIZED:
             MessageBox(NULL, "You maximized the window!", "Maximized", MB_ICONEXCLAMATION | MB_OK);
        case SIZE_RESTORED:
             MessageBox(NULL, "You restored the window!", "Restored", MB_ICONEXCLAMATION | MB_OK);
      }
  }
  </code></pre>
  
  <p>I expected for the right messages to popup at the right time, so when I minimize the window, the "Minimize" MessageBox should pop up.</p>
  
  <p>Instead, when I minimize the window, all three message boxes pop up, first the minimize one, then maximize, then restore. The restore message box pops up for all of them, which is not what the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632646(v=vs.85).aspx" rel="nofollow" title="WM_SIZE message documentation">Microsoft documentation</a> says it should do.
  If someone could explain this or what I am doing wrong, please do.</p>