title: Undo / Reset AllowSetForegroundWindow() calls
body: <p>Is there a way to undo a call to <code>AllowSetForegroundWindow(ASFW_ANY)</code>?</p>
  
  <p>The Big Picture:</p>
  
  <ul>
  <li>I want a single process of my exe running at a time.</li>
  <li>To achieve it, the processes communicates with each other using named pipes &amp; if a process already exists, its window has to be brought into front.</li>
  <li>To be able to do this, the latest process must set <code>AllowSetForegroundWindow()</code> with the existing process id.
  <ul>
  <li>I do not want to fetch the process id (sorry for my laziness), so what I'm planning to do is: 1. call <code>AllowSetForegroundWindow()</code> with ASFW_ANY 2. Just in case some error occurred, undo the call to <code>AllowSetForegroundWindow()</code> so that others cannot steal focus from my process.</li>
  </ul></li>
  </ul>
  
  <p>In simple words, I want to allow other processes to steal focus from me, in a particular time window only...</p>
  
  <p>Any one faced similar issue earlier, and found any workaround?</p>
  
  <p>Also, please let me know if you have any better suggestion / alternative...</p>