user32/tests: Work around a failure on Windows < Vista.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-01-01 12:14:13 -06:00 committed by Alexandre Julliard
parent 741b8f9504
commit 6e4d441ce1
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ static void register_class(void)
WNDCLASSA cls;
cls.style = CS_DBLCLKS;
cls.lpfnWndProc = DefWindowProcA;
/* Windows < Vista apparently checks lpfnWndProc against the address of
* DefWindowProcA(), and for some reason fails to change the thread desktop
* after creating and destroying a window if it doesn't match. Using an IAT
* (as is default) or a wrapper triggers this, so use GetProcAddress() as
* a workaround. */
cls.lpfnWndProc = (void *)GetProcAddress(GetModuleHandleA("user32"), "DefWindowProcA");
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(0);