1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/nativewin.cpp
3 // Purpose: wxNativeWindow implementation
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
29 #include "wx/nativewin.h"
30 #include "wx/msw/private.h"
32 // ============================================================================
34 // ============================================================================
36 bool wxNativeContainerWindow::Create(wxNativeContainerWindowHandle hwnd
)
38 if ( !::IsWindow(hwnd
) )
40 // strictly speaking, the fact that IsWindow() returns true doesn't
41 // mean that the window handle is valid -- it could be being deleted
42 // right now, for example
44 // but if it returns false, the handle is definitely invalid
48 // make this HWND really a wxWindow
51 // inherit the other attributes we can from the native HWND
52 AdoptAttributesFromHWND();
57 bool wxNativeContainerWindow::IsShown() const
59 return (IsWindowVisible(static_cast<HWND
>(m_hWnd
)) != 0);
62 void wxNativeContainerWindow::OnNativeDestroyed()
64 // don't use Close() or even Destroy() here, we really don't want to keep
65 // an object using a no more existing HWND around for longer than necessary
69 WXLRESULT
wxNativeContainerWindow::MSWWindowProc(WXUINT nMsg
,
73 if ( nMsg
== WM_DESTROY
)
80 return wxTopLevelWindow::MSWWindowProc(nMsg
, wParam
, lParam
);
83 wxNativeContainerWindow::~wxNativeContainerWindow()
85 // prevent the base class dtor from destroying the window, it doesn't
86 // belong to us so we should leave it alive