From f0e21b0e6224db5f1b294b26da79edbfdc146d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Thu, 1 Jul 2010 22:07:40 +0200 Subject: [PATCH] user32/tests: Test that GetDlgItem does not recurse. --- dlls/user32/tests/dialog.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index d18ba0e73b1..cc80c27c86f 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);