From c13aa05262352ea718153957839ad10c9ebc1f3f Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Mon, 4 Oct 2010 23:05:49 +0200 Subject: user32/tests: Test FindWindowEx for empty window title --- dlls/user32/tests/win.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index f1f590c..08c8930 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -5502,6 +5502,7 @@ static void test_hwnd_message(void) HWND parent = 0, hwnd, found; RECT rect; + CHAR title[1]; /* HWND_MESSAGE is not supported below w2k, but win9x return != 0 on CreateWindowExA and crash later in the test. @@ -5552,6 +5553,18 @@ static void test_hwnd_message(void) ok( found == hwnd, "didn't find message window %p/%p\n", found, hwnd ); } + /* test behavior with a non empty window title */ + title[0] = 0; + found = FindWindowExA( 0, 0, "MainWindowClass", title ); + ok( found == NULL, "expected a NULL hwnd\n"); + found = FindWindowExA( 0, 0, "MainWindowClass", NULL ); + ok( found != NULL, "found is NULL, expected a valid hwnd\n"); + /* test behavior with a window title that is an empty character */ + found = FindWindowExA( 0, 0, "Shell_TrayWnd", title ); + ok( found != NULL, "found is NULL, expected a valid hwnd\n"); + found = FindWindowExA( 0, 0, "Shell_TrayWnd", NULL ); + ok( found != NULL, "found is NULL, expected a valid hwnd\n"); + /* test IsChild behavior */ if (parent) ok( !IsChild( parent, hwnd ), "HWND_MESSAGE is child of top window\n" ); -- 1.7.0.4