I am hosting Juce windows in some plugin code(*) inside a win32 application and its window hierarchy. (Using Component::addToDesktop etc) I was puzzled by a long time how to avoid getting some problems when the application is shut down with the Juce windows still visible.
I was finally able to come up with a fix that apparently works by altering HWNDComponentPeer’s code in the peerWindowProc method by adding a WM_DESTROY handler :
case WM_DESTROY: getComponent().removeFromDesktop(); break;
Does this seem like a change that could be part of the official JUCE source? If not, is there some other way how to deal with this situation, namely the host application/Windows destroying JUCE windows which have had addToDesktop called on them?
(*) Reaper extension plugins, which are not VST or similar plugins, but another plugin type entirely.