user32: Recurse into WS_EX_CONTROLPARENT controls in GetDlgItem
André Hentschel
nerv at dawncrow.de
Wed Jun 30 10:10:50 CDT 2010
This fixes bug 22862 which blocks bug 12804 (1.2)
We already do a similar recursion in DEFDLG_FindDefButton and GetNextDlgGroupItem
I didnt found any other changes in the tests... i expected some more "Test succeeded inside todo block"
Thanks Alex Balut very much for the testing with the stripped winecfg and for the testcase!
see also:
http://bugs.winehq.org/show_bug.cgi?id=22862
http://bugs.winehq.org/show_bug.cgi?id=12804
---
dlls/comctl32/tests/propsheet.c | 1 -
dlls/user32/dialog.c | 18 ++++++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index bfbaaa0..00a5573 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -519,7 +519,6 @@ static void test_custom_default_button(void)
}
}
- todo_wine
ok(add_button_has_been_pressed, "The Add button has not been pressed!\n");
DestroyWindow(hdlg);
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index aac8a4d..ae697a6 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -1280,8 +1280,22 @@ HWND WINAPI GetDlgItem( HWND hwndDlg, INT id )
if (!list) return 0;
- for (i = 0; list[i]; i++) if (GetWindowLongPtrW( list[i], GWLP_ID ) == id) break;
- ret = list[i];
+ for (i = 0; list[i]; i++)
+ {
+ if (GetWindowLongPtrW( list[i], GWLP_ID ) == id)
+ {
+ ret = list[i];
+ break;
+ }
+
+ /* Recurse into WS_EX_CONTROLPARENT controls */
+ if (GetWindowLongW( list[i], GWL_EXSTYLE ) & WS_EX_CONTROLPARENT)
+ {
+ ret = GetDlgItem( list[i], id );
+ if (ret) break;
+ }
+ }
+
HeapFree( GetProcessHeap(), 0, list );
return ret;
}
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list