To test this problem I have written a minimal windows application. If I force an access violation in the WM_PAINT handler this exception never gets to the debug
WM_PAINT
It's a known defect. Check the hotfix. http://support.microsoft.com/kb/976038