Commit 381adbf1 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

user32/tests: Add tests for internal window messages of FindWindowEx.

parent 0cf86baf
...@@ -63,6 +63,7 @@ static DWORD (WINAPI *pGetLayout)(HDC hdc); ...@@ -63,6 +63,7 @@ static DWORD (WINAPI *pGetLayout)(HDC hdc);
static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn); static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn);
static BOOL test_lbuttondown_flag; static BOOL test_lbuttondown_flag;
static DWORD num_gettext_msgs;
static HWND hwndMessage; static HWND hwndMessage;
static HWND hwndMain, hwndMain2; static HWND hwndMain, hwndMain2;
static HHOOK hhook; static HHOOK hhook;
...@@ -794,6 +795,9 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR ...@@ -794,6 +795,9 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
flush_events( FALSE ); flush_events( FALSE );
} }
break; break;
case WM_GETTEXT:
num_gettext_msgs++;
break;
} }
return DefWindowProcA(hwnd, msg, wparam, lparam); return DefWindowProcA(hwnd, msg, wparam, lparam);
...@@ -6935,22 +6939,38 @@ static void test_FindWindowEx(void) ...@@ -6935,22 +6939,38 @@ static void test_FindWindowEx(void)
hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL ); hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "" ); found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == NULL, "expected a NULL hwnd\n" ); ok( found == NULL, "expected a NULL hwnd\n" );
todo_wine
ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", NULL ); found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "caption" ); found = FindWindowExA( 0, 0, "MainWindowClass", "caption" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
todo_wine
ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd ); DestroyWindow( hwnd );
hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL ); hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "" ); found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
todo_wine
ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", NULL ); found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found ); ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd ); DestroyWindow( hwnd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment