U can also subclass that window then intercept its WM_DESTROY message.