From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 10 Oct 2011 10:53:23 +0000 (+0000)
Subject: Move wxTopLevelWindow::SetShape() down to wxNonOwnedWindow.
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5bd0ee99664dbfdfa6b95db24eac0cab93583d46

Move wxTopLevelWindow::SetShape() down to wxNonOwnedWindow.

Also add wxNonOwnedWindow for wxMSW (which previously simply typedef'd it to
wxWindow) and document this class now that it provides some user-visible
functionality.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/Makefile.in b/Makefile.in
index dd2fef9055..624cbb8ef6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2652,6 +2652,7 @@ COND_TOOLKIT_MOTIF_LOWLEVEL_HDR =  \
 	wx/x11/region.h
 @COND_TOOLKIT_MOTIF@LOWLEVEL_HDR = $(COND_TOOLKIT_MOTIF_LOWLEVEL_HDR)
 COND_TOOLKIT_MSW_LOWLEVEL_HDR =  \
+	wx/msw/nonownedwnd.h \
 	wx/msw/ole/activex.h \
 	wx/msw/popupwin.h \
 	wx/msw/uxtheme.h \
@@ -2665,6 +2666,7 @@ COND_TOOLKIT_MSW_LOWLEVEL_HDR =  \
 @COND_TOOLKIT_OSX_IPHONE@LOWLEVEL_HDR = 
 @COND_TOOLKIT_PM@LOWLEVEL_HDR = 
 COND_TOOLKIT_WINCE_LOWLEVEL_HDR =  \
+	wx/msw/nonownedwnd.h \
 	wx/msw/ole/activex.h \
 	wx/msw/popupwin.h \
 	wx/msw/uxtheme.h \
@@ -5127,6 +5129,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS =  \
 	monodll_msw_icon.o \
 	monodll_msw_imaglist.o \
 	monodll_msw_minifram.o \
+	monodll_msw_nonownedwnd.o \
 	monodll_ole_dataobj.o \
 	monodll_dropsrc.o \
 	monodll_droptgt.o \
@@ -5186,6 +5189,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS =  \
 	monodll_msw_icon.o \
 	monodll_msw_imaglist.o \
 	monodll_msw_minifram.o \
+	monodll_msw_nonownedwnd.o \
 	monodll_ole_dataobj.o \
 	monodll_dropsrc.o \
 	monodll_droptgt.o \
@@ -6007,6 +6011,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_1 =  \
 	monodll_msw_icon.o \
 	monodll_msw_imaglist.o \
 	monodll_msw_minifram.o \
+	monodll_msw_nonownedwnd.o \
 	monodll_ole_dataobj.o \
 	monodll_dropsrc.o \
 	monodll_droptgt.o \
@@ -6066,6 +6071,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_1 =  \
 	monodll_msw_icon.o \
 	monodll_msw_imaglist.o \
 	monodll_msw_minifram.o \
+	monodll_msw_nonownedwnd.o \
 	monodll_ole_dataobj.o \
 	monodll_dropsrc.o \
 	monodll_droptgt.o \
@@ -7077,6 +7083,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_2 =  \
 	monolib_msw_icon.o \
 	monolib_msw_imaglist.o \
 	monolib_msw_minifram.o \
+	monolib_msw_nonownedwnd.o \
 	monolib_ole_dataobj.o \
 	monolib_dropsrc.o \
 	monolib_droptgt.o \
@@ -7136,6 +7143,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_2 =  \
 	monolib_msw_icon.o \
 	monolib_msw_imaglist.o \
 	monolib_msw_minifram.o \
+	monolib_msw_nonownedwnd.o \
 	monolib_ole_dataobj.o \
 	monolib_dropsrc.o \
 	monolib_droptgt.o \
@@ -7957,6 +7965,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_3 =  \
 	monolib_msw_icon.o \
 	monolib_msw_imaglist.o \
 	monolib_msw_minifram.o \
+	monolib_msw_nonownedwnd.o \
 	monolib_ole_dataobj.o \
 	monolib_dropsrc.o \
 	monolib_droptgt.o \
@@ -8016,6 +8025,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_3 =  \
 	monolib_msw_icon.o \
 	monolib_msw_imaglist.o \
 	monolib_msw_minifram.o \
+	monolib_msw_nonownedwnd.o \
 	monolib_ole_dataobj.o \
 	monolib_dropsrc.o \
 	monolib_droptgt.o \
@@ -9206,6 +9216,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_4 =  \
 	coredll_msw_icon.o \
 	coredll_msw_imaglist.o \
 	coredll_msw_minifram.o \
+	coredll_msw_nonownedwnd.o \
 	coredll_ole_dataobj.o \
 	coredll_dropsrc.o \
 	coredll_droptgt.o \
@@ -9265,6 +9276,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_4 =  \
 	coredll_msw_icon.o \
 	coredll_msw_imaglist.o \
 	coredll_msw_minifram.o \
+	coredll_msw_nonownedwnd.o \
 	coredll_ole_dataobj.o \
 	coredll_dropsrc.o \
 	coredll_droptgt.o \
@@ -10086,6 +10098,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_5 =  \
 	coredll_msw_icon.o \
 	coredll_msw_imaglist.o \
 	coredll_msw_minifram.o \
+	coredll_msw_nonownedwnd.o \
 	coredll_ole_dataobj.o \
 	coredll_dropsrc.o \
 	coredll_droptgt.o \
@@ -10145,6 +10158,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_5 =  \
 	coredll_msw_icon.o \
 	coredll_msw_imaglist.o \
 	coredll_msw_minifram.o \
+	coredll_msw_nonownedwnd.o \
 	coredll_ole_dataobj.o \
 	coredll_dropsrc.o \
 	coredll_droptgt.o \
@@ -10796,6 +10810,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_6 =  \
 	corelib_msw_icon.o \
 	corelib_msw_imaglist.o \
 	corelib_msw_minifram.o \
+	corelib_msw_nonownedwnd.o \
 	corelib_ole_dataobj.o \
 	corelib_dropsrc.o \
 	corelib_droptgt.o \
@@ -10855,6 +10870,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_6 =  \
 	corelib_msw_icon.o \
 	corelib_msw_imaglist.o \
 	corelib_msw_minifram.o \
+	corelib_msw_nonownedwnd.o \
 	corelib_ole_dataobj.o \
 	corelib_dropsrc.o \
 	corelib_droptgt.o \
@@ -11676,6 +11692,7 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_7 =  \
 	corelib_msw_icon.o \
 	corelib_msw_imaglist.o \
 	corelib_msw_minifram.o \
+	corelib_msw_nonownedwnd.o \
 	corelib_ole_dataobj.o \
 	corelib_dropsrc.o \
 	corelib_droptgt.o \
@@ -11735,6 +11752,7 @@ COND_TOOLKIT_WINCE___LOWLEVEL_SRC_OBJECTS_7 =  \
 	corelib_msw_icon.o \
 	corelib_msw_imaglist.o \
 	corelib_msw_minifram.o \
+	corelib_msw_nonownedwnd.o \
 	corelib_ole_dataobj.o \
 	corelib_dropsrc.o \
 	corelib_droptgt.o \
@@ -18393,6 +18411,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@monodll_msw_minifram.o: $(srcdir)/src/msw/minifram.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/minifram.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monodll_ole_dataobj.o: $(srcdir)/src/msw/ole/dataobj.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/dataobj.cpp
 
@@ -23760,6 +23784,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@monolib_msw_minifram.o: $(srcdir)/src/msw/minifram.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/minifram.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monolib_ole_dataobj.o: $(srcdir)/src/msw/ole/dataobj.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/dataobj.cpp
 
@@ -29286,6 +29316,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@coredll_msw_minifram.o: $(srcdir)/src/msw/minifram.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/minifram.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@coredll_ole_dataobj.o: $(srcdir)/src/msw/ole/dataobj.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/dataobj.cpp
 
@@ -33294,6 +33330,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@corelib_msw_minifram.o: $(srcdir)/src/msw/minifram.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/minifram.cpp
 
+@COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_msw_nonownedwnd.o: $(srcdir)/src/msw/nonownedwnd.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@	$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/nonownedwnd.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@corelib_ole_dataobj.o: $(srcdir)/src/msw/ole/dataobj.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@	$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/dataobj.cpp
 
diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl
index f99d7710bd..4069889063 100644
--- a/build/bakefiles/files.bkl
+++ b/build/bakefiles/files.bkl
@@ -1686,6 +1686,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/msw/icon.cpp
     src/msw/imaglist.cpp
     src/msw/minifram.cpp
+    src/msw/nonownedwnd.cpp
     src/msw/ole/dataobj.cpp
     src/msw/ole/dropsrc.cpp
     src/msw/ole/droptgt.cpp
@@ -1706,6 +1707,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/msw/window.cpp
 </set>
 <set var="MSW_LOWLEVEL_HDR" hints="files">
+    wx/msw/nonownedwnd.h
     wx/msw/ole/activex.h
     wx/msw/popupwin.h
     wx/msw/uxtheme.h
diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc
index f137753783..4e6047c9b4 100644
--- a/build/msw/makefile.bcc
+++ b/build/msw/makefile.bcc
@@ -1746,6 +1746,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.obj \
 	$(OBJS)\monodll_imaglist.obj \
 	$(OBJS)\monodll_minifram.obj \
+	$(OBJS)\monodll_nonownedwnd.obj \
 	$(OBJS)\monodll_dataobj.obj \
 	$(OBJS)\monodll_dropsrc.obj \
 	$(OBJS)\monodll_droptgt.obj \
@@ -2018,6 +2019,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.obj \
 	$(OBJS)\monodll_imaglist.obj \
 	$(OBJS)\monodll_minifram.obj \
+	$(OBJS)\monodll_nonownedwnd.obj \
 	$(OBJS)\monodll_dataobj.obj \
 	$(OBJS)\monodll_dropsrc.obj \
 	$(OBJS)\monodll_droptgt.obj \
@@ -2523,6 +2525,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.obj \
 	$(OBJS)\monolib_imaglist.obj \
 	$(OBJS)\monolib_minifram.obj \
+	$(OBJS)\monolib_nonownedwnd.obj \
 	$(OBJS)\monolib_dataobj.obj \
 	$(OBJS)\monolib_dropsrc.obj \
 	$(OBJS)\monolib_droptgt.obj \
@@ -2795,6 +2798,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.obj \
 	$(OBJS)\monolib_imaglist.obj \
 	$(OBJS)\monolib_minifram.obj \
+	$(OBJS)\monolib_nonownedwnd.obj \
 	$(OBJS)\monolib_dataobj.obj \
 	$(OBJS)\monolib_dropsrc.obj \
 	$(OBJS)\monolib_droptgt.obj \
@@ -3183,6 +3187,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.obj \
 	$(OBJS)\coredll_imaglist.obj \
 	$(OBJS)\coredll_minifram.obj \
+	$(OBJS)\coredll_nonownedwnd.obj \
 	$(OBJS)\coredll_dataobj.obj \
 	$(OBJS)\coredll_dropsrc.obj \
 	$(OBJS)\coredll_droptgt.obj \
@@ -3455,6 +3460,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.obj \
 	$(OBJS)\coredll_imaglist.obj \
 	$(OBJS)\coredll_minifram.obj \
+	$(OBJS)\coredll_nonownedwnd.obj \
 	$(OBJS)\coredll_dataobj.obj \
 	$(OBJS)\coredll_dropsrc.obj \
 	$(OBJS)\coredll_droptgt.obj \
@@ -3725,6 +3731,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.obj \
 	$(OBJS)\corelib_imaglist.obj \
 	$(OBJS)\corelib_minifram.obj \
+	$(OBJS)\corelib_nonownedwnd.obj \
 	$(OBJS)\corelib_dataobj.obj \
 	$(OBJS)\corelib_dropsrc.obj \
 	$(OBJS)\corelib_droptgt.obj \
@@ -3997,6 +4004,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.obj \
 	$(OBJS)\corelib_imaglist.obj \
 	$(OBJS)\corelib_minifram.obj \
+	$(OBJS)\corelib_nonownedwnd.obj \
 	$(OBJS)\corelib_dataobj.obj \
 	$(OBJS)\corelib_dropsrc.obj \
 	$(OBJS)\corelib_droptgt.obj \
@@ -7281,6 +7289,11 @@ $(OBJS)\monodll_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -9668,6 +9681,11 @@ $(OBJS)\monolib_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -12025,6 +12043,11 @@ $(OBJS)\coredll_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -13433,6 +13456,11 @@ $(OBJS)\corelib_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc
index e33065481b..5973775952 100644
--- a/build/msw/makefile.gcc
+++ b/build/msw/makefile.gcc
@@ -1758,6 +1758,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.o \
 	$(OBJS)\monodll_imaglist.o \
 	$(OBJS)\monodll_minifram.o \
+	$(OBJS)\monodll_nonownedwnd.o \
 	$(OBJS)\monodll_dataobj.o \
 	$(OBJS)\monodll_dropsrc.o \
 	$(OBJS)\monodll_droptgt.o \
@@ -2032,6 +2033,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.o \
 	$(OBJS)\monodll_imaglist.o \
 	$(OBJS)\monodll_minifram.o \
+	$(OBJS)\monodll_nonownedwnd.o \
 	$(OBJS)\monodll_dataobj.o \
 	$(OBJS)\monodll_dropsrc.o \
 	$(OBJS)\monodll_droptgt.o \
@@ -2541,6 +2543,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.o \
 	$(OBJS)\monolib_imaglist.o \
 	$(OBJS)\monolib_minifram.o \
+	$(OBJS)\monolib_nonownedwnd.o \
 	$(OBJS)\monolib_dataobj.o \
 	$(OBJS)\monolib_dropsrc.o \
 	$(OBJS)\monolib_droptgt.o \
@@ -2815,6 +2818,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.o \
 	$(OBJS)\monolib_imaglist.o \
 	$(OBJS)\monolib_minifram.o \
+	$(OBJS)\monolib_nonownedwnd.o \
 	$(OBJS)\monolib_dataobj.o \
 	$(OBJS)\monolib_dropsrc.o \
 	$(OBJS)\monolib_droptgt.o \
@@ -3217,6 +3221,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.o \
 	$(OBJS)\coredll_imaglist.o \
 	$(OBJS)\coredll_minifram.o \
+	$(OBJS)\coredll_nonownedwnd.o \
 	$(OBJS)\coredll_dataobj.o \
 	$(OBJS)\coredll_dropsrc.o \
 	$(OBJS)\coredll_droptgt.o \
@@ -3491,6 +3496,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.o \
 	$(OBJS)\coredll_imaglist.o \
 	$(OBJS)\coredll_minifram.o \
+	$(OBJS)\coredll_nonownedwnd.o \
 	$(OBJS)\coredll_dataobj.o \
 	$(OBJS)\coredll_dropsrc.o \
 	$(OBJS)\coredll_droptgt.o \
@@ -3767,6 +3773,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.o \
 	$(OBJS)\corelib_imaglist.o \
 	$(OBJS)\corelib_minifram.o \
+	$(OBJS)\corelib_nonownedwnd.o \
 	$(OBJS)\corelib_dataobj.o \
 	$(OBJS)\corelib_dropsrc.o \
 	$(OBJS)\corelib_droptgt.o \
@@ -4041,6 +4048,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.o \
 	$(OBJS)\corelib_imaglist.o \
 	$(OBJS)\corelib_minifram.o \
+	$(OBJS)\corelib_nonownedwnd.o \
 	$(OBJS)\corelib_dataobj.o \
 	$(OBJS)\corelib_dropsrc.o \
 	$(OBJS)\corelib_droptgt.o \
@@ -7449,6 +7457,11 @@ $(OBJS)\monodll_minifram.o: ../../src/msw/minifram.cpp
 endif
 
 ifeq ($(USE_GUI),1)
+$(OBJS)\monodll_nonownedwnd.o: ../../src/msw/nonownedwnd.cpp
+	$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monodll_dataobj.o: ../../src/msw/ole/dataobj.cpp
 	$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
 endif
@@ -9836,6 +9849,11 @@ $(OBJS)\monolib_minifram.o: ../../src/msw/minifram.cpp
 endif
 
 ifeq ($(USE_GUI),1)
+$(OBJS)\monolib_nonownedwnd.o: ../../src/msw/nonownedwnd.cpp
+	$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monolib_dataobj.o: ../../src/msw/ole/dataobj.cpp
 	$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
 endif
@@ -12193,6 +12211,11 @@ $(OBJS)\coredll_minifram.o: ../../src/msw/minifram.cpp
 endif
 
 ifeq ($(USE_GUI),1)
+$(OBJS)\coredll_nonownedwnd.o: ../../src/msw/nonownedwnd.cpp
+	$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\coredll_dataobj.o: ../../src/msw/ole/dataobj.cpp
 	$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
 endif
@@ -13601,6 +13624,11 @@ $(OBJS)\corelib_minifram.o: ../../src/msw/minifram.cpp
 endif
 
 ifeq ($(USE_GUI),1)
+$(OBJS)\corelib_nonownedwnd.o: ../../src/msw/nonownedwnd.cpp
+	$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\corelib_dataobj.o: ../../src/msw/ole/dataobj.cpp
 	$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
 endif
diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc
index 08fb453f4d..2747640a40 100644
--- a/build/msw/makefile.vc
+++ b/build/msw/makefile.vc
@@ -1960,6 +1960,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.obj \
 	$(OBJS)\monodll_imaglist.obj \
 	$(OBJS)\monodll_minifram.obj \
+	$(OBJS)\monodll_nonownedwnd.obj \
 	$(OBJS)\monodll_dataobj.obj \
 	$(OBJS)\monodll_dropsrc.obj \
 	$(OBJS)\monodll_droptgt.obj \
@@ -2232,6 +2233,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
 	$(OBJS)\monodll_icon.obj \
 	$(OBJS)\monodll_imaglist.obj \
 	$(OBJS)\monodll_minifram.obj \
+	$(OBJS)\monodll_nonownedwnd.obj \
 	$(OBJS)\monodll_dataobj.obj \
 	$(OBJS)\monodll_dropsrc.obj \
 	$(OBJS)\monodll_droptgt.obj \
@@ -2743,6 +2745,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.obj \
 	$(OBJS)\monolib_imaglist.obj \
 	$(OBJS)\monolib_minifram.obj \
+	$(OBJS)\monolib_nonownedwnd.obj \
 	$(OBJS)\monolib_dataobj.obj \
 	$(OBJS)\monolib_dropsrc.obj \
 	$(OBJS)\monolib_droptgt.obj \
@@ -3015,6 +3018,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
 	$(OBJS)\monolib_icon.obj \
 	$(OBJS)\monolib_imaglist.obj \
 	$(OBJS)\monolib_minifram.obj \
+	$(OBJS)\monolib_nonownedwnd.obj \
 	$(OBJS)\monolib_dataobj.obj \
 	$(OBJS)\monolib_dropsrc.obj \
 	$(OBJS)\monolib_droptgt.obj \
@@ -3469,6 +3473,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.obj \
 	$(OBJS)\coredll_imaglist.obj \
 	$(OBJS)\coredll_minifram.obj \
+	$(OBJS)\coredll_nonownedwnd.obj \
 	$(OBJS)\coredll_dataobj.obj \
 	$(OBJS)\coredll_dropsrc.obj \
 	$(OBJS)\coredll_droptgt.obj \
@@ -3741,6 +3746,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
 	$(OBJS)\coredll_icon.obj \
 	$(OBJS)\coredll_imaglist.obj \
 	$(OBJS)\coredll_minifram.obj \
+	$(OBJS)\coredll_nonownedwnd.obj \
 	$(OBJS)\coredll_dataobj.obj \
 	$(OBJS)\coredll_dropsrc.obj \
 	$(OBJS)\coredll_droptgt.obj \
@@ -4017,6 +4023,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.obj \
 	$(OBJS)\corelib_imaglist.obj \
 	$(OBJS)\corelib_minifram.obj \
+	$(OBJS)\corelib_nonownedwnd.obj \
 	$(OBJS)\corelib_dataobj.obj \
 	$(OBJS)\corelib_dropsrc.obj \
 	$(OBJS)\corelib_droptgt.obj \
@@ -4289,6 +4296,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
 	$(OBJS)\corelib_icon.obj \
 	$(OBJS)\corelib_imaglist.obj \
 	$(OBJS)\corelib_minifram.obj \
+	$(OBJS)\corelib_nonownedwnd.obj \
 	$(OBJS)\corelib_dataobj.obj \
 	$(OBJS)\corelib_dropsrc.obj \
 	$(OBJS)\corelib_droptgt.obj \
@@ -7887,6 +7895,11 @@ $(OBJS)\monodll_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -10274,6 +10287,11 @@ $(OBJS)\monolib_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -12631,6 +12649,11 @@ $(OBJS)\coredll_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
@@ -14039,6 +14062,11 @@ $(OBJS)\corelib_minifram.obj: ..\..\src\msw\minifram.cpp
 !endif
 
 !if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_nonownedwnd.obj: ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\nonownedwnd.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_dataobj.obj: ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\dataobj.cpp
 !endif
diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat
index ce5ccccf31..728f2d636e 100644
--- a/build/msw/makefile.wat
+++ b/build/msw/makefile.wat
@@ -275,6 +275,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
 	$(OBJS)\monodll_icon.obj &
 	$(OBJS)\monodll_imaglist.obj &
 	$(OBJS)\monodll_minifram.obj &
+	$(OBJS)\monodll_nonownedwnd.obj &
 	$(OBJS)\monodll_dataobj.obj &
 	$(OBJS)\monodll_dropsrc.obj &
 	$(OBJS)\monodll_droptgt.obj &
@@ -549,6 +550,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
 	$(OBJS)\monodll_icon.obj &
 	$(OBJS)\monodll_imaglist.obj &
 	$(OBJS)\monodll_minifram.obj &
+	$(OBJS)\monodll_nonownedwnd.obj &
 	$(OBJS)\monodll_dataobj.obj &
 	$(OBJS)\monodll_dropsrc.obj &
 	$(OBJS)\monodll_droptgt.obj &
@@ -1063,6 +1065,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
 	$(OBJS)\monolib_icon.obj &
 	$(OBJS)\monolib_imaglist.obj &
 	$(OBJS)\monolib_minifram.obj &
+	$(OBJS)\monolib_nonownedwnd.obj &
 	$(OBJS)\monolib_dataobj.obj &
 	$(OBJS)\monolib_dropsrc.obj &
 	$(OBJS)\monolib_droptgt.obj &
@@ -1337,6 +1340,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
 	$(OBJS)\monolib_icon.obj &
 	$(OBJS)\monolib_imaglist.obj &
 	$(OBJS)\monolib_minifram.obj &
+	$(OBJS)\monolib_nonownedwnd.obj &
 	$(OBJS)\monolib_dataobj.obj &
 	$(OBJS)\monolib_dropsrc.obj &
 	$(OBJS)\monolib_droptgt.obj &
@@ -1750,6 +1754,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
 	$(OBJS)\coredll_icon.obj &
 	$(OBJS)\coredll_imaglist.obj &
 	$(OBJS)\coredll_minifram.obj &
+	$(OBJS)\coredll_nonownedwnd.obj &
 	$(OBJS)\coredll_dataobj.obj &
 	$(OBJS)\coredll_dropsrc.obj &
 	$(OBJS)\coredll_droptgt.obj &
@@ -2024,6 +2029,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
 	$(OBJS)\coredll_icon.obj &
 	$(OBJS)\coredll_imaglist.obj &
 	$(OBJS)\coredll_minifram.obj &
+	$(OBJS)\coredll_nonownedwnd.obj &
 	$(OBJS)\coredll_dataobj.obj &
 	$(OBJS)\coredll_dropsrc.obj &
 	$(OBJS)\coredll_droptgt.obj &
@@ -2302,6 +2308,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
 	$(OBJS)\corelib_icon.obj &
 	$(OBJS)\corelib_imaglist.obj &
 	$(OBJS)\corelib_minifram.obj &
+	$(OBJS)\corelib_nonownedwnd.obj &
 	$(OBJS)\corelib_dataobj.obj &
 	$(OBJS)\corelib_dropsrc.obj &
 	$(OBJS)\corelib_droptgt.obj &
@@ -2576,6 +2583,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
 	$(OBJS)\corelib_icon.obj &
 	$(OBJS)\corelib_imaglist.obj &
 	$(OBJS)\corelib_minifram.obj &
+	$(OBJS)\corelib_nonownedwnd.obj &
 	$(OBJS)\corelib_dataobj.obj &
 	$(OBJS)\corelib_dropsrc.obj &
 	$(OBJS)\corelib_droptgt.obj &
@@ -7720,6 +7728,11 @@ $(OBJS)\monodll_minifram.obj :  .AUTODEPEND ..\..\src\msw\minifram.cpp
 !endif
 
 !ifeq USE_GUI 1
+$(OBJS)\monodll_nonownedwnd.obj :  .AUTODEPEND ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monodll_dataobj.obj :  .AUTODEPEND ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
 !endif
@@ -10107,6 +10120,11 @@ $(OBJS)\monolib_minifram.obj :  .AUTODEPEND ..\..\src\msw\minifram.cpp
 !endif
 
 !ifeq USE_GUI 1
+$(OBJS)\monolib_nonownedwnd.obj :  .AUTODEPEND ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monolib_dataobj.obj :  .AUTODEPEND ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
 !endif
@@ -12464,6 +12482,11 @@ $(OBJS)\coredll_minifram.obj :  .AUTODEPEND ..\..\src\msw\minifram.cpp
 !endif
 
 !ifeq USE_GUI 1
+$(OBJS)\coredll_nonownedwnd.obj :  .AUTODEPEND ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\coredll_dataobj.obj :  .AUTODEPEND ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
 !endif
@@ -13872,6 +13895,11 @@ $(OBJS)\corelib_minifram.obj :  .AUTODEPEND ..\..\src\msw\minifram.cpp
 !endif
 
 !ifeq USE_GUI 1
+$(OBJS)\corelib_nonownedwnd.obj :  .AUTODEPEND ..\..\src\msw\nonownedwnd.cpp
+	$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\corelib_dataobj.obj :  .AUTODEPEND ..\..\src\msw\ole\dataobj.cpp
 	$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
 !endif
diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp
index ed8cda79c6..55f85c60f1 100644
--- a/build/msw/wx_core.dsp
+++ b/build/msw/wx_core.dsp
@@ -2034,6 +2034,10 @@ SOURCE=..\..\src\msw\nativewin.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\src\msw\nonownedwnd.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\msw\notebook.cpp
 
 !IF  "$(CFG)" == "core - Win32 DLL Universal Release"
@@ -5280,6 +5284,10 @@ SOURCE=..\..\include\wx\msw\msvcrt.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\include\wx\msw\nonownedwnd.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\wx\msw\notebook.h
 # End Source File
 # Begin Source File
diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj
index 9ec402b2bd..0119ad154e 100644
--- a/build/msw/wx_vc7_core.vcproj
+++ b/build/msw/wx_vc7_core.vcproj
@@ -1895,6 +1895,9 @@
 					ExcludedFromBuild="TRUE"/>
 			</File>
 			<File
+				RelativePath="..\..\src\msw\nonownedwnd.cpp">
+			</File>
+			<File
 				RelativePath="..\..\src\msw\notebook.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -4532,6 +4535,9 @@
 				RelativePath="..\..\include\wx\msw\msvcrt.h">
 			</File>
 			<File
+				RelativePath="..\..\include\wx\msw\nonownedwnd.h">
+			</File>
+			<File
 				RelativePath="..\..\include\wx\msw\notebook.h">
 			</File>
 			<File
diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj
index f8947d47c3..9717ff19b8 100644
--- a/build/msw/wx_vc8_core.vcproj
+++ b/build/msw/wx_vc8_core.vcproj
@@ -2560,6 +2560,10 @@
 				/>
 			</File>
 			<File
+				RelativePath="..\..\src\msw\nonownedwnd.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\msw\notebook.cpp"
 				>
 				<FileConfiguration
@@ -6064,6 +6068,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\wx\msw\nonownedwnd.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\wx\msw\notebook.h"
 				>
 			</File>
diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj
index f7ebb18e4c..431dd60e8f 100644
--- a/build/msw/wx_vc9_core.vcproj
+++ b/build/msw/wx_vc9_core.vcproj
@@ -2556,6 +2556,10 @@
 				/>
 			</File>
 			<File
+				RelativePath="..\..\src\msw\nonownedwnd.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\msw\notebook.cpp"
 				>
 				<FileConfiguration
@@ -6060,6 +6064,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\include\wx\msw\nonownedwnd.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\wx\msw\notebook.h"
 				>
 			</File>
diff --git a/include/wx/dfb/nonownedwnd.h b/include/wx/dfb/nonownedwnd.h
index 66176215b0..4cba760b3e 100644
--- a/include/wx/dfb/nonownedwnd.h
+++ b/include/wx/dfb/nonownedwnd.h
@@ -29,7 +29,7 @@ class wxDFBEventsHandler;
 // wxFrame is non-owned, because even though it can have a parent, it's
 // location is independent of it.  This class is for internal use only, it's
 // the base class for wxTopLevelWindow and wxPopupWindow.
-class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxWindow
+class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
 {
 public:
     // construction
diff --git a/include/wx/msw/nonownedwnd.h b/include/wx/msw/nonownedwnd.h
new file mode 100644
index 0000000000..b9528dbc88
--- /dev/null
+++ b/include/wx/msw/nonownedwnd.h
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/msw/nonownedwnd.h
+// Purpose:     wxNonOwnedWindow declaration for wxMSW.
+// Author:      Vadim Zeitlin
+// Created:     2011-10-09
+// RCS-ID:      $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_NONOWNEDWND_H_
+#define _WX_MSW_NONOWNEDWND_H_
+
+// ----------------------------------------------------------------------------
+// wxNonOwnedWindow
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
+{
+public:
+#ifndef __WXWINCE__
+    virtual bool SetShape(const wxRegion& region);
+#endif // !__WXWINCE__
+};
+
+#endif // _WX_MSW_NONOWNEDWND_H_
diff --git a/include/wx/msw/toplevel.h b/include/wx/msw/toplevel.h
index 39756b355b..ec937af348 100644
--- a/include/wx/msw/toplevel.h
+++ b/include/wx/msw/toplevel.h
@@ -57,9 +57,6 @@ public:
 
     virtual void SetLayoutDirection(wxLayoutDirection dir);
 
-#ifndef __WXWINCE__
-    virtual bool SetShape(const wxRegion& region);
-#endif // __WXWINCE__
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
 
     virtual bool Show(bool show = true);
diff --git a/include/wx/nonownedwnd.h b/include/wx/nonownedwnd.h
index 45cb0bea41..a7d35144d2 100644
--- a/include/wx/nonownedwnd.h
+++ b/include/wx/nonownedwnd.h
@@ -12,15 +12,35 @@
 #ifndef _WX_NONOWNEDWND_H_
 #define _WX_NONOWNEDWND_H_
 
+#include "wx/window.h"
+
+// ----------------------------------------------------------------------------
+// wxNonOwnedWindow: a window that is not a child window of another one.
+// ----------------------------------------------------------------------------
+
+class wxNonOwnedWindowBase : public wxWindow
+{
+public:
+    // Set the shape of the window to the given region.
+    // Returns true if the platform supports this feature (and the
+    // operation is successful.)
+    virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return false; }
+
+};
+
 #if defined(__WXDFB__)
     #include "wx/dfb/nonownedwnd.h"
 #elif defined(__WXMAC__)
     #include "wx/osx/nonownedwnd.h"
+#elif defined(__WXMSW__)
+    #include "wx/msw/nonownedwnd.h"
 #else
-    // other ports can derive both wxTLW and wxPopupWindow directly
-    // from wxWindow:
-    #include "wx/window.h"
-    typedef wxWindow wxNonOwnedWindow;
+    // No special class needed in other ports, they can derive both wxTLW and
+    // wxPopupWindow directly from wxWindow and don't implement SetShape() (at
+    // least at this level, wxGTK does do it in wxTLW).
+    class wxNonOwnedWindow : public wxNonOwnedWindowBase
+    {
+    };
 #endif
 
 #endif // _WX_NONOWNEDWND_H_
diff --git a/include/wx/osx/nonownedwnd.h b/include/wx/osx/nonownedwnd.h
index 3eb1b2e1f0..60ea912021 100644
--- a/include/wx/osx/nonownedwnd.h
+++ b/include/wx/osx/nonownedwnd.h
@@ -30,7 +30,7 @@
 
 class wxNonOwnedWindowImpl;
 
-class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxWindow
+class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
 {
 public:
     // constructors and such
@@ -79,7 +79,7 @@ public:
     // implementation from now on
     // --------------------------
 
-    virtual bool DoSetShape(const wxRegion& region);
+    virtual bool SetShape(const wxRegion& region);
     const wxRegion& GetShape() const { return m_shape; }
 
     // activation hooks only necessary for MDI Implementation
diff --git a/include/wx/osx/toplevel.h b/include/wx/osx/toplevel.h
index 262c3e8aa5..bfb7a1a95f 100644
--- a/include/wx/osx/toplevel.h
+++ b/include/wx/osx/toplevel.h
@@ -51,9 +51,6 @@ public:
 
     virtual wxPoint GetClientAreaOrigin() const;
 
-    virtual bool SetShape(const wxRegion& region)
-        { return DoSetShape(region); }
-
     // Attracts the users attention to this window if the application is
     // inactive (should be called when a background event occurs)
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h
index 1e49a42dd9..4ce0e67683 100644
--- a/include/wx/toplevel.h
+++ b/include/wx/toplevel.h
@@ -219,11 +219,6 @@ public:
     // enable/disable close button [x]
     virtual bool EnableCloseButton(bool WXUNUSED(enable) ) { return false; }
 
-    // Set the shape of the window to the given region.
-    // Returns true if the platform supports this feature (and the
-    // operation is successful.)
-    virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return false; }
-
     // Attracts the users attention to this window if the application is
     // inactive (should be called when a background event occurs)
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
diff --git a/interface/wx/nonownedwnd.h b/interface/wx/nonownedwnd.h
new file mode 100644
index 0000000000..7db6d66037
--- /dev/null
+++ b/interface/wx/nonownedwnd.h
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        interface/wx/nonownedwnd.h
+// Purpose:     wxNonOwnedWindow class documentation
+// Author:      Vadim Zeitlin
+// Created:     2011-10-09
+// RCS-ID:      $Id$
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+    Common base class for all non-child windows.
+
+    This is the common base class of wxTopLevelWindow and wxPopupWindow and is
+    not used directly.
+
+    Currently the only additional functionality it provides, compared to base
+    wxWindow class, is the ability to set the window shape.
+
+    @since 2.9.3
+ */
+class wxNonOwnedWindow : public wxWindow
+{
+public:
+    /**
+        If the platform supports it, sets the shape of the window to that
+        depicted by @a region. The system will not display or respond to any
+        mouse event for the pixels that lie outside of the region. To reset the
+        window to the normal rectangular shape simply call SetShape() again with
+        an empty wxRegion. Returns @true if the operation is successful.
+
+        This method is available in this class only since wxWidgets 2.9.3,
+        previous versions only provided it in wxTopLevelWindow.
+    */
+    virtual bool SetShape(const wxRegion& region);
+};
diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h
index cd00995b2d..813925bf27 100644
--- a/interface/wx/toplevel.h
+++ b/interface/wx/toplevel.h
@@ -68,7 +68,7 @@ enum
 
     @see wxDialog, wxFrame
 */
-class wxTopLevelWindow : public wxWindow
+class wxTopLevelWindow : public wxNonOwnedWindow
 {
 public:
     /**
@@ -398,15 +398,6 @@ public:
                       const wxString& label = wxEmptyString,
                       wxMenu* subMenu = NULL);
 
-    /**
-        If the platform supports it, sets the shape of the window to that
-        depicted by @a region. The system will not display or respond to any
-        mouse event for the pixels that lie outside of the region. To reset the
-        window to the normal rectangular shape simply call SetShape() again with
-        an empty wxRegion. Returns @true if the operation is successful.
-    */
-    virtual bool SetShape(const wxRegion& region);
-
     /**
         Allows specification of minimum and maximum window sizes, and window
         size increments. If a pair of values is not set (or set to -1), no
diff --git a/src/msw/nonownedwnd.cpp b/src/msw/nonownedwnd.cpp
new file mode 100644
index 0000000000..d5818a21e5
--- /dev/null
+++ b/src/msw/nonownedwnd.cpp
@@ -0,0 +1,81 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/msw/nonownedwnd.cpp
+// Purpose:     wxNonOwnedWindow implementation for MSW.
+// Author:      Vadim Zeitlin
+// Created:     2011-10-09 (extracted from src/msw/toplevel.cpp)
+// RCS-ID:      $Id: $
+// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#endif // WX_PRECOMP
+
+#include "wx/nonownedwnd.h"
+
+// ============================================================================
+// wxNonOwnedWindow implementation
+// ============================================================================
+
+#ifndef __WXWINCE__
+
+bool wxNonOwnedWindow::SetShape(const wxRegion& region)
+{
+    wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
+                 wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
+
+    // The empty region signifies that the shape should be removed from the
+    // window.
+    if ( region.IsEmpty() )
+    {
+        if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0)
+        {
+            wxLogLastError(wxT("SetWindowRgn"));
+            return false;
+        }
+        return true;
+    }
+
+    // Windows takes ownership of the region, so
+    // we'll have to make a copy of the region to give to it.
+    DWORD noBytes = ::GetRegionData(GetHrgnOf(region), 0, NULL);
+    RGNDATA *rgnData = (RGNDATA*) new char[noBytes];
+    ::GetRegionData(GetHrgnOf(region), noBytes, rgnData);
+    HRGN hrgn = ::ExtCreateRegion(NULL, noBytes, rgnData);
+    delete[] (char*) rgnData;
+
+    // SetWindowRgn expects the region to be in coordinates
+    // relative to the window, not the client area.  Figure
+    // out the offset, if any.
+    RECT rect;
+    DWORD dwStyle =   ::GetWindowLong(GetHwnd(), GWL_STYLE);
+    DWORD dwExStyle = ::GetWindowLong(GetHwnd(), GWL_EXSTYLE);
+    ::GetClientRect(GetHwnd(), &rect);
+    ::AdjustWindowRectEx(&rect, dwStyle, ::GetMenu(GetHwnd()) != NULL, dwExStyle);
+    ::OffsetRgn(hrgn, -rect.left, -rect.top);
+
+    // Now call the shape API with the new region.
+    if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0)
+    {
+        wxLogLastError(wxT("SetWindowRgn"));
+        return false;
+    }
+    return true;
+}
+
+#endif // !__WXWINCE__
diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp
index 909d29bb87..f7329fe3c0 100644
--- a/src/msw/toplevel.cpp
+++ b/src/msw/toplevel.cpp
@@ -1170,54 +1170,6 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
     return true;
 }
 
-#ifndef __WXWINCE__
-
-bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
-{
-    wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
-                 wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
-
-    // The empty region signifies that the shape should be removed from the
-    // window.
-    if ( region.IsEmpty() )
-    {
-        if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0)
-        {
-            wxLogLastError(wxT("SetWindowRgn"));
-            return false;
-        }
-        return true;
-    }
-
-    // Windows takes ownership of the region, so
-    // we'll have to make a copy of the region to give to it.
-    DWORD noBytes = ::GetRegionData(GetHrgnOf(region), 0, NULL);
-    RGNDATA *rgnData = (RGNDATA*) new char[noBytes];
-    ::GetRegionData(GetHrgnOf(region), noBytes, rgnData);
-    HRGN hrgn = ::ExtCreateRegion(NULL, noBytes, rgnData);
-    delete[] (char*) rgnData;
-
-    // SetWindowRgn expects the region to be in coordinants
-    // relative to the window, not the client area.  Figure
-    // out the offset, if any.
-    RECT rect;
-    DWORD dwStyle =   ::GetWindowLong(GetHwnd(), GWL_STYLE);
-    DWORD dwExStyle = ::GetWindowLong(GetHwnd(), GWL_EXSTYLE);
-    ::GetClientRect(GetHwnd(), &rect);
-    ::AdjustWindowRectEx(&rect, dwStyle, ::GetMenu(GetHwnd()) != NULL, dwExStyle);
-    ::OffsetRgn(hrgn, -rect.left, -rect.top);
-
-    // Now call the shape API with the new region.
-    if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0)
-    {
-        wxLogLastError(wxT("SetWindowRgn"));
-        return false;
-    }
-    return true;
-}
-
-#endif // !__WXWINCE__
-
 void wxTopLevelWindowMSW::RequestUserAttention(int flags)
 {
     // check if we can use FlashWindowEx(): unfortunately a simple test for
diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp
index c3f981a100..70cd61b5c4 100644
--- a/src/osx/nonownedwnd_osx.cpp
+++ b/src/osx/nonownedwnd_osx.cpp
@@ -498,7 +498,7 @@ WXWindow wxNonOwnedWindow::GetWXWindow() const
 // ---------------------------------------------------------------------------
 
 
-bool wxNonOwnedWindow::DoSetShape(const wxRegion& region)
+bool wxNonOwnedWindow::SetShape(const wxRegion& region)
 {
     wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
                  wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
@@ -514,7 +514,7 @@ bool wxNonOwnedWindow::DoSetShape(const wxRegion& region)
         if ( rgn.IsEmpty() )
             return false ;
         else
-            return DoSetShape(rgn);
+            return SetShape(rgn);
     }
 
     return m_nowpeer->SetShape(region);