Fixed divide by zero if the application has run out of GDI handles and is trying to show an error dialog