Fix destruction of wxNativeContainerWindow in wxMSW.

WM_CLOSE was not processed at all for native windows wrapped by
wxNativeContainerWindow because we don't handle it ourselves at wxWindow level
but still mark it as processed in order to prevent DefWindowProc() from
destroying the window. Unfortunately this also prevented the original handler
for this message in the native window from being called.

Calling just the original handler and not the wxWidgets one is not ideal
neither but is much better as it allows to e.g. close MFC frames wrapped in
wxNativeContainerWindow whereas before this didn't work at all as WM_CLOSE was
completely ignored.

Also call the original handler for WM_DESTROY to avoid similar potential
problems with this message, even if it doesn't seem to create any with MFC.

Extend the mfc sample to show how a wxPanel can be embedded into the existing
CFrameWnd.
This commit is contained in:
Vadim Zeitlin
2015-07-09 20:06:48 +02:00
parent 394b04b7e4
commit 9be928d6fb
3 changed files with 65 additions and 3 deletions

View File

@@ -26,6 +26,9 @@ public:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
class wxNativeContainerWindow* m_containerWX;
};
// A dummy CWnd pointing to a wxWindow's HWND