]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix NULL window argument to wxEVT_KILL_FOCUS when creating a TLW.
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Oct 2011 16:19:58 +0000 (16:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Oct 2011 16:19:58 +0000 (16:19 +0000)
wxTopLevelWindowMSW::CreateDialog first moved and resized the newly
created window and only then called SubclassWin(). Because native focus
change occurred when moving the window, HWND->wxWindow association
wasn't yet filled in and wxFindWinFromHandle() would return NULL.

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

src/msw/toplevel.cpp

index f7329fe3c07c5fc91bf8de4d015fbfe4032487f7..8378923a5c518bb405e3f7002534c8e0e24e12d6 100644 (file)
@@ -445,6 +445,13 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
     }
 #endif // !__WXWINCE__
 
+    if ( !title.empty() )
+    {
+        ::SetWindowText(GetHwnd(), title.wx_str());
+    }
+
+    SubclassWin(m_hWnd);
+
 #if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__)
     // move the dialog to its initial position without forcing repainting
     int x, y, w, h;
@@ -466,13 +473,6 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
     }
 #endif // !__WXWINCE__
 
-    if ( !title.empty() )
-    {
-        ::SetWindowText(GetHwnd(), title.wx_str());
-    }
-
-    SubclassWin(m_hWnd);
-
 #ifdef __SMARTPHONE__
     // Work around title non-display glitch
     Show(false);