1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/nativewin.cpp
3 // Purpose: wxNativeWindow implementation
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 // for compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
28 #include "wx/nativewin.h"
29 #include "wx/msw/private.h"
31 // ============================================================================
33 // ============================================================================
35 bool wxNativeContainerWindow::Create(wxNativeContainerWindowHandle hwnd
)
37 if ( !::IsWindow(hwnd
) )
39 // strictly speaking, the fact that IsWindow() returns true doesn't
40 // mean that the window handle is valid -- it could be being deleted
41 // right now, for example
43 // but if it returns false, the handle is definitely invalid
47 // make this HWND really a wxWindow
50 // inherit the other attributes we can from the native HWND
51 AdoptAttributesFromHWND();
56 bool wxNativeContainerWindow::IsShown() const
58 return (IsWindowVisible(static_cast<HWND
>(m_hWnd
)) != 0);
61 void wxNativeContainerWindow::OnNativeDestroyed()
63 // don't use Close() or even Destroy() here, we really don't want to keep
64 // an object using a no more existing HWND around for longer than necessary
68 WXLRESULT
wxNativeContainerWindow::MSWWindowProc(WXUINT nMsg
,
72 if ( nMsg
== WM_DESTROY
)
79 return wxTopLevelWindow::MSWWindowProc(nMsg
, wParam
, lParam
);
82 wxNativeContainerWindow::~wxNativeContainerWindow()
84 // prevent the base class dtor from destroying the window, it doesn't
85 // belong to us so we should leave it alive