+// ============================================================================
+// wxTLWHiddenParentModule implementation
+// ============================================================================
+
+HWND wxTLWHiddenParentModule::m_shWnd = NULL;
+const wxChar* wxTLWHiddenParentModule::m_szClassName = NULL;
+
+bool wxTLWHiddenParentModule::OnInit()
+{
+ m_shWnd = NULL;
+ m_szClassName = NULL;
+ return TRUE;
+} // end of wxTLWHiddenParentModule::OnInit
+
+void wxTLWHiddenParentModule::OnExit()
+{
+ if (m_shWnd)
+ {
+ if (!::WinDestroyWindow(m_shWnd))
+ {
+ wxLogLastError(_T("DestroyWindow(hidden TLW parent)"));
+ }
+ m_shWnd = NULL;
+ }
+
+ m_szClassName = NULL;
+} // end of wxTLWHiddenParentModule::OnExit
+
+/* static */
+HWND wxTLWHiddenParentModule::GetHWND()
+{
+ if (!m_shWnd)
+ {
+ if (!m_szClassName)
+ {
+ static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
+
+ if (!::WinRegisterClass( wxGetInstance()
+ ,(PSZ)zHIDDEN_PARENT_CLASS
+ ,NULL
+ ,0
+ ,sizeof(ULONG)
+ ))
+ {
+ wxLogLastError(_T("RegisterClass(\"wxTLWHiddenParent\")"));
+ }
+ else
+ {
+ m_szClassName = zHIDDEN_PARENT_CLASS;
+ }
+ }
+ m_shWnd = ::WinCreateWindow( HWND_DESKTOP
+ ,(PSZ)m_szClassName
+ ,""
+ ,0L
+ ,(LONG)0L
+ ,(LONG)0L
+ ,(LONG)0L
+ ,(LONG)0L
+ ,NULLHANDLE
+ ,HWND_TOP
+ ,0L
+ ,NULL
+ ,NULL
+ );
+ if (!m_shWnd)
+ {
+ wxLogLastError(_T("CreateWindow(hidden TLW parent)"));
+ }
+ }
+ return m_shWnd;
+} // end of wxTLWHiddenParentModule::GetHWND