]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't activate MSW dialogs when setting their initial size.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Dec 2011 23:04:50 +0000 (23:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Dec 2011 23:04:50 +0000 (23:04 +0000)
As the dialog is not shown yet at this moment, activating it didn't work
correctly and the dialog didn't get the focus when it was shown later.
Fix this by preventing ::SetWindowPos() from activating it, which it does by
default.

Closes #13765.

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

src/msw/toplevel.cpp

index 8378923a5c518bb405e3f7002534c8e0e24e12d6..8219f12a43b782c8a12b20f92be3ab0e47abdb78 100644 (file)
@@ -462,7 +462,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
         // Let the system position the window, just set its size.
         ::SetWindowPos(GetHwnd(), 0,
                        0, 0, w, h,
-                       SWP_NOMOVE | SWP_NOZORDER);
+                       SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
     }
     else // Move the window to the desired location and set its size too.
     {