Module: wine Branch: master Commit: f0e21b0e6224db5f1b294b26da79edbfdc146d55 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f0e21b0e6224db5f1b294b26da...
Author: André Hentschel nerv@dawncrow.de Date: Thu Jul 1 22:07:40 2010 +0200
user32/tests: Test that GetDlgItem does not recurse.
---
dlls/user32/tests/dialog.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index d18ba0e..cc80c27 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -926,6 +926,23 @@ static void test_GetDlgItem(void) hwnd2 = GetDlgItem(hwnd, 0); ok(hwnd2 == child2, "expected second child, got %p\n", hwnd2);
+ /* Now test how GetDlgItem searches */ + DestroyWindow(child2); + child2 = CreateWindowA("button", "child2", WS_VISIBLE|WS_CHILD, 0, 0, 10, 10, child1, 0, g_hinst, NULL); + ok(child2 != NULL, "failed to create second child\n"); + + /* give child2 an ID */ + SetWindowLong(child2, GWLP_ID, 100); + + hwnd2 = GetDlgItem(hwnd, 100); + ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2); + + /* make the ID of child2 public with a WS_EX_CONTROLPARENT parent */ + SetWindowLong(child1, GWL_EXSTYLE, WS_EX_CONTROLPARENT); + + hwnd2 = GetDlgItem(hwnd, 100); + ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2); + DestroyWindow(child1); DestroyWindow(child2); DestroyWindow(hwnd);