I want to catch all exceptions that have not been caught.

Though i have used try block in my code, but still some uncaught exception might be thrown.

I was trying this

Code:
AppDomain d;

d = AppDomain.CurrentDomain;
And then add a handler with signatures like

Code:
(Object s ,UnhandledExceptionEventArgs e)
followed by

Code:
Exception ex;
ex = (Exception) e.ExceptionObject;
But i dont knw if this is right and if it is, where do i place this?