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

AppDomain d;

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

(Object s ,UnhandledExceptionEventArgs e)
followed by

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