From a7219e8c883dba6307e9db8fe587f3c1efa88cd4 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 23 Oct 2013 14:54:02 +0900 Subject: [PATCH] user32/tests: Fix message tests compilation with __WINESRC__ defined. --- dlls/user32/tests/msg.c | 606 ++++++++++++++++++++-------------------- 1 file changed, 303 insertions(+), 303 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index a23dd7fee2b..2e8413fdf0b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -1934,7 +1934,7 @@ static void flush_events(void) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } @@ -3372,7 +3372,7 @@ static BOOL mdi_RegisterWindowClasses(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MDI_frame_class"; @@ -3892,7 +3892,7 @@ static void test_mdi_messages(void) /* test maximization of MDI child with invisible parent */ client_cs.hWindowMenu = 0; - mdi_client = CreateWindow("MDI_client_class", + mdi_client = CreateWindowA("MDI_client_class", NULL, WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE, 0, 0, 660, 430, @@ -3908,11 +3908,11 @@ static void test_mdi_messages(void) mdi_client, 0, GetModuleHandleA(0), NULL); ok_sequence(WmCreateMDIchildInvisibleParentSeq, "Create MDI child window with invisible parent", FALSE); - SendMessage(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0); + SendMessageA(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0); ok_sequence(WmMaximizeMDIchildInvisibleParentSeq, "Maximize MDI child window with invisible parent", TRUE); zoomed = IsZoomed(mdi_child); ok(zoomed, "wrong zoomed state %d\n", zoomed); - + ShowWindow(mdi_client, SW_SHOW); ok_sequence(WmShowMDIclientSeq, "Show MDI client window", FALSE); @@ -4763,7 +4763,7 @@ static void test_messages(void) flush_sequence(); test_def_id = 1; - SendMessage(hwnd, WM_NULL, 0, 0); + SendMessageA(hwnd, WM_NULL, 0, 0); flush_sequence(); after_end_dialog = 1; @@ -4876,13 +4876,13 @@ static void test_messages(void) UpdateWindow(hwnd); flush_events(); flush_sequence(); - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION)); + SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION)); ok_sequence(WmSetIcon_1, "WM_SETICON for shown window with caption", FALSE); ShowWindow(hwnd, SW_HIDE); flush_events(); flush_sequence(); - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION)); + SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION)); ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window with caption", FALSE); DestroyWindow(hwnd); flush_sequence(); @@ -4894,17 +4894,17 @@ static void test_messages(void) UpdateWindow(hwnd); flush_events(); flush_sequence(); - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION)); + SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION)); ok_sequence(WmSetIcon_2, "WM_SETICON for shown window without caption", FALSE); ShowWindow(hwnd, SW_HIDE); flush_events(); flush_sequence(); - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(0, IDI_APPLICATION)); + SendMessageA(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconA(0, (LPCSTR)IDI_APPLICATION)); ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window without caption", FALSE); flush_sequence(); - res = SendMessage(hwnd, 0x3B, 0x8000000b, 0); + res = SendMessageA(hwnd, 0x3B, 0x8000000b, 0); if (!res) { todo_wine win_skip( "Message 0x3b not supported\n" ); @@ -4912,26 +4912,26 @@ static void test_messages(void) } ok_sequence(WmInitEndSession, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x8000000b", TRUE); ok(res == 1, "SendMessage(hwnd, 0x3B, 0x8000000b, 0) should have returned 1 instead of %ld\n", res); - res = SendMessage(hwnd, 0x3B, 0x0000000b, 0); + res = SendMessageA(hwnd, 0x3B, 0x0000000b, 0); ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000b", TRUE); ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000b, 0) should have returned 1 instead of %ld\n", res); - res = SendMessage(hwnd, 0x3B, 0x0000000f, 0); + res = SendMessageA(hwnd, 0x3B, 0x0000000f, 0); ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000f", TRUE); ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000f, 0) should have returned 1 instead of %ld\n", res); flush_sequence(); - res = SendMessage(hwnd, 0x3B, 0x80000008, 0); + res = SendMessageA(hwnd, 0x3B, 0x80000008, 0); ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000008", TRUE); ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000008, 0) should have returned 2 instead of %ld\n", res); - res = SendMessage(hwnd, 0x3B, 0x00000008, 0); + res = SendMessageA(hwnd, 0x3B, 0x00000008, 0); ok_sequence(WmInitEndSession_4, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x00000008", TRUE); ok(res == 2, "SendMessage(hwnd, 0x3B, 0x00000008, 0) should have returned 2 instead of %ld\n", res); - res = SendMessage(hwnd, 0x3B, 0x80000004, 0); + res = SendMessageA(hwnd, 0x3B, 0x80000004, 0); ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000004", TRUE); ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000004, 0) should have returned 2 instead of %ld\n", res); - res = SendMessage(hwnd, 0x3B, 0x80000001, 0); + res = SendMessageA(hwnd, 0x3B, 0x80000001, 0); ok_sequence(WmInitEndSession_5, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000001", TRUE); ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000001, 0) should have returned 2 instead of %ld\n", res); @@ -5399,10 +5399,10 @@ static void subclass_button(void) old_button_proc = cls.lpfnWndProc; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpfnWndProc = button_hook_proc; cls.lpszClassName = "my_button_class"; - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); if (!RegisterClassA(&cls)) assert(0); } @@ -5508,20 +5508,20 @@ static void test_button_messages(void) ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); SetFocus(hwnd); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE); SetFocus(0); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE); ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); - SendMessage(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].setstyle, "BM_SETSTYLE on a button", FALSE); style = GetWindowLongA(hwnd, GWL_STYLE); @@ -5529,17 +5529,17 @@ static void test_button_messages(void) /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */ ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); - state = SendMessage(hwnd, BM_GETSTATE, 0, 0); + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); ok(state == 0, "expected state 0, got %04x\n", state); flush_sequence(); - SendMessage(hwnd, BM_SETSTATE, TRUE, 0); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, BM_SETSTATE, TRUE, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].setstate, "BM_SETSTATE/TRUE on a button", FALSE); - state = SendMessage(hwnd, BM_GETSTATE, 0, 0); + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); ok(state == 0x0004, "expected state 0x0004, got %04x\n", state); style = GetWindowLongA(hwnd, GWL_STYLE); @@ -5548,29 +5548,29 @@ static void test_button_messages(void) flush_sequence(); - SendMessage(hwnd, BM_SETSTATE, FALSE, 0); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, BM_SETSTATE, FALSE, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].clearstate, "BM_SETSTATE/FALSE on a button", FALSE); - state = SendMessage(hwnd, BM_GETSTATE, 0, 0); + state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); ok(state == 0, "expected state 0, got %04x\n", state); style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); - state = SendMessage(hwnd, BM_GETCHECK, 0, 0); + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); flush_sequence(); - SendMessage(hwnd, BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, BM_SETCHECK, BST_UNCHECKED, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmSetCheckIgnoredSeq, "BM_SETCHECK on a button", FALSE); - state = SendMessage(hwnd, BM_GETCHECK, 0, 0); + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); style = GetWindowLongA(hwnd, GWL_STYLE); @@ -5579,12 +5579,12 @@ static void test_button_messages(void) flush_sequence(); - SendMessage(hwnd, BM_SETCHECK, BST_CHECKED, 0); - SendMessage(hwnd, WM_APP, 0, 0); /* place a separator mark here */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + SendMessageA(hwnd, BM_SETCHECK, BST_CHECKED, 0); + SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(button[i].setcheck, "BM_SETCHECK on a button", FALSE); - state = SendMessage(hwnd, BM_GETCHECK, 0, 0); + state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); if (button[i].style == BS_PUSHBUTTON || button[i].style == BS_DEFPUSHBUTTON || button[i].style == BS_GROUPBOX || @@ -5679,10 +5679,10 @@ static void subclass_static(void) old_static_proc = cls.lpfnWndProc; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpfnWndProc = static_hook_proc; cls.lpszClassName = "my_static_class"; - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); if (!RegisterClassA(&cls)) assert(0); } @@ -5719,7 +5719,7 @@ static void test_static_messages(void) flush_sequence(); trace("static style %08x\n", static_ctrl[i].style); - SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE); ok_sequence(static_ctrl[i].setfont, "WM_SETFONT on a static", FALSE); DestroyWindow(hwnd); @@ -5797,10 +5797,10 @@ static void subclass_combobox(void) old_combobox_proc = cls.lpfnWndProc; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpfnWndProc = combobox_hook_proc; cls.lpszClassName = "my_combobox_class"; - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); if (!RegisterClassA(&cls)) assert(0); } @@ -5816,29 +5816,29 @@ static void test_combobox_messages(void) ok(parent != 0, "Failed to create parent window\n"); flush_sequence(); - combo = CreateWindowEx(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS, + combo = CreateWindowExA(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS, 0, 0, 100, 150, parent, (HMENU)ID_COMBOBOX, 0, NULL); ok(combo != 0, "Failed to create combobox window\n"); UpdateWindow(combo); - ret = SendMessage(combo, WM_GETDLGCODE, 0, 0); + ret = SendMessageA(combo, WM_GETDLGCODE, 0, 0); ok(ret == (DLGC_WANTCHARS | DLGC_WANTARROWS), "wrong dlg_code %08lx\n", ret); - ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 0"); + ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 0"); ok(ret == 0, "expected 0, got %ld\n", ret); - ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 1"); + ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 1"); ok(ret == 1, "expected 1, got %ld\n", ret); - ret = SendMessage(combo, CB_ADDSTRING, 0, (LPARAM)"item 2"); + ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 2"); ok(ret == 2, "expected 2, got %ld\n", ret); - SendMessage(combo, CB_SETCURSEL, 0, 0); + SendMessageA(combo, CB_SETCURSEL, 0, 0); SetFocus(combo); flush_sequence(); log_all_parent_messages++; - SendMessage(combo, WM_KEYDOWN, VK_DOWN, 0); - SendMessage(combo, WM_KEYUP, VK_DOWN, 0); + SendMessageA(combo, WM_KEYDOWN, VK_DOWN, 0); + SendMessageA(combo, WM_KEYUP, VK_DOWN, 0); log_all_parent_messages--; ok_sequence(WmKeyDownComboSeq, "WM_KEYDOWN/VK_DOWN on a ComboBox", FALSE); @@ -5906,14 +5906,14 @@ static void test_wmime_keydown_message(void) flush_events(); flush_sequence(); - SendMessage(hwnd, WM_IME_KEYDOWN, VK_RETURN, 0x1c0001); - SendMessage(hwnd, WM_CHAR, 'A', 1); + SendMessageA(hwnd, WM_IME_KEYDOWN, VK_RETURN, 0x1c0001); + SendMessageA(hwnd, WM_CHAR, 'A', 1); ok_sequence(WmImeKeydownMsgSeq_0, "WM_IME_KEYDOWN 0", FALSE); - while ( PeekMessage(&msg, 0, 0, 0, PM_REMOVE) ) + while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) ) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmImeKeydownMsgSeq_1, "WM_IME_KEYDOWN 1", FALSE); @@ -6316,7 +6316,7 @@ static void test_paint_messages(void) flush_sequence(); SetRectRgn( hrgn, -4, -4, -1, -1 ); RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME ); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) { if (msg.hwnd == hwnd && msg.message == WM_PAINT) { @@ -6329,7 +6329,7 @@ static void test_paint_messages(void) ret = GetUpdateRect( hwnd, &rect, TRUE ); ok( !ret, "Invalid GetUpdateRect result %d\n", ret ); } - DispatchMessage( &msg ); + DispatchMessageA( &msg ); } ok_sequence( WmGetUpdateRect, "GetUpdateRect", FALSE ); @@ -6382,7 +6382,7 @@ static void test_paint_messages(void) RedrawWindow( hparent, NULL, 0, RDW_ERASENOW | RDW_ALLCHILDREN ); ok_sequence( WmInvalidateParentChild2, "InvalidateParentChild2", FALSE ); - SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) | WS_CLIPCHILDREN ); + SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) | WS_CLIPCHILDREN ); flush_sequence(); RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN ); RedrawWindow( hparent, NULL, 0, RDW_ERASENOW ); @@ -6403,7 +6403,7 @@ static void test_paint_messages(void) /* flush all paint messages */ flush_events(); - SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN ); + SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN ); flush_sequence(); /* RDW_UPDATENOW on child without WS_CLIPCHILDREN will validate corresponding parent area */ @@ -6446,26 +6446,26 @@ static void test_paint_messages(void) SetRectRgn( hrgn, 20, 20, 30, 30 ); check_update_rgn( hparent, hrgn ); /* no WM_PAINT in child while parent still pending */ - while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE ); - while (PeekMessage( &msg, hparent, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, hparent, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmParentErasePaint, "WmParentErasePaint", FALSE ); flush_sequence(); RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME ); /* no WM_PAINT in child while parent still pending */ - while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE ); RedrawWindow( hparent, &rect, 0, RDW_VALIDATE | RDW_NOERASE | RDW_NOCHILDREN ); /* now that parent is valid child should get WM_PAINT */ - while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE ); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmEmptySeq, "No other message", FALSE ); /* same thing with WS_CLIPCHILDREN in parent */ flush_sequence(); - SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) | WS_CLIPCHILDREN ); + SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) | WS_CLIPCHILDREN ); ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE ); /* changing style invalidates non client area, but we need to invalidate something else to see it */ RedrawWindow( hparent, &rect, 0, RDW_UPDATENOW ); @@ -6478,10 +6478,10 @@ static void test_paint_messages(void) SetRectRgn( hrgn, 20, 20, 30, 30 ); check_update_rgn( hparent, hrgn ); /* no WM_PAINT in child while parent still pending */ - while (PeekMessage( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE ); /* WM_PAINT in parent first */ - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence( WmParentPaintNc, "WmParentPaintNc2", FALSE ); /* no RDW_ERASE in parent still causes RDW_ERASE and RDW_FRAME in child */ @@ -6528,7 +6528,7 @@ static void test_paint_messages(void) flush_events(); ok_sequence( WmParentOnlyPaint, "WmParentOnlyPaint", FALSE ); - assert( GetWindowLong(hparent, GWL_STYLE) & WS_CLIPCHILDREN ); + assert( GetWindowLongA(hparent, GWL_STYLE) & WS_CLIPCHILDREN ); UpdateWindow( hparent ); flush_events(); flush_sequence(); @@ -6549,13 +6549,13 @@ static void test_paint_messages(void) flush_events(); ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE ); - SetWindowLong( hparent, GWL_STYLE, GetWindowLong(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN ); + SetWindowLongA( hparent, GWL_STYLE, GetWindowLongA(hparent,GWL_STYLE) & ~WS_CLIPCHILDREN ); ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE ); RedrawWindow( hparent, NULL, 0, RDW_INTERNALPAINT ); flush_events(); ok_sequence( WmParentPaint, "WmParentPaint", FALSE ); - assert( !(GetWindowLong(hparent, GWL_STYLE) & WS_CLIPCHILDREN) ); + assert( !(GetWindowLongA(hparent, GWL_STYLE) & WS_CLIPCHILDREN) ); UpdateWindow( hparent ); flush_events(); flush_sequence(); @@ -6576,8 +6576,8 @@ static void test_paint_messages(void) flush_events(); ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE ); - ok(GetWindowLong( hparent, GWL_STYLE ) & WS_VISIBLE, "parent should be visible\n"); - ok(GetWindowLong( hchild, GWL_STYLE ) & WS_VISIBLE, "child should be visible\n"); + ok(GetWindowLongA( hparent, GWL_STYLE ) & WS_VISIBLE, "parent should be visible\n"); + ok(GetWindowLongA( hchild, GWL_STYLE ) & WS_VISIBLE, "child should be visible\n"); UpdateWindow( hparent ); flush_events(); @@ -6683,10 +6683,10 @@ static DWORD WINAPI thread_proc(void *param) SetEvent(wnd_event->start_event); - while (GetMessage(&msg, 0, 0, 0)) + while (GetMessageA(&msg, 0, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok(IsWindow(wnd_event->hwnd), "window should still exist\n"); @@ -6711,7 +6711,7 @@ static DWORD CALLBACK create_grand_child_thread( void *param ) { MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_ALLINPUT); if (!IsWindow( hchild )) break; /* will be destroyed when parent thread exits */ - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); } return 0; } @@ -6735,7 +6735,7 @@ static DWORD CALLBACK create_child_thread( void *param ) { DWORD ret = MsgWaitForMultipleObjects(1, &child_event.start_event, FALSE, 1000, QS_SENDMESSAGE); if (ret != 1) break; - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); } ret = WaitForSingleObject( wnd_event->stop_event, 5000 ); ok( !ret, "WaitForSingleObject failed %x\n", ret ); @@ -6880,7 +6880,7 @@ static void test_interthread_messages(void) { ret = MsgWaitForMultipleObjects(1, &wnd_event.start_event, FALSE, 1000, QS_SENDMESSAGE); if (ret != 1) break; - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); } ok( !ret, "MsgWaitForMultipleObjects failed %x\n", ret ); /* now wait for the thread without processing messages; this shouldn't deadlock */ @@ -7281,10 +7281,10 @@ static void pump_msg_loop(HWND hwnd, HACCEL hAccel) log_msg.descr = "accel"; add_message(&log_msg); - if (!hAccel || !TranslateAccelerator(hwnd, hAccel, &msg)) + if (!hAccel || !TranslateAcceleratorA(hwnd, hAccel, &msg)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } } @@ -7312,7 +7312,7 @@ static void test_accelerators(void) state = GetKeyState(VK_CAPITAL); ok(state == 0, "wrong CapsLock state %04x\n", state); - hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(1)); + hAccel = LoadAcceleratorsA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1)); assert(hAccel != 0); flush_events(); @@ -7372,7 +7372,7 @@ static void test_accelerators(void) ret = DestroyAcceleratorTable(hAccel); ok( ret, "DestroyAcceleratorTable error %d\n", GetLastError()); - hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(2)); + hAccel = LoadAcceleratorsA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(2)); assert(hAccel != 0); trace("testing VK_N press/release\n"); @@ -7775,13 +7775,13 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam static INT_PTR CALLBACK StopQuitMsgCheckProcA(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) { if (message == WM_CREATE) - PostMessage(hwnd, WM_CLOSE, 0, 0); + PostMessageA(hwnd, WM_CLOSE, 0, 0); else if (message == WM_CLOSE) { /* Only the first WM_QUIT will survive the window destruction */ - PostMessage(hwnd, WM_USER, 0x1234, 0x5678); - PostMessage(hwnd, WM_QUIT, 0x1234, 0x5678); - PostMessage(hwnd, WM_QUIT, 0x4321, 0x8765); + PostMessageA(hwnd, WM_USER, 0x1234, 0x5678); + PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678); + PostMessageA(hwnd, WM_QUIT, 0x4321, 0x8765); } return DefWindowProcA(hwnd, message, wp, lp); @@ -7880,7 +7880,7 @@ static LRESULT WINAPI PaintLoopProcA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM if (PeekMessageA(&msg2, 0, 0, 0, 1)) { TranslateMessage(&msg2); - DispatchMessage(&msg2); + DispatchMessageA(&msg2); } i--; } @@ -7947,7 +7947,7 @@ static BOOL RegisterWindowClasses(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "TestWindowClass"; @@ -8330,7 +8330,7 @@ static void test_timers(void) DWORD id; MSG msg; - info.hWnd = CreateWindow ("TestWindowClass", NULL, + info.hWnd = CreateWindowA("TestWindowClass", NULL, WS_OVERLAPPEDWINDOW , CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0, NULL, NULL, 0); @@ -8338,7 +8338,7 @@ static void test_timers(void) info.id = SetTimer(info.hWnd,TIMER_ID,10000,tfunc); ok(info.id, "SetTimer failed\n"); ok(info.id==TIMER_ID, "SetTimer timer ID different\n"); - info.handles[0] = CreateEvent(NULL,0,0,NULL); + info.handles[0] = CreateEventW(NULL,0,0,NULL); info.handles[1] = CreateThread(NULL,0,timer_thread_proc,&info,0,&id); WaitForMultipleObjects(2, info.handles, FALSE, INFINITE); @@ -8359,8 +8359,8 @@ static void test_timers(void) ok(id != 0, "did not get id from SetTimer.\n"); ok(id==TIMER_ID, "SetTimer timer ID different\n"); start = GetTickCount(); - while (GetTickCount()-start < 1001 && GetMessage(&msg, info.hWnd, 0, 0)) - DispatchMessage(&msg); + while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0)) + DispatchMessageA(&msg); ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE || broken(abs(count-43) < TIMER_COUNT_TOLERANCE) /* w2k3 */, "did not get expected count for minimum timeout (%d != ~%d).\n", @@ -8376,11 +8376,11 @@ static void test_timers(void) ok(id != 0, "did not get id from SetSystemTimer.\n"); ok(id==TIMER_ID, "SetTimer timer ID different\n"); start = GetTickCount(); - while (GetTickCount()-start < 1001 && GetMessage(&msg, info.hWnd, 0, 0)) + while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0)) { if (msg.message == WM_SYSTIMER) syscount++; - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok(abs(syscount-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE, "did not get expected count for minimum timeout (%d != ~%d).\n", @@ -8405,14 +8405,14 @@ static void test_timers_no_wnd(void) id2 = SetTimer(NULL, id, 200, callback_count); ok(id2 == id, "did not get same id from SetTimer when replacing (%li expected %li).\n", id2, id); Sleep(150); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(count == 0, "did not get zero count as expected (%i).\n", count); Sleep(150); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(count == 1, "did not get one count as expected (%i).\n", count); KillTimer(NULL, id); Sleep(250); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(count == 1, "killing replaced timer did not work (%i).\n", count); /* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms, @@ -8423,8 +8423,8 @@ static void test_timers_no_wnd(void) id = SetTimer(NULL, 0, 0, callback_count); ok(id != 0, "did not get id from SetTimer.\n"); start = GetTickCount(); - while (GetTickCount()-start < 1001 && GetMessage(&msg, NULL, 0, 0)) - DispatchMessage(&msg); + while (GetTickCount()-start < 1001 && GetMessageA(&msg, NULL, 0, 0)) + DispatchMessageA(&msg); ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE, "did not get expected count for minimum timeout (%d != ~%d).\n", count, TIMER_COUNT_EXPECTED); @@ -8619,10 +8619,10 @@ static DWORD WINAPI win_event_global_thread_proc(void *param) pNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_ALERT, 0); SetEvent(hevent); - while (GetMessage(&msg, 0, 0, 0)) + while (GetMessageA(&msg, 0, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } return 0; } @@ -8655,10 +8655,10 @@ static DWORD WINAPI cbt_global_hook_thread_proc(void *param) SetEvent(hevent); - while (GetMessage(&msg, 0, 0, 0)) + while (GetMessageA(&msg, 0, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } return 0; } @@ -8686,10 +8686,10 @@ static DWORD WINAPI mouse_ll_global_thread_proc(void *param) mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0); SetEvent(hevent); - while (GetMessage(&msg, 0, 0, 0)) + while (GetMessageA(&msg, 0, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } return 0; } @@ -8874,7 +8874,7 @@ static void test_winevents(void) ok(hthread != NULL, "CreateThread failed, error %d\n", GetLastError()); while (WaitForSingleObject(hevent, 100) == WAIT_TIMEOUT) - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); ok_sequence(WmMouseLLHookSeq, "MOUSE_LL hook other thread", FALSE); flush_sequence(); @@ -9255,13 +9255,13 @@ static void test_DispatchMessage(void) SetRect( &rect, -5, -5, 5, 5 ); RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME ); count = 0; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) { - if (msg.message != WM_PAINT) DispatchMessage( &msg ); + if (msg.message != WM_PAINT) DispatchMessageA( &msg ); else { flush_sequence(); - DispatchMessage( &msg ); + DispatchMessageA( &msg ); /* DispatchMessage will send WM_NCPAINT if non client area is still invalid after WM_PAINT */ if (!count) ok_sequence( WmDispatchPaint, "WmDispatchPaint", FALSE ); else ok_sequence( WmEmptySeq, "WmEmpty", FALSE ); @@ -9274,9 +9274,9 @@ static void test_DispatchMessage(void) flush_sequence(); RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME ); count = 0; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) { - if (msg.message != WM_PAINT) DispatchMessage( &msg ); + if (msg.message != WM_PAINT) DispatchMessageA( &msg ); else { HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 ); @@ -9295,9 +9295,9 @@ static void test_DispatchMessage(void) flush_sequence(); RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME ); count = 0; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) { - if (msg.message != WM_PAINT) DispatchMessage( &msg ); + if (msg.message != WM_PAINT) DispatchMessageA( &msg ); else { HDC hdc; @@ -9343,7 +9343,7 @@ static void wait_for_thread( HANDLE thread ) while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_SENDMESSAGE) != WAIT_OBJECT_0) { MSG msg; - while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage(&msg); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA(&msg); } } @@ -9586,10 +9586,10 @@ static void subclass_edit(void) old_edit_proc = cls.lpfnWndProc; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpfnWndProc = edit_hook_proc; cls.lpszClassName = "my_edit_class"; - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); if (!RegisterClassA(&cls)) assert(0); } @@ -9795,7 +9795,7 @@ static void test_PeekMessage(void) } if (qstatus & QS_POSTMESSAGE) { - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) /* nothing */ ; + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) /* nothing */ ; qstatus = GetQueueStatus(qs_all_input); } ok(qstatus == 0, "wrong qstatus %08x\n", qstatus); @@ -10255,7 +10255,7 @@ static void test_PeekMessage2(void) x1 = y1 = x2 = y2 = x3 = y3 = 0; /* Initialise window and make sure it is ready for events */ - hwnd = CreateWindow("TestWindowClass", "PeekMessage2", WS_OVERLAPPEDWINDOW, + hwnd = CreateWindowA("TestWindowClass", "PeekMessage2", WS_OVERLAPPEDWINDOW, 10, 10, 800, 800, NULL, NULL, NULL, NULL); assert(hwnd); trace("Window for test_PeekMessage2 %p\n", hwnd); @@ -10351,8 +10351,8 @@ static INT_PTR CALLBACK wm_quit_dlg_proc(HWND hwnd, UINT message, WPARAM wp, LPA switch (message) { case WM_INITDIALOG: - PostMessage(hwnd, WM_QUIT, 0x1234, 0x5678); - PostMessage(hwnd, WM_USER, 0xdead, 0xbeef); + PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678); + PostMessageA(hwnd, WM_USER, 0xdead, 0xbeef); return 0; case WM_GETDLGCODE: @@ -10394,55 +10394,55 @@ static void test_quit_message(void) flush_events(); PostQuitMessage(0xbeef); - ret = PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); + ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE); ok(ret, "PeekMessage failed with error %d\n", GetLastError()); ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); ok(msg.wParam == 0xbeef, "wParam was 0x%lx instead of 0xbeef\n", msg.wParam); - ret = PostThreadMessage(GetCurrentThreadId(), WM_USER, 0, 0); + ret = PostThreadMessageA(GetCurrentThreadId(), WM_USER, 0, 0); ok(ret, "PostMessage failed with error %d\n", GetLastError()); - ret = GetMessage(&msg, NULL, 0, 0); + ret = GetMessageA(&msg, NULL, 0, 0); ok(ret > 0, "GetMessage failed with error %d\n", GetLastError()); ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message); /* note: WM_QUIT message received after WM_USER message */ - ret = GetMessage(&msg, NULL, 0, 0); + ret = GetMessageA(&msg, NULL, 0, 0); ok(!ret, "GetMessage return %d with error %d instead of FALSE\n", ret, GetLastError()); ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); ok(msg.wParam == 0xbeef, "wParam was 0x%lx instead of 0xbeef\n", msg.wParam); - ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE); ok( !ret || msg.message != WM_QUIT, "Received WM_QUIT again\n" ); /* now test with PostThreadMessage - different behaviour! */ - PostThreadMessage(GetCurrentThreadId(), WM_QUIT, 0xdead, 0); + PostThreadMessageA(GetCurrentThreadId(), WM_QUIT, 0xdead, 0); - ret = PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); + ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE); ok(ret, "PeekMessage failed with error %d\n", GetLastError()); ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); ok(msg.wParam == 0xdead, "wParam was 0x%lx instead of 0xdead\n", msg.wParam); - ret = PostThreadMessage(GetCurrentThreadId(), WM_USER, 0, 0); + ret = PostThreadMessageA(GetCurrentThreadId(), WM_USER, 0, 0); ok(ret, "PostMessage failed with error %d\n", GetLastError()); /* note: we receive the WM_QUIT message first this time */ - ret = GetMessage(&msg, NULL, 0, 0); + ret = GetMessageA(&msg, NULL, 0, 0); ok(!ret, "GetMessage return %d with error %d instead of FALSE\n", ret, GetLastError()); ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); ok(msg.wParam == 0xdead, "wParam was 0x%lx instead of 0xdead\n", msg.wParam); - ret = GetMessage(&msg, NULL, 0, 0); + ret = GetMessageA(&msg, NULL, 0, 0); ok(ret > 0, "GetMessage failed with error %d\n", GetLastError()); ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message); flush_events(); flush_sequence(); - ret = DialogBoxParam(GetModuleHandle(0), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0); + ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0); ok(ret == 1, "expected 1, got %d\n", ret); ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", FALSE); memset(&msg, 0xab, sizeof(msg)); - ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE); ok(ret, "PeekMessage failed\n"); ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message); ok(msg.wParam == 0x1234, "wParam was 0x%lx instead of 0x1234\n", msg.wParam); @@ -10454,7 +10454,7 @@ static void test_quit_message(void) CreateWindowExA(0, "StopQuitClass", "Stop Quit Test", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, NULL, NULL, NULL, NULL); flush_sequence(); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { struct recvd_message rmsg; rmsg.hwnd = msg.hwnd; @@ -10467,7 +10467,7 @@ static void test_quit_message(void) /* The hwnd can only be checked here */ ok(!msg.hwnd, "The WM_QUIT hwnd was %p instead of NULL\n", msg.hwnd); add_message(&rmsg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmStopQuitSeq, "WmStopQuitSeq", FALSE); } @@ -10492,7 +10492,7 @@ static void pump_msg_loop_timeout(DWORD timeout, BOOL inject_mouse_move) do { - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { /* Timer proc messages are not dispatched to the window proc, * and therefore not logged. @@ -10509,7 +10509,7 @@ static void pump_msg_loop_timeout(DWORD timeout, BOOL inject_mouse_move) s_msg.descr = "msg_loop"; add_message(&s_msg); } - DispatchMessage(&msg); + DispatchMessageA(&msg); } end_ticks = GetTickCount(); @@ -10569,31 +10569,31 @@ static void test_TrackMouseEvent(void) default_hover_time = 0xdeadbeef; SetLastError(0xdeadbeef); - ret = SystemParametersInfo(SPI_GETMOUSEHOVERTIME, 0, &default_hover_time, 0); + ret = SystemParametersInfoA(SPI_GETMOUSEHOVERTIME, 0, &default_hover_time, 0); ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */ "SystemParametersInfo(SPI_GETMOUSEHOVERTIME) error %u\n", GetLastError()); if (!ret) default_hover_time = 400; trace("SPI_GETMOUSEHOVERTIME returned %u ms\n", default_hover_time); SetLastError(0xdeadbeef); - ret = SystemParametersInfo(SPI_GETMOUSEHOVERWIDTH, 0, &hover_width, 0); + ret = SystemParametersInfoA(SPI_GETMOUSEHOVERWIDTH, 0, &hover_width, 0); ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */ "SystemParametersInfo(SPI_GETMOUSEHOVERWIDTH) error %u\n", GetLastError()); if (!ret) hover_width = 4; SetLastError(0xdeadbeef); - ret = SystemParametersInfo(SPI_GETMOUSEHOVERHEIGHT, 0, &hover_height, 0); + ret = SystemParametersInfoA(SPI_GETMOUSEHOVERHEIGHT, 0, &hover_height, 0); ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */ "SystemParametersInfo(SPI_GETMOUSEHOVERHEIGHT) error %u\n", GetLastError()); if (!ret) hover_height = 4; trace("hover rect is %u x %d\n", hover_width, hover_height); - hwnd = CreateWindowEx(0, "TestWindowClass", NULL, + hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0, NULL, NULL, 0); assert(hwnd); - hchild = CreateWindowEx(0, "TestWindowClass", NULL, + hchild = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 50, 50, 200, 200, hwnd, NULL, NULL, 0); @@ -11167,12 +11167,12 @@ static void test_ShowWindow(void) RECT win_rc, work_rc = {0, 0, 0, 0}; #define WS_BASE (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_POPUP|WS_CLIPSIBLINGS) - hwnd = CreateWindowEx(0, "ShowWindowClass", NULL, WS_BASE, + hwnd = CreateWindowExA(0, "ShowWindowClass", NULL, WS_BASE, 120, 120, 90, 90, 0, 0, 0, NULL); assert(hwnd); - style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_BASE; + style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE; ok(style == 0, "expected style 0, got %08x\n", style); flush_events(); @@ -11238,11 +11238,11 @@ static void test_ShowWindow(void) idx = (sw[i].cmd == SW_NORMALNA) ? 12 : sw[i].cmd; - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); trace("%d: sending %s, current window style %08x\n", i+1, sw_cmd_name[idx], style); ret = ShowWindow(hwnd, sw[i].cmd); ok(!ret == !sw[i].ret, "%d: cmd %s: expected ret %lu, got %lu\n", i+1, sw_cmd_name[idx], sw[i].ret, ret); - style = GetWindowLong(hwnd, GWL_STYLE) & ~WS_BASE; + style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE; ok(style == sw[i].style, "%d: expected style %08x, got %08x\n", i+1, sw[i].style, style); sprintf(comment, "%d: ShowWindow(%s)", i+1, sw_cmd_name[idx]); @@ -11376,36 +11376,36 @@ static const struct message WmCreateDialogParamSeq_2[] = { static void test_dialog_messages(void) { - WNDCLASS cls; + WNDCLASSA cls; HWND hdlg, hedit1, hedit2, hfocus; LRESULT ret; #define set_selection(hctl, start, end) \ - ret = SendMessage(hctl, EM_SETSEL, start, end); \ + ret = SendMessageA(hctl, EM_SETSEL, start, end); \ ok(ret == 1, "EM_SETSEL returned %ld\n", ret); #define check_selection(hctl, start, end) \ - ret = SendMessage(hctl, EM_GETSEL, 0, 0); \ + ret = SendMessageA(hctl, EM_GETSEL, 0, 0); \ ok(ret == MAKELRESULT(start, end), "wrong selection (%d - %d)\n", LOWORD(ret), HIWORD(ret)); subclass_edit(); - hdlg = CreateWindowEx(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL, + hdlg = CreateWindowExA(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL, WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_DLGFRAME, 0, 0, 100, 100, 0, 0, 0, NULL); ok(hdlg != 0, "Failed to create custom dialog window\n"); - hedit1 = CreateWindowEx(0, "my_edit_class", NULL, + hedit1 = CreateWindowExA(0, "my_edit_class", NULL, WS_CHILD|WS_BORDER|WS_VISIBLE|WS_TABSTOP, 0, 0, 80, 20, hdlg, (HMENU)1, 0, NULL); ok(hedit1 != 0, "Failed to create edit control\n"); - hedit2 = CreateWindowEx(0, "my_edit_class", NULL, + hedit2 = CreateWindowExA(0, "my_edit_class", NULL, WS_CHILD|WS_BORDER|WS_VISIBLE|WS_TABSTOP, 0, 40, 80, 20, hdlg, (HMENU)2, 0, NULL); ok(hedit2 != 0, "Failed to create edit control\n"); - SendMessage(hedit1, WM_SETTEXT, 0, (LPARAM)"hello"); - SendMessage(hedit2, WM_SETTEXT, 0, (LPARAM)"bye"); + SendMessageA(hedit1, WM_SETTEXT, 0, (LPARAM)"hello"); + SendMessageA(hedit2, WM_SETTEXT, 0, (LPARAM)"bye"); hfocus = GetFocus(); ok(hfocus == hdlg, "wrong focus %p\n", hfocus); @@ -11425,7 +11425,7 @@ static void test_dialog_messages(void) ok(hfocus == 0, "wrong focus %p\n", hfocus); flush_sequence(); - ret = DefDlgProc(hdlg, WM_SETFOCUS, 0, 0); + ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0); ok(ret == 0, "WM_SETFOCUS returned %ld\n", ret); ok_sequence(WmDefDlgSetFocus_1, "DefDlgProc(WM_SETFOCUS) 1", FALSE); @@ -11436,7 +11436,7 @@ static void test_dialog_messages(void) check_selection(hedit2, 0, 3); flush_sequence(); - ret = DefDlgProc(hdlg, WM_SETFOCUS, 0, 0); + ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0); ok(ret == 0, "WM_SETFOCUS returned %ld\n", ret); ok_sequence(WmDefDlgSetFocus_2, "DefDlgProc(WM_SETFOCUS) 2", FALSE); @@ -11455,34 +11455,34 @@ static void test_dialog_messages(void) #undef set_selection #undef check_selection - ok(GetClassInfo(0, "#32770", &cls), "GetClassInfo failed\n"); + ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n"); cls.lpszClassName = "MyDialogClass"; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); /* need a cast since a dlgproc is used as a wndproc */ cls.lpfnWndProc = test_dlg_proc; - if (!RegisterClass(&cls)) assert(0); + if (!RegisterClassA(&cls)) assert(0); - hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0); + hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0); ok(IsWindow(hdlg), "CreateDialogParam failed\n"); ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE); EndDialog(hdlg, 0); DestroyWindow(hdlg); flush_sequence(); - hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", 0, NULL, 0); + hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, NULL, 0); ok(IsWindow(hdlg), "CreateDialogParam failed\n"); ok_sequence(WmCreateDialogParamSeq_2, "CreateDialogParam_2", FALSE); EndDialog(hdlg, 0); DestroyWindow(hdlg); flush_sequence(); - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); } static void test_EndDialog(void) { HWND hparent, hother, hactive, hdlg; - WNDCLASS cls; + WNDCLASSA cls; hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_DISABLED, @@ -11494,11 +11494,11 @@ static void test_EndDialog(void) 100, 100, 200, 200, 0, 0, 0, NULL); ok (hother != 0, "Failed to create parent window\n"); - ok(GetClassInfo(0, "#32770", &cls), "GetClassInfo failed\n"); + ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n"); cls.lpszClassName = "MyDialogClass"; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpfnWndProc = test_dlg_proc; - if (!RegisterClass(&cls)) assert(0); + if (!RegisterClassA(&cls)) assert(0); flush_sequence(); SetForegroundWindow(hother); @@ -11508,7 +11508,7 @@ static void test_EndDialog(void) /* create a dialog where the parent is disabled, this parent should still receive the focus when the dialog exits (even though "normally" a disabled window should not receive the focus) */ - hdlg = CreateDialogParam(0, "CLASS_TEST_DIALOG_2", hparent, test_dlg_proc, 0); + hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", hparent, test_dlg_proc, 0); ok(IsWindow(hdlg), "CreateDialogParam failed\n"); SetForegroundWindow(hdlg); hactive = GetForegroundWindow(); @@ -11521,7 +11521,7 @@ static void test_EndDialog(void) DestroyWindow( hother ); DestroyWindow( hparent ); - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); } static void test_nullCallback(void) @@ -12070,7 +12070,7 @@ static void test_unicode_wm_char(void) return; } - hkl_greek = LoadKeyboardLayout( "00000408", 0 ); + hkl_greek = LoadKeyboardLayoutA( "00000408", 0 ); if (!hkl_greek || hkl_greek == hkl_orig /* win2k */) { skip( "Unable to load Greek keyboard layout\n" ); @@ -12291,11 +12291,11 @@ static void test_listbox_messages(void) check_lb_state(listbox, 0, LB_ERR, 0, 0); - ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); + ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); ok(ret == 0, "expected 0, got %ld\n", ret); - ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); + ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); ok(ret == 1, "expected 1, got %ld\n", ret); - ret = SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); + ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); ok(ret == 2, "expected 2, got %ld\n", ret); check_lb_state(listbox, 3, LB_ERR, 0, 0); @@ -12305,56 +12305,56 @@ static void test_listbox_messages(void) log_all_parent_messages++; trace("selecting item 0\n"); - ret = SendMessage(listbox, LB_SETCURSEL, 0, 0); + ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0); ok(ret == 0, "expected 0, got %ld\n", ret); ok_sequence(wm_lb_setcursel_0, "LB_SETCURSEL 0", FALSE ); check_lb_state(listbox, 3, 0, 0, 0); flush_sequence(); trace("selecting item 1\n"); - ret = SendMessage(listbox, LB_SETCURSEL, 1, 0); + ret = SendMessageA(listbox, LB_SETCURSEL, 1, 0); ok(ret == 1, "expected 1, got %ld\n", ret); ok_sequence(wm_lb_setcursel_1, "LB_SETCURSEL 1", FALSE ); check_lb_state(listbox, 3, 1, 1, 0); trace("selecting item 2\n"); - ret = SendMessage(listbox, LB_SETCURSEL, 2, 0); + ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0); ok(ret == 2, "expected 2, got %ld\n", ret); ok_sequence(wm_lb_setcursel_2, "LB_SETCURSEL 2", FALSE ); check_lb_state(listbox, 3, 2, 2, 0); trace("clicking on item 0\n"); - ret = SendMessage(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(1, 1)); + ret = SendMessageA(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(1, 1)); ok(ret == LB_OKAY, "expected LB_OKAY, got %ld\n", ret); - ret = SendMessage(listbox, WM_LBUTTONUP, 0, 0); + ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0); ok(ret == LB_OKAY, "expected LB_OKAY, got %ld\n", ret); ok_sequence(wm_lb_click_0, "WM_LBUTTONDOWN 0", FALSE ); check_lb_state(listbox, 3, 0, 0, 0); flush_sequence(); trace("deleting item 0\n"); - ret = SendMessage(listbox, LB_DELETESTRING, 0, 0); + ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0); ok(ret == 2, "expected 2, got %ld\n", ret); ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE ); check_lb_state(listbox, 2, -1, 0, 0); flush_sequence(); trace("deleting item 0\n"); - ret = SendMessage(listbox, LB_DELETESTRING, 0, 0); + ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0); ok(ret == 1, "expected 1, got %ld\n", ret); ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE ); check_lb_state(listbox, 1, -1, 0, 0); flush_sequence(); trace("deleting item 0\n"); - ret = SendMessage(listbox, LB_DELETESTRING, 0, 0); + ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0); ok(ret == 0, "expected 0, got %ld\n", ret); ok_sequence(wm_lb_deletestring_reset, "LB_DELETESTRING 0", FALSE ); check_lb_state(listbox, 0, -1, 0, 0); flush_sequence(); trace("deleting item 0\n"); - ret = SendMessage(listbox, LB_DELETESTRING, 0, 0); + ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0); ok(ret == LB_ERR, "expected LB_ERR, got %ld\n", ret); check_lb_state(listbox, 0, -1, 0, 0); flush_sequence(); @@ -12572,11 +12572,11 @@ static void test_menu_messages(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "TestMenuClass"; - UnregisterClass(cls.lpszClassName, cls.hInstance); + UnregisterClassA(cls.lpszClassName, cls.hInstance); if (!RegisterClassA(&cls)) assert(0); SetLastError(0xdeadbeef); @@ -12585,7 +12585,7 @@ static void test_menu_messages(void) ok(hwnd != 0, "LoadMenuA error %u\n", GetLastError()); SetLastError(0xdeadbeef); - hmenu = LoadMenuA(GetModuleHandle(0), MAKEINTRESOURCE(1)); + hmenu = LoadMenuA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1)); ok(hmenu != 0, "LoadMenuA error %u\n", GetLastError()); SetMenu(hwnd, hmenu); @@ -12614,10 +12614,10 @@ static void test_menu_messages(void) keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_RETURN, 0, 0, 0); keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } if (!sequence_cnt) /* we didn't get any message */ { @@ -12643,10 +12643,10 @@ static void test_menu_messages(void) keybd_event(VK_RIGHT, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_RETURN, 0, 0, 0); keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(wm_popup_menu_2, "submenu of a popup menu command", FALSE); @@ -12658,10 +12658,10 @@ static void test_menu_messages(void) keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_ESCAPE, 0, 0, 0); keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(wm_single_menu_item, "single menu item command", FALSE); @@ -12691,10 +12691,10 @@ static void test_menu_messages(void) keybd_event(VK_RIGHT, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_RETURN, 0, 0, 0); keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(wm_popup_menu_3, "submenu of a popup menu command", FALSE); @@ -12722,7 +12722,7 @@ static void test_paintingloop(void) if (PeekMessageA(&msg, 0, 0, 0, 1)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } DestroyWindow(hwnd); @@ -12942,8 +12942,8 @@ static void test_PostMessage(void) flush_events(); - PostMessage(hwnd, WM_USER+1, 0x1234, 0x5678); - PostMessage(0, WM_USER+2, 0x5678, 0x1234); + PostMessageA(hwnd, WM_USER+1, 0x1234, 0x5678); + PostMessageA(0, WM_USER+2, 0x5678, 0x1234); for (i = 0; i < sizeof(data)/sizeof(data[0]); i++) { @@ -13002,7 +13002,7 @@ static DWORD CALLBACK do_wait_idle_child_thread( void *arg ) { MSG msg; - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); Sleep( 200 ); MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); return 0; @@ -13010,7 +13010,7 @@ static DWORD CALLBACK do_wait_idle_child_thread( void *arg ) static void do_wait_idle_child( int arg ) { - WNDCLASS cls; + WNDCLASSA cls; MSG msg; HWND hwnd = 0; HANDLE thread; @@ -13019,13 +13019,13 @@ static void do_wait_idle_child( int arg ) HANDLE end_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_end" ); memset( &cls, 0, sizeof(cls) ); - cls.lpfnWndProc = DefWindowProc; + cls.lpfnWndProc = DefWindowProcA; cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.lpszClassName = "TestClass"; - RegisterClass( &cls ); + RegisterClassA( &cls ); - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */ + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */ ok( start_event != 0, "failed to create start event, error %u\n", GetLastError() ); ok( end_event != 0, "failed to create end event, error %u\n", GetLastError() ); @@ -13038,40 +13038,40 @@ static void do_wait_idle_child( int arg ) case 1: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, 0, 0, 0, PM_REMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ); break; case 2: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); - PostThreadMessage( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd ); - PeekMessage( &msg, 0, 0, 0, PM_REMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); + PostThreadMessageA( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd ); + PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ); break; case 3: SetEvent( start_event ); Sleep( 200 ); - SendMessage( HWND_BROADCAST, WM_WININICHANGE, 0, 0 ); + SendMessageA( HWND_BROADCAST, WM_WININICHANGE, 0, 0 ); break; case 4: SetEvent( start_event ); Sleep( 200 ); hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg ); break; case 5: SetEvent( start_event ); Sleep( 200 ); hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); break; case 6: SetEvent( start_event ); Sleep( 200 ); hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); - while (PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE )) + while (PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE )) { - GetMessage( &msg, 0, 0, 0 ); - DispatchMessage( &msg ); + GetMessageA( &msg, 0, 0, 0 ); + DispatchMessageA( &msg ); } break; case 7: @@ -13080,20 +13080,20 @@ static void do_wait_idle_child( int arg ) hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); SetTimer( hwnd, 3, 1, NULL ); Sleep( 200 ); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg ); break; case 8: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); break; case 9: SetEvent( start_event ); Sleep( 200 ); hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); - for (;;) GetMessage( &msg, 0, 0, 0 ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + for (;;) GetMessageA( &msg, 0, 0, 0 ); break; case 10: SetEvent( start_event ); @@ -13101,21 +13101,21 @@ static void do_wait_idle_child( int arg ) hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); SetTimer( hwnd, 3, 1, NULL ); Sleep( 200 ); - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); break; case 11: SetEvent( start_event ); Sleep( 200 ); return; /* exiting the process makes WaitForInputIdle return success too */ case 12: - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); Sleep( 200 ); MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); SetEvent( start_event ); break; case 13: SetEvent( start_event ); - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); Sleep( 200 ); thread = CreateThread( NULL, 0, do_wait_idle_child_thread, NULL, 0, &id ); WaitForSingleObject( thread, 10000 ); @@ -13124,37 +13124,37 @@ static void do_wait_idle_child( int arg ) case 14: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, HWND_TOPMOST, 0, 0, PM_NOREMOVE ); break; case 15: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, HWND_BROADCAST, 0, 0, PM_NOREMOVE ); break; case 16: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, HWND_BOTTOM, 0, 0, PM_NOREMOVE ); break; case 17: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE ); break; case 18: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, HWND_NOTOPMOST, 0, 0, PM_NOREMOVE ); break; case 19: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, HWND_MESSAGE, 0, 0, PM_NOREMOVE ); break; case 20: SetEvent( start_event ); Sleep( 200 ); - PeekMessage( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE ); + PeekMessageA( &msg, GetDesktopWindow(), 0, 0, PM_NOREMOVE ); break; } WaitForSingleObject( end_event, 2000 ); @@ -13171,19 +13171,19 @@ static LRESULT CALLBACK wait_idle_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM l static DWORD CALLBACK wait_idle_thread( void *arg ) { - WNDCLASS cls; + WNDCLASSA cls; MSG msg; HWND hwnd; memset( &cls, 0, sizeof(cls) ); cls.lpfnWndProc = wait_idle_proc; cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.lpszClassName = "TestClass"; - RegisterClass( &cls ); + RegisterClassA( &cls ); hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL); - while (GetMessage( &msg, 0, 0, 0 )) DispatchMessage( &msg ); + while (GetMessageA( &msg, 0, 0, 0 )) DispatchMessageA( &msg ); DestroyWindow(hwnd); return 0; } @@ -13257,7 +13257,7 @@ static void test_WaitForInputIdle( char *argv0 ) } } CloseHandle( start_event ); - PostThreadMessage( id, WM_QUIT, 0, 0 ); + PostThreadMessageA( id, WM_QUIT, 0, 0 ); WaitForSingleObject( thread, 10000 ); CloseHandle( thread ); } @@ -13310,16 +13310,16 @@ static void test_SetParent(void) HWND parent1, parent2, child, popup; RECT rc, rc_old; - parent1 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, + parent1 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); ok(parent1 != 0, "Failed to create parent1 window\n"); - parent2 = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, + parent2 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, 400, 100, 200, 200, 0, 0, 0, NULL); ok(parent2 != 0, "Failed to create parent2 window\n"); /* WS_CHILD window */ - child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE, + child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE, 10, 10, 150, 150, parent1, 0, 0, NULL); ok(child != 0, "Failed to create child window\n"); @@ -13349,7 +13349,7 @@ static void test_SetParent(void) rc.left, rc.top, rc.right, rc.bottom ); /* WS_POPUP window */ - popup = CreateWindowEx(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE, + popup = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE, 20, 20, 100, 100, 0, 0, 0, NULL); ok(popup != 0, "Failed to create popup window\n"); @@ -13411,7 +13411,7 @@ static void test_keyflags(void) BYTE keyboard_state[256]; MSG msg; - test_window = CreateWindowEx(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, + test_window = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, 0, NULL); flush_events(); @@ -13419,8 +13419,8 @@ static void test_keyflags(void) /* keyup without a keydown */ keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyReleaseOnly, "key release only", TRUE); key_state = GetAsyncKeyState(0x41); @@ -13431,8 +13431,8 @@ static void test_keyflags(void) /* keydown */ keybd_event(0x41, 0, 0, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyPressNormal, "key press only", FALSE); key_state = GetAsyncKeyState(0x41); @@ -13443,8 +13443,8 @@ static void test_keyflags(void) /* keydown repeat */ keybd_event(0x41, 0, 0, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyPressRepeat, "key press repeat", FALSE); key_state = GetAsyncKeyState(0x41); @@ -13455,8 +13455,8 @@ static void test_keyflags(void) /* keyup */ keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyReleaseNormal, "key release repeat", FALSE); key_state = GetAsyncKeyState(0x41); @@ -13475,8 +13475,8 @@ static void test_keyflags(void) /* keydown */ keybd_event(0x41, 0, 0, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyPressRepeat, "key press after setkeyboardstate", TRUE); key_state = GetAsyncKeyState(0x41); @@ -13495,8 +13495,8 @@ static void test_keyflags(void) /* keyup */ keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmKeyReleaseOnly, "key release after setkeyboardstate", TRUE); key_state = GetAsyncKeyState(0x41); @@ -13620,7 +13620,7 @@ static void test_hotkey(void) return; } - test_window = CreateWindowEx(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, + test_window = CreateWindowExA(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, 0, NULL); flush_sequence(); @@ -13654,7 +13654,7 @@ static void test_hotkey(void) goto end; } - hKBD_hook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, GetModuleHandle(NULL), 0); + hKBD_hook = SetWindowsHookExA(WH_KEYBOARD_LL, KeyboardHookProc, GetModuleHandleA(NULL), 0); if (!hKBD_hook) win_skip("WH_KEYBOARD_LL is not supported\n"); /* Same key combination, different id */ @@ -13695,21 +13695,21 @@ static void test_hotkey(void) /* Inject the appropriate key sequence */ keybd_event(VK_LWIN, 0, 0, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmHotkeyPressLWIN, "window hotkey press LWIN", FALSE); keybd_event(hotkey_letter, 0, 0, 0); queue_status = GetQueueStatus(QS_HOTKEY); ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_HOTKEY) { ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); } - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyPress, "window hotkey press", FALSE); @@ -13720,40 +13720,40 @@ static void test_hotkey(void) ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state); keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmHotkeyRelease, "window hotkey release", TRUE); keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmHotkeyReleaseLWIN, "window hotkey release LWIN", FALSE); /* normal posted WM_HOTKEY messages set QS_HOTKEY */ - PostMessage(test_window, WM_HOTKEY, 0, 0); + PostMessageA(test_window, WM_HOTKEY, 0, 0); queue_status = GetQueueStatus(QS_HOTKEY); ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status); queue_status = GetQueueStatus(QS_POSTMESSAGE); ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %x\n", queue_status); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); flush_sequence(); /* Send and process all messages at once */ - PostMessage(test_window, WM_APP, 0, 0); + PostMessageA(test_window, WM_APP, 0, 0); keybd_event(VK_LWIN, 0, 0, 0); keybd_event(hotkey_letter, 0, 0, 0); keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_HOTKEY) { ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); } - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyCombined, "window hotkey combined", FALSE); @@ -13767,22 +13767,22 @@ static void test_hotkey(void) keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); ok_sequence(WmHotkeyPrevious, "window hotkey previous", FALSE); /* New key combination works */ keybd_event(hotkey_letter, 0, 0, 0); keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_HOTKEY) { ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); ok(msg.lParam == MAKELPARAM(0, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); } - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyNew, "window hotkey new", FALSE); @@ -13803,15 +13803,15 @@ static void test_hotkey(void) /* Inject the appropriate key sequence */ keybd_event(VK_LWIN, 0, 0, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyPressLWIN, "thread hotkey press LWIN", FALSE); keybd_event(hotkey_letter, 0, 0, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_HOTKEY) { @@ -13827,23 +13827,23 @@ static void test_hotkey(void) } else ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyPress, "thread hotkey press", FALSE); keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyRelease, "thread hotkey release", TRUE); keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) { ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok_sequence(WmHotkeyReleaseLWIN, "thread hotkey release LWIN", FALSE); @@ -13900,7 +13900,7 @@ static void test_SetFocus(void) HANDLE hthread; DWORD ret, tid; - wnd_event.start_event = CreateEvent(NULL, 0, 0, NULL); + wnd_event.start_event = CreateEventW(NULL, 0, 0, NULL); ok(wnd_event.start_event != 0, "CreateEvent error %d\n", GetLastError()); hthread = CreateThread(NULL, 0, thread_proc, &wnd_event, 0, &tid); ok(hthread != 0, "CreateThread error %d\n", GetLastError()); @@ -13908,10 +13908,10 @@ static void test_SetFocus(void) ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); CloseHandle(wnd_event.start_event); - parent = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, + parent = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, 0, 0, 0, NULL); ok(parent != 0, "failed to create parent window\n"); - child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD, + child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD, 0, 0, 0, 0, parent, 0, 0, NULL); ok(child != 0, "failed to create child window\n"); @@ -13929,14 +13929,14 @@ static void test_SetFocus(void) log_all_parent_messages++; old_focus = SetFocus(child); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmSetFocus_1, "SetFocus on a child window", TRUE); ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); ok(GetFocus() == child, "expected focus %p, got %p\n", child, GetFocus()); old_focus = SetFocus(parent); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmSetFocus_2, "SetFocus on a parent window", FALSE); ok(old_focus == child, "expected old focus %p, got %p\n", child, old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13946,7 +13946,7 @@ static void test_SetFocus(void) old_focus = SetFocus((HWND)0xdeadbeef); ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef), "expected ERROR_INVALID_WINDOW_HANDLE, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetFocus on an invalid window", FALSE); ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13956,7 +13956,7 @@ static void test_SetFocus(void) old_focus = SetFocus(GetDesktopWindow()); ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ || broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetFocus on a desktop window", TRUE); ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13966,7 +13966,7 @@ static void test_SetFocus(void) old_focus = SetFocus(wnd_event.hwnd); ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ || broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetFocus on another thread window", TRUE); ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13976,7 +13976,7 @@ static void test_SetFocus(void) old_active = SetActiveWindow((HWND)0xdeadbeef); ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef), "expected ERROR_INVALID_WINDOW_HANDLE, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetActiveWindow on an invalid window", FALSE); ok(old_active == 0, "expected old focus 0, got %p\n", old_active); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13986,7 +13986,7 @@ static void test_SetFocus(void) old_active = SetActiveWindow(GetDesktopWindow()); todo_wine ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetActiveWindow on a desktop window", TRUE); ok(old_active == 0, "expected old focus 0, got %p\n", old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -13996,7 +13996,7 @@ todo_wine old_active = SetActiveWindow(wnd_event.hwnd); todo_wine ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetActiveWindow on another thread window", TRUE); ok(old_active == 0, "expected old focus 0, got %p\n", old_active); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -14014,13 +14014,13 @@ todo_wine { flush_sequence(); old_focus = SetFocus(wnd_event.hwnd); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(old_focus == wnd_event.hwnd, "expected old focus %p, got %p\n", wnd_event.hwnd, old_focus); ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow()); ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus()); old_focus = SetFocus(parent); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus()); @@ -14029,7 +14029,7 @@ todo_wine { flush_sequence(); old_active = SetActiveWindow(wnd_event.hwnd); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(old_active == parent, "expected old focus %p, got %p\n", parent, old_active); ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow()); ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus()); @@ -14048,7 +14048,7 @@ todo_wine { ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus()); old_focus = SetFocus(parent); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus()); @@ -14062,7 +14062,7 @@ todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER /* Vista+ */ || broken(GetLastError() == 0) /* XP */ || broken(GetLastError() == 0xdeadbeef), "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmSetFocus_3, "SetFocus on a child window", TRUE); ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -14071,7 +14071,7 @@ todo_wine SetLastError(0xdeadbeef); old_active = SetActiveWindow(child); ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(WmEmptySeq, "SetActiveWindow on a child window", FALSE); ok(old_active == parent, "expected old active %p, got %p\n", parent, old_active); ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow()); @@ -14082,7 +14082,7 @@ todo_wine DestroyWindow(child); DestroyWindow(parent); - ret = PostMessage(wnd_event.hwnd, WM_QUIT, 0, 0); + ret = PostMessageA(wnd_event.hwnd, WM_QUIT, 0, 0); ok(ret, "PostMessage(WM_QUIT) error %d\n", GetLastError()); ret = WaitForSingleObject(hthread, INFINITE); ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); @@ -14170,7 +14170,7 @@ static void test_layered_window(void) ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE ); ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE ); ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE ); @@ -14195,8 +14195,8 @@ static void test_layered_window(void) ok( rect.right == client.right - 150 && rect.bottom == client.bottom - 50, "wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); - SetWindowLong( hwnd, GWL_STYLE, - GetWindowLong(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) ); + SetWindowLongA( hwnd, GWL_STYLE, + GetWindowLongA(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) ); ok_sequence( WmSetLayeredStyle2, "WmSetLayeredStyle2", FALSE ); size.cx = 200; @@ -14223,7 +14223,7 @@ static void test_layered_window(void) ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE ); GetWindowRect( hwnd, &rect ); ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450, @@ -14233,7 +14233,7 @@ static void test_layered_window(void) broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50), "wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); info.hwnd = hwnd; info.hdc = hdc; info.size.cx = 250; @@ -14260,7 +14260,7 @@ static void test_layered_window(void) static void init_funcs(void) { - HMODULE hKernel32 = GetModuleHandle("kernel32"); + HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); #define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) X(ActivateActCtx);