[Wine-patches] [eterhack eter-2.0.0] user32: Fix for message box initial focus setting (eterbug #8301)

Sergey Guralnik serhio на etersoft.ru
Чт Мар 29 17:58:50 MSK 2012


---
 dlls/user32/msgbox.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 8014783..5e67dfc 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -25,6 +25,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
+#include "controls.h"
 #include "winternl.h"
 #include "dlgs.h"
 #include "user_private.h"
@@ -76,6 +77,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
     LPCWSTR lpszText;
     WCHAR *buffer = NULL;
     const WCHAR *ptr;
+    DIALOGINFO *infoPtr;
 
     /* Index the order the buttons need to appear to an ID* constant */
     static const int buttonOrder[10] = { IDYES, IDNO, IDOK, IDABORT, IDRETRY,
@@ -307,7 +309,8 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
 	hItem = GetDlgItem(hwnd, buttonOrder[i]);
 	if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE) {
 	    if (buttons++ == ((lpmb->dwStyle & MB_DEFMASK) >> 8)) {
-		SetFocus(hItem);
+		if (infoPtr = DIALOG_get_info(hwnd, FALSE))
+			infoPtr->hwndFocus = hItem;
 		SendMessageW( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
 	    }
 	    SetWindowPos(hItem, 0, bpos, tiheight, bw, bh,
-- 
1.7.9.4



Подробная информация о списке рассылки Wine-patches