From 4aa3b271ae47a3d8fb9896b16384447591c10184 Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Tue, 5 Oct 2010 18:10:55 +0200 Subject: user32/tests: Test FindWindowEx for empty window title --- dlls/user32/tests/win.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index f1f590c..f0e74d3 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6217,6 +6217,28 @@ static void test_rtl_layout(void) DestroyWindow( parent ); } +static void test_FindWindowEx(void) +{ + HWND hwnd, found; + CHAR title[1]; + + hwnd = CreateWindowExA(0, "MainWindowClass", "some title", WS_VISIBLE, 10, 10, 10, 10, NULL, 0, 0, NULL); + ok( hwnd != 0, "CreateWindowEx failed\n" ); + + title[0] = 0; + /* test behaviour with a non empty window title */ + 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 behaviour 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" ); + DestroyWindow(hwnd); +} + START_TEST(win) { HMODULE user32 = GetModuleHandleA( "user32.dll" ); @@ -6312,6 +6334,7 @@ START_TEST(win) test_Expose(); test_layered_window(); + test_FindWindowEx(); test_SetForegroundWindow(hwndMain); test_shell_window(); test_handles( hwndMain ); -- 1.7.0.4