dialog: Allow search for the default button to recurse into child windows

Zach Gorman zach at archetypeauction.com
Sat Aug 14 20:31:39 CDT 2004


When searching for the DEFPUSHBUTTON in a dialog, recurse into child
windows with the WS_EX_CONTROLPARENT style (if they are visible and
enabled). This makes the search work in property pages, for example.

===================================================================
RCS file: /home/wine/wine/windows/defdlg.c,v
retrieving revision 1.33
diff -u -r1.33 defdlg.c
--- defdlg.c    14 Aug 2004 00:44:08 -0000      1.33
+++ defdlg.c    15 Aug 2004 01:24:18 -0000
@@ -115,11 +115,23 @@
  */
 static HWND DEFDLG_FindDefButton( HWND hwndDlg )
 {
-    HWND hwndChild = GetWindow( hwndDlg, GW_CHILD );
+    HWND hwndChild, hwndTmp;
+    LONG dsStyle, exStyle;
+
+    hwndChild = GetWindow( hwndDlg, GW_CHILD );
     while (hwndChild)
     {
         if (SendMessageW( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
             break;
+
+        /* Recurse into WS_EX_CONTROLPARENT controls */
+        dsStyle = GetWindowLongA(hwndChild,GWL_STYLE);
+        exStyle = GetWindowLongA(hwndChild,GWL_EXSTYLE);
+        if ((exStyle & WS_EX_CONTROLPARENT) &&
+            (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED) &&
+            (hwndTmp = DEFDLG_FindDefButton(hwndChild)) != NULL)
+           return hwndTmp;
+
         hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
     }
     return hwndChild;




More information about the wine-patches mailing list