title: How to handle UnauthorizedAccessException from User Code
body: <p>In a Windows Application I have, I am doing some changes in registry like deleting a particular key, in some test scenarios like in a Vista machine with its UAC put on, I'm getting <code>System.UnauthorizedAccessException</code>. My code would look something like this:</p>
  
  <pre><code>try
  {
      //delete registry keys
  }
  catch (UnauthorizedAccessException ex)
  {
      //handling
  }
  catch (Exception genEx)
  {
      //handling
  }
  </code></pre>
  
  <p>But the application would still go crashing., not being handled by the catch block. Is there some way I could handle it?</p>