title: RuntimeWrappedException VS UnhandledException
body: <p>Is this the best approach to handle both cases ?</p>
  
  <pre><code> public static class Program
  {
      //http://blogs.microsoft.co.il/blogs/arik/archive/2010/05/28/wpf-single-instance-application.aspx
      //http://social.msdn.microsoft.com/forums/en-US/wpf/thread/dee46bde-9baa-46b6-889c-04e20dd04029
      //http://msdn.microsoft.com/en-us/library/ms404228.aspx?appId=Dev10IDEF1&amp;l=EN-US&amp;k=k%28CS1058%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK&amp;k=VERSION=V4.0%22%29&amp;rd=true
  
      [STAThread]
      public static Int32 Main(string[] args)
      {
          bool unhandledInstalled = false;
          try
          {
              AppDomain.CurrentDomain.UnhandledException += UnhandledException;
              unhandledInstalled = true;
  
              var app = new App();
              app.DispatcherUnhandledException += DispatcherUnhandledException;
              return app.Run();
          }
          catch (SecurityException)
          {
              // Notify
          }
          catch (Exception e)
          {
              var rwe = e as RuntimeWrappedException;
              if (rwe != null)
              {
                  object wrappedException = rwe.WrappedException;
                  MessageBox.Show(wrappedException.ToString());
              }
  
              if (unhandledInstalled)
                  throw;
  
              // No handler has been installed but handle it anyway.
              UnhandledException(null, new UnhandledExceptionEventArgs(e, true));
          }
  
          return -1;
      }
  
      private static void UnhandledException(object sender, UnhandledExceptionEventArgs args)
      {
          MessageBox.Show(args.ExceptionObject.ToString());
          Environment.Exit(-1);
      }
  
      private static void DispatcherUnhandledException(object sender,
                                                       DispatcherUnhandledExceptionEventArgs e)
      {
          // Do something here
          e.Handled = true;
      }
  }
  </code></pre>
  
  <p>Thank you !</p>