title: Is there Windows system event on active window changed?
body: <p>The desktop application I'm developing need to know what windows were active while the application was run. Currently it performs <code>GetForegroundWindow()</code> call (of <code>user32.dll</code>) every 250 msec. The approach is not very accurate.</p>
  
  <p>Is there any Windows (WINAPI?) event which fires every time the active (focused) window changed? I'd like to subscribe with my callback function.</p>
  
  <p>Thanks.</p>