title: On which occasions exactly is WM_ACTIVATE sent?
body: <p>I'm trying to debug a huge Win32 GUI application (I have full sources) divided into several processes. The problem is the following: in one process I have a dialog with a listbox, when I double-click an item in the listbox another process is started that creates its own window that is brought to front and covers the initial dialog. If I do some manipulations (that I can't fully explain yet since I don't fully understand them yet) something forces the initial dialog to start flashing in the taskbar.</p>
  
  <p>I tried Microsoft Spy++ and see that whenever I do that manipulation WM_ACTIVATE is sent to the dialog, most of the times it has these parameters:</p>
  
  <pre><code>fActive: WA_INACTIVE fMinimized:False hwndPrevious:(null)
  </code></pre>
  
  <p>and in those cases the dialog doesn't starts flashing. But once in a while the parameters are</p>
  
  <pre><code>fActive: WA_ACTIVE fMinimized:False hwndPrevious:(null)
  </code></pre>
  
  <p>and that precisely corresponds to the dialog flashing.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms646274(VS.85).aspx" rel="nofollow noreferrer">MSDN says</a> WM_ACTIVATE is sent with WA_ACTIVE when a window is <em>activated by some method other than a mouse click (for example, by a call to the SetActiveWindow function or by use of the keyboard interface to select the window)</em>.</p>
  
  <p>Now in the application code SetActiveWindow() is never called and I don't do anything with the keyboard that could switch windows.</p>
  
  <p>What other reasons are possible for WM_ACTIVATE being sent with WA_ACTIVE?</p>