title: SetWinEventHook Window Maximized event
body: <p>I am currently working on a program that uses a functionality that should alert me when an other process's window is maximizing/maximized. With the maximize event  I mean pressing the symbols next to the close button on the top right corner.</p>
  
  <p>To accomplish this I use the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd373640%28v=vs.85%29.aspx" rel="noreferrer">SetWinEventHook</a> function. The problem is that I can't find the correct event code to catch this event. I tried the <code>EVENT_SYSTEM_MOVESIZESTART, EVENT_SYSTEM_MOVESIZEEND, EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_MINIMIZEEND</code> constants but they all don't seem to trigger on the maximize event. I however can trace other events so my implementation of SetWinEventHook is working.</p>
  
  <p>Does anyone maby has an idea on how to capture the maximize event from an other process?</p>
  
  <p>Thanks in advance.</p>
  
  <p>With friendly greetings,
  Bob</p>
  
  <p><strong>Code example:</strong></p>
  
  <pre><code>// To catch the event
  SetWinEventHook(EVENT_MIN, EVENT_MAX, IntPtr.Zero, new WinEventDelegate(WinEventProc), GetProcess(), 0, 0);
  
  // The handler
  private void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
  {
      // TODO: Filter maximize event here   
      if (eventType == ?)
      {
              // Do something
      }   
  }
  </code></pre>