When our window is destroyed, our timers are also destroyed. This causes our attempt at destruction to fail. Instead, set MessageHWND to NULL in the WM_DESTROY handler and don't try destroying the timers if the window is gone.
When our window is destroyed, our timers are also destroyed. This causes our attempt at destruction to fail. Instead, set MessageHWND to NULL in the WM_DESTROY handler and don't try destroying the timers if the window is gone.