title: A way to ensure that a system tray icon is removed... guaranteed
body: <p>Is there a way to guarantee that your system tray icon is removed?</p>
  
  <p>To add the system tray icon you do:</p>
  
  <pre><code>Shell_NotifyIcon(NIM_ADD, &amp;m_tnd);
  </code></pre>
  
  <p>To remove the system tray icon you do:</p>
  
  <pre><code>Shell_NotifyIcon(NIM_DELETE, &amp;m_tnd);
  </code></pre>
  
  <p>What I want to know: what if you application crashes? The icon stays in your system tray until you mouse over.  Is there a way to guarantee that the icon will be removed, even when the application crashes? I would prefer not to use structured exception handling for various reasons. </p>
  
  <p>Another case that I want to handle is when the process is killed, but doesn't necessarily crash.</p>