[PATCH] dlls/user32/tests/win.c: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Thu Mar 17 02:43:55 CDT 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/user32/tests/win.c | 1499 ++++++++++++++++++++++++-----------------------
 1 file changed, 750 insertions(+), 749 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index cfcec5cc78f..49bbd5894a9 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -19,6 +19,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
 
 #include <assert.h>
 #include <limits.h>
@@ -76,7 +77,7 @@ static DWORD our_pid;
 
 static void dump_minmax_info( const MINMAXINFO *minmax )
 {
-    trace("Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n",
+    trace("Reserved=%ld,%ld MaxSize=%ld,%ld MaxPos=%ld,%ld MinTrack=%ld,%ld MaxTrack=%ld,%ld\n",
           minmax->ptReserved.x, minmax->ptReserved.y,
           minmax->ptMaxSize.x, minmax->ptMaxSize.y,
           minmax->ptMaxPosition.x, minmax->ptMaxPosition.y,
@@ -186,7 +187,7 @@ static DWORD wait_for_events( DWORD count, HANDLE *events, DWORD timeout )
         else timeout = end - GetTickCount();
     }
 
-    ok( ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %#x\n", ret );
+    ok( ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %#lx\n", ret );
     return ret;
 }
 
@@ -229,7 +230,7 @@ static void test_parent_owner(void)
     test = CreateWindowExA(0, "ToolWindowClass", "Tool window 1",
                            WS_CHILD, 0, 0, 100, 100, 0, 0, 0, NULL );
     ok( !test, "WS_CHILD without parent created\n" );
-    ok( GetLastError() == ERROR_TLW_WITH_WSCHILD, "CreateWindowExA error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_TLW_WITH_WSCHILD, "CreateWindowExA error %lu\n", GetLastError() );
 
     /* desktop window */
     check_parents( desktop, 0, 0, 0, 0, 0, 0 );
@@ -681,7 +682,7 @@ static DWORD CALLBACK enum_thread( void *arg )
         info.cbSize = sizeof(info) + 1;
         ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
         ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" );
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
     }
 
     PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );  /* make sure we have a message queue */
@@ -741,7 +742,7 @@ static DWORD CALLBACK test_thread_exit_parent_thread( void *args )
 
     params->hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                                   100, 100, 200, 200, 0, 0, 0, NULL );
-    ok( params->hwnd != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+    ok( params->hwnd != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
     flush_events( TRUE );
     SetEvent( params->created_event );
 
@@ -779,22 +780,22 @@ static void test_thread_exit_destroy(void)
 
     adopter = CreateWindowW( L"static", L"adopter", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                              300, 100, 200, 200, 0, 0, 0, NULL );
-    ok( adopter != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+    ok( adopter != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
     flush_events( TRUE );
 
     thread = CreateThread( NULL, 0, test_thread_exit_parent_thread, &params, 0, NULL );
-    ok( thread != 0, "CreateThread failed, error %u\n", GetLastError() );
+    ok( thread != 0, "CreateThread failed, error %lu\n", GetLastError() );
     WaitForSingleObject( params.created_event, INFINITE );
 
     child1 = CreateWindowW( L"static", L"child1", WS_CHILD|WS_VISIBLE,
                             50, 50, 50, 50, params.hwnd, 0, 0, NULL );
-    ok( child1 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+    ok( child1 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
     child2 = CreateWindowW( L"static", L"child2", WS_CHILD|WS_VISIBLE,
                             100, 50, 50, 50, params.hwnd, 0, 0, NULL );
-    ok( child2 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+    ok( child2 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
     child3 = CreateWindowW( L"static", L"child3", WS_CHILD|WS_VISIBLE,
                             50, 100, 50, 50, params.hwnd, 0, 0, NULL );
-    ok( child3 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+    ok( child3 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
     flush_events( TRUE );
 
     trace("parent %p adopter %p child1 %p child2 %p child3 %p\n", params.hwnd, adopter, child1, child2, child3);
@@ -808,28 +809,28 @@ static void test_thread_exit_destroy(void)
     ok( GetCapture() == child1, "GetCapture %p, expected %p\n", GetCapture(), child1 );
 
     ret = SetPropW( child1, L"myprop", UlongToHandle(0xdeadbeef) );
-    ok( ret, "SetPropW failed, error %u\n", GetLastError() );
+    ok( ret, "SetPropW failed, error %lu\n", GetLastError() );
     ret = SetPropW( child2, L"myprop", UlongToHandle(0xdeadbeef) );
-    ok( ret, "SetPropW failed, error %u\n", GetLastError() );
+    ok( ret, "SetPropW failed, error %lu\n", GetLastError() );
 
     old_wndproc = (WNDPROC)GetWindowLongPtrW( child1, GWLP_WNDPROC );
-    ok( old_wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %u\n", GetLastError() );
+    ok( old_wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %lu\n", GetLastError() );
 
     ret = GetWindowLongW( child1, GWL_STYLE );
-    ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#x\n", ret );
+    ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#lx\n", ret );
 
     SetEvent( params.stop_event );
     ret = WaitForSingleObject( thread, INFINITE );
-    ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#x\n", ret );
+    ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx\n", ret );
     CloseHandle( thread );
 
     /* child windows should all still be alive but hidden */
     ret = IsWindow( child1 );
-    ok( ret, "IsWindow returned %u\n", ret );
+    ok( ret, "IsWindow returned %lu\n", ret );
     ret = IsWindow( child2 );
-    ok( ret, "IsWindow returned %u\n", ret );
+    ok( ret, "IsWindow returned %lu\n", ret );
     ret = IsWindow( child3 );
-    ok( ret, "IsWindow returned %u\n", ret );
+    ok( ret, "IsWindow returned %lu\n", ret );
 
     todo_wine
     ok( GetActiveWindow() == adopter, "GetActiveWindow %p, expected %p\n", GetActiveWindow(), adopter );
@@ -850,38 +851,38 @@ static void test_thread_exit_destroy(void)
     SetLastError( 0xdeadbeef );
     ret = GetWindowLongW( child1, GWL_STYLE );
     todo_wine
-    ok( ret == WS_CHILD, "GetWindowLongW returned %#x\n", ret );
-    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+    ok( ret == WS_CHILD, "GetWindowLongW returned %#lx\n", ret );
+    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
     ret = SetWindowLongW( child1, GWL_STYLE, WS_CHILD|WS_VISIBLE );
-    ok( ret, "SetWindowLongW failed, error %u\n", GetLastError() );
+    ok( ret, "SetWindowLongW failed, error %lu\n", GetLastError() );
     ret = GetWindowLongW( child1, GWL_STYLE );
-    ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#x\n", ret );
+    ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#lx\n", ret );
 
     /* and cannot be adopted */
     SetLastError( 0xdeadbeef );
     tmp = GetParent( child1 );
-    ok( tmp == params.hwnd, "GetParent returned %p, error %u\n", tmp, GetLastError() );
-    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+    ok( tmp == params.hwnd, "GetParent returned %p, error %lu\n", tmp, GetLastError() );
+    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
     SetLastError( 0xdeadbeef );
     tmp = SetParent( child1, adopter );
     ok( tmp == 0, "SetParent returned %p\n", tmp );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
     SetLastError( 0xdeadbeef );
     tmp = SetParent( child3, adopter );
     ok( tmp == 0, "SetParent returned %p\n", tmp );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
     SetLastError( 0xdeadbeef );
     tmp = GetParent( child1 );
-    ok( tmp == params.hwnd, "GetParent returned %p, error %u\n", tmp, GetLastError() );
-    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+    ok( tmp == params.hwnd, "GetParent returned %p, error %lu\n", tmp, GetLastError() );
+    ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
 
     SetLastError( 0xdeadbeef );
     ret = GetWindowLongW( params.hwnd, GWL_STYLE );
-    ok( ret == 0, "GetWindowLongW returned %#x\n", ret );
-    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetWindowLongW error %u\n", GetLastError() );
+    ok( ret == 0, "GetWindowLongW returned %#lx\n", ret );
+    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetWindowLongW error %lu\n", GetLastError() );
 
     wndproc = (WNDPROC)GetWindowLongPtrW( child1, GWLP_WNDPROC );
-    ok( wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %u\n", GetLastError() );
+    ok( wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %lu\n", GetLastError() );
     ok( wndproc == old_wndproc, "GetWindowLongPtrW GWLP_WNDPROC returned %p\n", wndproc );
 
     tmp = GetPropW( child1, L"myprop" );
@@ -892,58 +893,58 @@ static void test_thread_exit_destroy(void)
     child = CreateWindowExA( 0, "ToolWindowClass", "Tool window 1", WS_CHILD,
                              0, 0, 100, 100, child1, 0, 0, NULL );
     ok( !child && GetLastError() == ERROR_INVALID_PARAMETER,
-        "CreateWindowExA returned %p %u\n", child, GetLastError() );
+        "CreateWindowExA returned %p %lu\n", child, GetLastError() );
 
     ret = MoveWindow( child1, 5, 5, 10, 10, FALSE );
-    ok( ret, "MoveWindow failed: %u\n", GetLastError() );
+    ok( ret, "MoveWindow failed: %lu\n", GetLastError() );
 
     /* destroying child1 ourselves succeeds */
     ret = DestroyWindow( child1 );
-    ok( ret, "DestroyWindow returned %u\n", ret );
+    ok( ret, "DestroyWindow returned %lu\n", ret );
     ret = DestroyWindow( child1 );
-    ok( !ret, "DestroyWindow returned %u\n", ret );
+    ok( !ret, "DestroyWindow returned %lu\n", ret );
     ret = IsWindow( child1 );
-    ok( !ret, "IsWindow returned %u\n", ret );
+    ok( !ret, "IsWindow returned %lu\n", ret );
 
     tmp = GetPropW( child1, L"myprop" );
     ok( HandleToULong(tmp) == 0, "GetPropW returned %p\n", tmp );
 
     /* child2 is still alive, for now */
     ret = IsWindow( child2 );
-    ok( ret, "IsWindow returned %u\n", ret );
+    ok( ret, "IsWindow returned %lu\n", ret );
 
     SetLastError( 0xdeadbeef );
     ret = SetWindowPos( child2, HWND_TOPMOST, 0, 0, 100, 100, SWP_NOSIZE|SWP_NOMOVE );
     todo_wine
     ok( !ret, "SetWindowPos succeeded\n" );
     todo_wine
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
     SetLastError( 0xdeadbeef );
     ret = SetWindowPos( child2, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE );
     todo_wine
     ok( !ret, "SetWindowPos succeeded\n" );
     todo_wine
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
 
     rgn = CreateRectRgn( 5, 5, 15, 15 );
     SetLastError( 0xdeadbeef );
     ret = SetWindowRgn( child2, rgn, TRUE );
-    ok( ret, "SetWindowRgn failed, error %u\n", GetLastError() );
+    ok( ret, "SetWindowRgn failed, error %lu\n", GetLastError() );
     DeleteObject( rgn );
 
     wndproc = (WNDPROC)SetWindowLongPtrW( child2, GWLP_WNDPROC, (LONG_PTR)test_thread_exit_wnd_proc );
     ret = SendMessageW( child2, WM_USER, 0, 0 );
-    ok( ret == 0xdeadbeef, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+    ok( ret == 0xdeadbeef, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
     ret = SendMessageW( child2, WM_USER + 1, 0, 0 );
-    ok( ret == 0xfeedcafe, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+    ok( ret == 0xfeedcafe, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
     ret = SendMessageW( child2, WM_USER + 2, 0, 0 );
-    ok( ret == 0, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+    ok( ret == 0, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
 
     ret = GetWindowTextW( child2, buffer, ARRAY_SIZE(buffer) );
-    ok( ret == 6, "GetWindowTextW returned %u\n", ret );
+    ok( ret == 6, "GetWindowTextW returned %lu\n", ret );
     ok( !wcscmp( buffer, L"child2" ), "GetWindowTextW returned %s\n", debugstr_w( buffer ) );
     ret = IsWindow( child2 );
-    ok( ret, "IsWindow returned %u\n", ret );
+    ok( ret, "IsWindow returned %lu\n", ret );
 
     /* but peeking any message should reap them all */
     PeekMessageW( &msg, child2, 0, 0, PM_REMOVE );
@@ -952,12 +953,12 @@ static void test_thread_exit_destroy(void)
     ok( HandleToULong(tmp) == 0, "GetPropW returned %p\n", tmp );
 
     ret = IsWindow( child2 );
-    ok( !ret, "IsWindow returned %u\n", ret );
+    ok( !ret, "IsWindow returned %lu\n", ret );
     ret = IsWindow( child3 );
     todo_wine
-    ok( !ret, "IsWindow returned %u\n", ret );
+    ok( !ret, "IsWindow returned %lu\n", ret );
     ret = DestroyWindow( child2 );
-    ok( !ret, "DestroyWindow returned %u\n", ret );
+    ok( !ret, "DestroyWindow returned %lu\n", ret );
 
     DestroyWindow( adopter );
 
@@ -1025,7 +1026,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
 
             GetClientRect(hwnd, &rc2);
             ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
-            ok(!ret, "got %08lx\n", ret);
+            ok(!ret, "got %08Ix\n", ret);
             MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
             ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
                wine_dbgstr_rect(&rc2));
@@ -1082,7 +1083,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
     }
@@ -1119,7 +1120,7 @@ static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPAR
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
     }
@@ -1151,7 +1152,7 @@ static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
     }
@@ -1224,17 +1225,17 @@ static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *in
     ok(EqualRect(&rcClient, &info->rcClient), "wrong rcClient for %p in hook %s\n", hwnd, hook);
 
     ok(info->dwStyle == (DWORD)GetWindowLongA(hwnd, GWL_STYLE),
-       "wrong dwStyle: %08x != %08x for %p in hook %s\n",
+       "wrong dwStyle: %08lx != %08lx for %p in hook %s\n",
        info->dwStyle, GetWindowLongA(hwnd, GWL_STYLE), hwnd, hook);
     /* Windows reports some undocumented exstyles in WINDOWINFO, but
      * doesn't return them in GetWindowLong(hwnd, GWL_EXSTYLE).
      */
     ok((info->dwExStyle & ~0xe0000800) == (DWORD)GetWindowLongA(hwnd, GWL_EXSTYLE),
-       "wrong dwExStyle: %08x != %08x for %p in hook %s\n",
+       "wrong dwExStyle: %08lx != %08lx for %p in hook %s\n",
        info->dwExStyle, GetWindowLongA(hwnd, GWL_EXSTYLE), hwnd, hook);
     status = (GetActiveWindow() == hwnd) ? WS_ACTIVECAPTION : 0;
     if (GetForegroundWindow())
-        ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04x != %04x active %p fg %p in hook %s\n",
+        ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04lx != %04lx active %p fg %p in hook %s\n",
            info->dwWindowStatus, status, GetActiveWindow(), GetForegroundWindow(), hook);
 
     /* win2k and XP return broken border info in GetWindowInfo most of
@@ -1244,7 +1245,7 @@ if (0)
 {
     UINT border;
     ok(info->cxWindowBorders == (unsigned)(rcClient.left - rcWindow.left),
-       "wrong cxWindowBorders %d != %d\n", info->cxWindowBorders, rcClient.left - rcWindow.left);
+       "wrong cxWindowBorders %d != %ld\n", info->cxWindowBorders, rcClient.left - rcWindow.left);
     border = min(rcWindow.bottom - rcClient.bottom, rcClient.top - rcWindow.top);
     ok(info->cyWindowBorders == border,
        "wrong cyWindowBorders %d != %d\n", info->cyWindowBorders, border);
@@ -1267,13 +1268,13 @@ static void test_window_info(const char *hook, HWND hwnd)
     SetLastError(0xdeadbeef);
     ok(!pGetWindowInfo(0, NULL), "GetWindowInfo should fail\n");
     ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
-       "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+       "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
     }
 
     SetLastError(0xdeadbeef);
     ok(!pGetWindowInfo(0, &info), "GetWindowInfo should fail\n");
     ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
-       "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+       "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
 
     info.cbSize = sizeof(WINDOWINFO);
     ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
@@ -1422,7 +1423,7 @@ static LRESULT CALLBACK test_standard_scrollbar_proc(HWND hwnd, UINT msg, WPARAM
     case WM_NCCALCSIZE:
     {
         LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wp, lp);
-        ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wp, lp);
+        ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wp, lp);
         return ret;
     }
 
@@ -1462,28 +1463,28 @@ static void test_nonclient_area(HWND hwnd)
     FixedAdjustWindowRectEx(&rc, style, menu, exstyle);
 
     ok(EqualRect(&rc, &rc_window),
-       "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
+       "window rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, win=%s, calc=%s\n",
        style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
 
     rc = rc_client;
     MapWindowPoints(hwnd, 0, (LPPOINT)&rc, 2);
     wine_AdjustWindowRectEx(&rc, style, menu, exstyle);
     ok(EqualRect(&rc, &rc_window),
-       "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
+       "window rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, win=%s, calc=%s\n",
        style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
 
 
     rc = rc_window;
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
     ok(EqualRect(&rc, &rc_client),
-       "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=%s, calc=%s\n",
+       "client rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d client=%s, calc=%s\n",
        style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
 
     /* NULL rectangle shouldn't crash */
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0);
-    ok(ret == 0, "NULL rectangle returned %ld instead of 0\n", ret);
+    ok(ret == 0, "NULL rectangle returned %Id instead of 0\n", ret);
 
     /* and now test AdjustWindowRectEx and WM_NCCALCSIZE on synthetic data */
     SetRect(&rc_client, 0, 0, 250, 150);
@@ -1493,17 +1494,17 @@ static void test_nonclient_area(HWND hwnd)
 
     rc = rc_window;
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
     ok(EqualRect(&rc, &rc_client),
-       "synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=%s, calc=%s\n",
+       "synthetic rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, client=%s, calc=%s\n",
        style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
 
     /* Test standard scroll bars */
     uxtheme = LoadLibraryA("uxtheme.dll");
-    ok(!!uxtheme, "Failed to load uxtheme.dll, error %u.\n", GetLastError());
+    ok(!!uxtheme, "Failed to load uxtheme.dll, error %lu.\n", GetLastError());
     pIsThemeActive = (void *)GetProcAddress(uxtheme, "IsThemeActive");
-    ok(!!pIsThemeActive, "Failed to load IsThemeActive, error %u.\n", GetLastError());
+    ok(!!pIsThemeActive, "Failed to load IsThemeActive, error %lu.\n", GetLastError());
     is_theme_active = pIsThemeActive();
 
     memset(&cls, 0, sizeof(cls));
@@ -1521,7 +1522,7 @@ static void test_nonclient_area(HWND hwnd)
 
     parent = CreateWindowA("TestStandardScrollbarParentClass", "parent", WS_POPUP | WS_VISIBLE, 100,
                            100, 100, 100, NULL, NULL, 0, NULL);
-    ok(!!parent, "Failed to create a parent window, error %u.\n", GetLastError());
+    ok(!!parent, "Failed to create a parent window, error %lu.\n", GetLastError());
     GetCursorPos(&old_cursor_pos);
 
     /* Place the cursor on the standard scroll bar arrow button when not painting it at all.
@@ -1529,16 +1530,16 @@ static void test_nonclient_area(HWND hwnd)
     offset = GetSystemMetrics(SM_CYHSCROLL);
     child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE,
                           0, 0, 50, 50, parent, NULL, 0, NULL);
-    ok(!!child, "Failed to create a test window, error %u.\n", GetLastError());
+    ok(!!child, "Failed to create a test window, error %lu.\n", GetLastError());
     hdc = GetDC(parent);
-    ok(!!hdc, "GetDC failed, error %d.\n", GetLastError());
+    ok(!!hdc, "GetDC failed, error %ld.\n", GetLastError());
 
     SetCursorPos(0, 0);
     flush_events(TRUE);
     RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME);
     old_color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2,
                          50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
-    ok(old_color == 0xc0c0c0, "Expected color %#x, got %#x.\n", 0xc0c0c0, old_color);
+    ok(old_color == 0xc0c0c0, "Expected color %#x, got %#lx.\n", 0xc0c0c0, old_color);
 
     point.x = 50 - GetSystemMetrics(SM_CXVSCROLL) / 2;
     point.y = 50 - GetSystemMetrics(SM_CYHSCROLL) / 2;
@@ -1548,7 +1549,7 @@ static void test_nonclient_area(HWND hwnd)
     RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME);
     color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2,
                      50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
-    ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color);
+    ok(color == old_color, "Expected color %#lx, got %#lx.\n", old_color, color);
 
     ReleaseDC(parent, hdc);
     DestroyWindow(child);
@@ -1558,9 +1559,9 @@ static void test_nonclient_area(HWND hwnd)
     offset = GetSystemMetrics(SM_CYHSCROLL) - 1;
     child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE,
                           0, 0, 50, 50, parent, NULL, 0, NULL);
-    ok(!!child, "Failed to create a test window, error %u.\n", GetLastError());
+    ok(!!child, "Failed to create a test window, error %lu.\n", GetLastError());
     hdc = GetDC(parent);
-    ok(!!hdc, "GetDC failed, error %d.\n", GetLastError());
+    ok(!!hdc, "GetDC failed, error %ld.\n", GetLastError());
 
     SetCursorPos(0, 0);
     flush_events(TRUE);
@@ -1578,10 +1579,10 @@ static void test_nonclient_area(HWND hwnd)
                      50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
     if (is_theme_active)
         ok(color != old_color || broken(color == old_color), /* Win 10 1507 64-bit */
-           "Got unexpected color %#x.\n", color);
+           "Got unexpected color %#lx.\n", color);
     else
         todo_wine
-        ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color);
+        ok(color == old_color, "Expected color %#lx, got %#lx.\n", old_color, color);
 
     SetCursorPos(old_cursor_pos.x, old_cursor_pos.y);
     ReleaseDC(parent, hdc);
@@ -1623,7 +1624,7 @@ static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
 	    /* WS_VISIBLE should be turned off yet */
 	    style = createwnd->lpcs->style & ~WS_VISIBLE;
             ok(style == GetWindowLongA(hwnd, GWL_STYLE),
-                    "style of hwnd and style in the CREATESTRUCT do not match: %08x != %08x\n",
+                    "style of hwnd and style in the CREATESTRUCT do not match: %08lx != %08lx\n",
                     GetWindowLongA(hwnd, GWL_STYLE), style);
 
             if (0)
@@ -1827,7 +1828,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1838,7 +1839,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0);
@@ -1854,7 +1855,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     {
         ok(mdi_child != 0, "MDI child creation failed\n");
         id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-        ok(id == first_id, "wrong child id %ld\n", id);
+        ok(id == first_id, "wrong child id %Id\n", id);
         hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
         ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
         ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1871,7 +1872,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     mdi_child = (HWND)SendMessageW(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1887,7 +1888,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                  (LPARAM)mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1903,7 +1904,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                  (LPARAM)mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1924,7 +1925,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     {
         ok(mdi_child != 0, "MDI child creation failed\n");
         id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-        ok(id == first_id, "wrong child id %ld\n", id);
+        ok(id == first_id, "wrong child id %Id\n", id);
         hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
         ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
         ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1942,7 +1943,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                  (LPARAM)mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1958,7 +1959,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1974,7 +1975,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1993,7 +1994,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2014,7 +2015,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
     {
         ok(mdi_child != 0, "MDI child creation failed\n");
         id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-        ok(id == first_id, "wrong child id %ld\n", id);
+        ok(id == first_id, "wrong child id %Id\n", id);
         hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
         ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
         ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2032,7 +2033,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == first_id, "wrong child id %ld\n", id);
+    ok(id == first_id, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
     ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -2056,7 +2057,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == 0, "wrong child id %ld\n", id);
+    ok(id == 0, "wrong child id %Id\n", id);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
@@ -2070,7 +2071,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == 0, "wrong child id %ld\n", id);
+    ok(id == 0, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2085,7 +2086,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == 0, "wrong child id %ld\n", id);
+    ok(id == 0, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2099,7 +2100,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == 0, "wrong child id %ld\n", id);
+    ok(id == 0, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2113,7 +2114,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
                                 mdi_lParam_test_message);
     ok(mdi_child != 0, "MDI child creation failed\n");
     id = GetWindowLongPtrA(mdi_child, GWLP_ID);
-    ok(id == 0, "wrong child id %ld\n", id);
+    ok(id == 0, "wrong child id %Id\n", id);
     hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
     ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
     ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2233,7 +2234,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
 
             /* MDICREATESTRUCT should have original values */
             ok(mdi_cs->style == 0 || mdi_cs->style == 0x7fffffff || mdi_cs->style == 0xffffffff || mdi_cs->style == WS_MAXIMIZE,
-                "mdi_cs->style does not match (%08x)\n", mdi_cs->style);
+                "mdi_cs->style does not match (%08lx)\n", mdi_cs->style);
             ok(mdi_cs->x == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->x);
             ok(mdi_cs->y == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->y);
             ok(mdi_cs->cx == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cx);
@@ -2253,7 +2254,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
             {
                 LONG style = mdi_cs->style | WS_CHILD | WS_CLIPSIBLINGS;
                 ok(cs->style == style,
-                   "cs->style does not match (%08x)\n", cs->style);
+                   "cs->style does not match (%08lx)\n", cs->style);
             }
             else
             {
@@ -2262,7 +2263,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
                 style |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION |
                     WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
                 ok(cs->style == style,
-                   "cs->style does not match (%08x)\n", cs->style);
+                   "cs->style does not match (%08lx)\n", cs->style);
             }
             break;
         }
@@ -2286,13 +2287,13 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
             AdjustWindowRectEx(&rc, style, 0, exstyle);
             if (winetest_debug > 1)
             {
-                trace("MDI child: calculated max window size = (%d x %d)\n", rc.right-rc.left, rc.bottom-rc.top);
+                trace("MDI child: calculated max window size = (%ld x %ld)\n", rc.right-rc.left, rc.bottom-rc.top);
                 dump_minmax_info( minmax );
             }
 
-            ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %ld != %ld\n",
                minmax->ptMaxSize.x, rc.right - rc.left);
-            ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %ld != %ld\n",
                minmax->ptMaxSize.y, rc.bottom - rc.top);
 
             DefMDIChildProcA(hwnd, msg, wparam, lparam);
@@ -2304,9 +2305,9 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
             }
 
             MDI_ChildGetMinMaxInfo(client, hwnd, &my_minmax);
-            ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %ld != %ld\n",
                minmax->ptMaxSize.x, my_minmax.ptMaxSize.x);
-            ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %ld != %ld\n",
                minmax->ptMaxSize.y, my_minmax.ptMaxSize.y);
 
             return 1;
@@ -2369,7 +2370,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
             GetClientRect(parent, &rc);
             if (winetest_debug > 1)
             {
-                trace("WM_GETMINMAXINFO: parent %p client size = (%d x %d)\n", parent, rc.right, rc.bottom);
+                trace("WM_GETMINMAXINFO: parent %p client size = (%ld x %ld)\n", parent, rc.right, rc.bottom);
                 dump_minmax_info( minmax );
             }
             GetClientRect(parent, &rc);
@@ -2377,9 +2378,9 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
                 style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
             AdjustWindowRectEx(&rc, style, 0, exstyle);
 
-            ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %ld != %ld\n",
                minmax->ptMaxSize.x, rc.right - rc.left);
-            ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
+            ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %ld != %ld\n",
                minmax->ptMaxSize.y, rc.bottom - rc.top);
             break;
         }
@@ -2399,7 +2400,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
             GetWindowRect(hwnd, &rc1);
             GetClientRect(hwnd, &rc2);
             ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
-            ok(!ret, "got %08lx\n", ret);
+            ok(!ret, "got %08Ix\n", ret);
             MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
             ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s client=%s\n",
                wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
@@ -2429,7 +2430,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
     }
@@ -2492,7 +2493,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefFrameProcA(hwnd, mdi_client, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
 
@@ -2562,7 +2563,7 @@ static void test_mdi(void)
         SCROLLINFO si;
         BOOL ret, gotit;
 
-        winetest_push_context("style %#x", style[i]);
+        winetest_push_context("style %#lx", style[i]);
         mdi_client = CreateWindowExA(0, "mdiclient", NULL,
                                  WS_CHILD | style[i],
                                  0, 0, rc.right, rc.bottom,
@@ -2797,11 +2798,11 @@ static void check_icon_size_( int line, HICON icon, LONG width, LONG height )
     BOOL ret;
 
     ret = GetIconInfo( icon, &info );
-    ok_(__FILE__, line)(ret, "failed to get icon info, error %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "failed to get icon info, error %lu\n", GetLastError());
     ret = GetObjectW(info.hbmColor, sizeof(bitmap), &bitmap);
-    ok_(__FILE__, line)(ret, "failed to get bitmap, error %u\n", GetLastError());
-    ok_(__FILE__, line)(bitmap.bmWidth == width, "expected width %d, got %d\n", width, bitmap.bmWidth);
-    ok_(__FILE__, line)(bitmap.bmHeight == height, "expected height %d, got %d\n", height, bitmap.bmHeight);
+    ok_(__FILE__, line)(ret, "failed to get bitmap, error %lu\n", GetLastError());
+    ok_(__FILE__, line)(bitmap.bmWidth == width, "expected width %ld, got %d\n", width, bitmap.bmWidth);
+    ok_(__FILE__, line)(bitmap.bmHeight == height, "expected height %ld, got %d\n", height, bitmap.bmHeight);
 }
 
 #define check_internal_icon_size(a, b, c, d) check_internal_icon_size_(__LINE__, a, b, c, d)
@@ -2814,7 +2815,7 @@ static void check_internal_icon_size_( int line, HANDLE window, UINT type, LONG
     ok_(__FILE__, line)(icon != 0, "expected nonzero icon\n");
     check_icon_size_( line, icon, width, height );
     ret = DestroyIcon( icon );
-    ok_(__FILE__, line)(ret, "failed to destroy icon, error %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "failed to destroy icon, error %lu\n", GetLastError());
 }
 
 static DWORD WINAPI internal_get_icon_thread(void *arg)
@@ -2825,7 +2826,7 @@ static DWORD WINAPI internal_get_icon_thread(void *arg)
     icon = pInternalGetWindowIcon( arg, ICON_BIG );
     ok( icon != 0, "expected nonzero icon\n" );
     ret = DestroyIcon( icon );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     return 0;
 }
@@ -2861,15 +2862,15 @@ static void test_icons(void)
     SetLastError( 0xdeadbeef );
     res = pInternalGetWindowIcon( hwnd, ICON_BIG );
     ok( res != 0, "expected nonzero icon\n" );
-    ok( GetLastError() == 0xdeadbeef, "got error %u\n", GetLastError() );
+    ok( GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError() );
     check_icon_size( res, 40, 40 );
     res2 = pInternalGetWindowIcon( hwnd, ICON_BIG );
     ok( res2 && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, 40, 40 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
     ret = DestroyIcon( res );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL, 0 );
     ok( !res, "wrong small icon %p\n", res );
@@ -2880,9 +2881,9 @@ static void test_icons(void)
     ok( res2 && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, 50, 50 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
     ret = DestroyIcon( res );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
     ok( !res, "wrong small2 icon %p\n", res );
@@ -2893,9 +2894,9 @@ static void test_icons(void)
     ok( res2 && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, 50, 50 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
     ret = DestroyIcon( res );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon );
     ok( res == 0, "wrong previous big icon %p/0\n", res );
@@ -2905,7 +2906,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon, "got %p\n", res2 );
     check_icon_size( res2, 10, 10 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon2 );
     ok( res == icon, "wrong previous big icon %p/%p\n", res, icon );
@@ -2915,7 +2916,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon2, "got %p\n", res2 );
     check_icon_size( res2, 20, 20 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL, 0 );
     ok( res == 0, "wrong small icon %p/0\n", res );
@@ -2923,7 +2924,7 @@ static void test_icons(void)
     ok( res2 != 0, "expected nonzero icon\n" );
     check_icon_size( res2, small_width, small_height );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
     ok( res && res != icon3 && res != icon2, "wrong small2 icon %p\n", res );
@@ -2934,7 +2935,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon3 && res2 != icon2 && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, small_width, small_height );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon );
     ok( res == 0, "wrong previous small icon %p/0\n", res );
@@ -2944,7 +2945,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon, "got %p\n", res2 );
     check_icon_size( res2, 10, 10 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
     ok( res == icon, "wrong small2 icon after set %p/%p\n", res, icon );
@@ -2952,7 +2953,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, 10, 10 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon3 );
     ok( res == icon, "wrong previous small icon %p/%p\n", res, icon );
@@ -2962,7 +2963,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon3, "got %p\n", res2 );
     check_icon_size( res2, 30, 30 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
     ok( res == icon3, "wrong small2 icon after set %p/%p\n", res, icon3 );
@@ -2970,7 +2971,7 @@ static void test_icons(void)
     ok( res2 && res2 != icon3 && res2 != res, "got %p\n", res2 );
     check_icon_size( res2, 30, 30 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     /* make sure the big icon hasn't changed */
     res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_BIG, 0 );
@@ -2979,17 +2980,17 @@ static void test_icons(void)
     ok( res2 && res2 != icon2, "got %p\n", res2 );
     check_icon_size( res2, 20, 20 );
     ret = DestroyIcon( res2 );
-    ok( ret, "got error %u\n", GetLastError() );
+    ok( ret, "got error %lu\n", GetLastError() );
 
     SetLastError( 0xdeadbeef );
     res = pInternalGetWindowIcon( NULL, ICON_BIG );
     ok( !res, "got %p\n", res );
-    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got error %lu\n", GetLastError() );
 
     SetLastError( 0xdeadbeef );
     res = pInternalGetWindowIcon( hwnd, 0xdeadbeef );
     ok( !res, "got %p\n", res );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
 
     thread = CreateThread( NULL, 0, internal_get_icon_thread, hwnd, 0, NULL );
     ret = WaitForSingleObject( thread, 1000 );
@@ -3133,13 +3134,13 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
     ok(ret, "Got %d\n", ret);
 
     hwnd_desktop = GetDesktopWindow();
-    ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%d).\n", GetLastError());
+    ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%ld).\n", GetLastError());
     hwnd_child = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd);
-    ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+    ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
     hwnd_grandchild = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd_child);
-    ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+    ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
     hwnd_child2 = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd);
-    ok(!!hwnd_child2, "Failed to create second child window (%d)\n", GetLastError());
+    ok(!!hwnd_child2, "Failed to create second child window (%ld)\n", GetLastError());
 
     ret = SetWindowPos(hwnd, hwnd2, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
     ok(ret, "Got %d\n", ret);
@@ -3277,7 +3278,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
     DestroyWindow(hwnd_child2);
 
     hwnd_child = create_tool_window(WS_CHILD|WS_POPUP|WS_SYSMENU, hwnd2);
-    ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+    ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
     ret = SetWindowPos(hwnd_child, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_SHOWWINDOW);
     ok(ret, "Got %d\n", ret);
     flush_events( TRUE );
@@ -3305,7 +3306,7 @@ static void test_SetMenu(HWND parent)
     ok(ret == hMenu, "unexpected menu id %p\n", ret);
     /* test whether we can destroy a menu assigned to a window */
     retok = DestroyMenu(hMenu);
-    ok( retok, "DestroyMenu error %d\n", GetLastError());
+    ok( retok, "DestroyMenu error %ld\n", GetLastError());
     retok = IsMenu(hMenu);
     ok(!retok, "menu handle should be not valid after DestroyMenu\n");
     ret = GetMenu(parent);
@@ -3409,7 +3410,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
 
     for (i = 0; i < total; i++)
     {
-        ok(child[order[i]] == hwnd, "Z order of child #%ld is wrong\n", i);
+        ok(child[order[i]] == hwnd, "Z order of child #%Id is wrong\n", i);
         hwnd = GetWindow(hwnd, GW_HWNDNEXT);
     }
 
@@ -3677,7 +3678,7 @@ static void test_SetFocus(HWND hwnd)
     ok( GetFocus() == child, "Focus should be on child %p\n", child );
     SetLastError(0xdeadbeef);
     EnableWindow(hwnd, FALSE);
-    ok(GetLastError() == 0xdeadbeef, "got error %u in EnableWindow call\n", GetLastError());
+    ok(GetLastError() == 0xdeadbeef, "got error %lu in EnableWindow call\n", GetLastError());
     ok( GetFocus() == child, "Focus should still be on child %p\n", child );
     EnableWindow(hwnd, TRUE);
 
@@ -3736,16 +3737,16 @@ static void test_SetActiveWindow_0_proc( char **argv )
 
     sscanf( argv[3], "%p", &other );
     start_event = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_start" );
-    ok( start_event != 0, "CreateEventW failed, error %u\n", GetLastError() );
+    ok( start_event != 0, "CreateEventW failed, error %lu\n", GetLastError() );
     stop_event = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_stop" );
-    ok( stop_event != 0, "CreateEventW failed, error %u\n", GetLastError() );
+    ok( stop_event != 0, "CreateEventW failed, error %lu\n", GetLastError() );
 
     hwnd = CreateWindowExA( 0, "static", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, NULL, NULL );
-    ok( !!hwnd, "CreateWindowExA failed, error %u\n", GetLastError() );
+    ok( !!hwnd, "CreateWindowExA failed, error %lu\n", GetLastError() );
     flush_events( TRUE );
 
     ret = SetForegroundWindow( hwnd );
-    ok( ret, "SetForegroundWindow failed, error %u\n", GetLastError() );
+    ok( ret, "SetForegroundWindow failed, error %lu\n", GetLastError() );
 
     tmp = GetForegroundWindow();
     ok( tmp == hwnd, "GetForegroundWindow returned %p\n", tmp );
@@ -3756,12 +3757,12 @@ static void test_SetActiveWindow_0_proc( char **argv )
 
     SetLastError( 0xdeadbeef );
     tmp = SetActiveWindow( 0 );
-    if (!tmp) ok( GetLastError() == 0xdeadbeef, "got error %u\n", GetLastError() );
+    if (!tmp) ok( GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError() );
     else /* < Win10 */
     {
         ok( tmp == hwnd, "SetActiveWindow returned %p\n", tmp );
         todo_wine
-        ok( GetLastError() == 0, "got error %u\n", GetLastError() );
+        ok( GetLastError() == 0, "got error %lu\n", GetLastError() );
 
         tmp = GetForegroundWindow();
         ok( tmp == other || tmp == 0, "GetForegroundWindow returned %p\n", tmp );
@@ -3809,7 +3810,7 @@ static void test_SetActiveWindow_0( char **argv )
     BOOL ret;
 
     hwnd = CreateWindowExA( 0, "static", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, NULL, NULL );
-    ok( !!hwnd, "CreateWindowExA failed, error %u\n", GetLastError() );
+    ok( !!hwnd, "CreateWindowExA failed, error %lu\n", GetLastError() );
     SetWindowPos( hwnd, HWND_TOPMOST, 150, 150, 300, 300, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
     flush_events( TRUE );
 
@@ -3821,13 +3822,13 @@ static void test_SetActiveWindow_0( char **argv )
     ok( tmp == hwnd, "GetFocus returned %p\n", tmp );
 
     events[1] = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_start" );
-    ok( events[1] != 0, "CreateEventW failed, error %u\n", GetLastError() );
+    ok( events[1] != 0, "CreateEventW failed, error %lu\n", GetLastError() );
     events[2] = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_stop" );
-    ok( events[2] != 0, "CreateEventW failed, error %u\n", GetLastError() );
+    ok( events[2] != 0, "CreateEventW failed, error %lu\n", GetLastError() );
 
     sprintf( cmdline, "%s %s SetActiveWindow_0 %p", argv[0], argv[1], hwnd );
     ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info );
-    ok( ret, "CreateProcessA failed, error %u\n", GetLastError() );
+    ok( ret, "CreateProcessA failed, error %lu\n", GetLastError() );
 
     events[0] = info.hProcess;
     if (wait_for_events( 2, events, INFINITE ) == 1)
@@ -3903,7 +3904,7 @@ static void test_SetActiveWindow(HWND hwnd)
     ret = SetActiveWindow(GetDesktopWindow());
     ok(ret == NULL, "expected NULL, got %p\n", ret);
     todo_wine
-    ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError());
+    ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError());
     check_wnd_state(hwnd, hwnd, hwnd, 0);
 
     /* activating a child should activate the parent */
@@ -3932,10 +3933,10 @@ static DWORD WINAPI create_window_thread(void *param)
     p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
 
     ret = SetEvent(p->window_created);
-    ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
+    ok(ret, "SetEvent failed, last error %#lx.\n", GetLastError());
 
     res = WaitForSingleObject(p->test_finished, INFINITE);
-    ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+    ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %#lx.\n", res, GetLastError());
 
     DestroyWindow(p->window);
     return 0;
@@ -3970,7 +3971,7 @@ static void test_SetForegroundWindow(HWND hwnd)
     ret = SetForegroundWindow(0);
     ok(!ret, "SetForegroundWindow returned TRUE instead of FALSE\n");
     ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
-       "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+       "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
     check_wnd_state(hwnd, hwnd, hwnd, 0);
 
     SetWindowPos(hwnd,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_HIDEWINDOW);
@@ -3982,7 +3983,7 @@ static void test_SetForegroundWindow(HWND hwnd)
     hwnd2 = GetForegroundWindow();
     ok(hwnd2 == hwnd, "Wrong foreground window %p\n", hwnd2);
     ret = SetForegroundWindow( GetDesktopWindow() );
-    ok(ret, "SetForegroundWindow(desktop) error: %d\n", GetLastError());
+    ok(ret, "SetForegroundWindow(desktop) error: %ld\n", GetLastError());
     hwnd2 = GetForegroundWindow();
     ok(hwnd2 != hwnd, "Wrong foreground window %p\n", hwnd2);
 
@@ -4016,13 +4017,13 @@ static void test_SetForegroundWindow(HWND hwnd)
     check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
 
     thread_params.window_created = CreateEventW(NULL, FALSE, FALSE, NULL);
-    ok(!!thread_params.window_created, "CreateEvent failed, last error %#x.\n", GetLastError());
+    ok(!!thread_params.window_created, "CreateEvent failed, last error %#lx.\n", GetLastError());
     thread_params.test_finished = CreateEventW(NULL, FALSE, FALSE, NULL);
-    ok(!!thread_params.test_finished, "CreateEvent failed, last error %#x.\n", GetLastError());
+    ok(!!thread_params.test_finished, "CreateEvent failed, last error %#lx.\n", GetLastError());
     thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid);
-    ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError());
+    ok(!!thread, "Failed to create thread, last error %#lx.\n", GetLastError());
     res = WaitForSingleObject(thread_params.window_created, INFINITE);
-    ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+    ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %#lx.\n", res, GetLastError());
     check_wnd_state(hwnd2, thread_params.window, hwnd2, 0);
 
     SetForegroundWindow(hwnd2);
@@ -4235,11 +4236,11 @@ static LRESULT CALLBACK test_capture_4_proc(HWND hWnd, UINT msg, WPARAM wParam,
                 gti.cbSize = sizeof(GUITHREADINFO);
                 status = pGetGUIThreadInfo(GetCurrentThreadId(), &gti);
                 ok(status, "GetGUIThreadInfo() failed!\n");
-                ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08X)!\n", gti.flags);
+                ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08lX)!\n", gti.flags);
             }
             cap_wnd = GetCapture();
 
-            ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %lx\n", cap_wnd, lParam);
+            ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %Ix\n", cap_wnd, lParam);
             todo_wine ok(cap_wnd == hWnd, "capture window %p does not match hwnd %p\n", cap_wnd, hWnd);
 
             /* check that re-setting the capture for the menu fails */
@@ -4266,7 +4267,7 @@ static LRESULT CALLBACK test_capture_4_proc(HWND hWnd, UINT msg, WPARAM wParam,
                 gti.cbSize = sizeof(GUITHREADINFO);
                 status = pGetGUIThreadInfo(GetCurrentThreadId(), &gti);
                 ok(status, "GetGUIThreadInfo() failed!\n");
-                ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08X)!\n", gti.flags);
+                ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08lX)!\n", gti.flags);
             }
 
             /* verify that no capture change took place */
@@ -4309,11 +4310,11 @@ static void test_capture_4(void)
     wclass.cbClsExtra    = 0;
     wclass.cbWndExtra    = 0;
     aclass = RegisterClassA( &wclass );
-    ok( aclass, "RegisterClassA failed with error %d\n", GetLastError());
+    ok( aclass, "RegisterClassA failed with error %ld\n", GetLastError());
     hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest",
                           WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
                           400, 200, NULL, NULL, hInstance, NULL);
-    ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if (!hwnd) return;
     hmenu = CreatePopupMenu();
 
@@ -4483,7 +4484,7 @@ static void test_mouse_input(HWND hwnd)
     {
         ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n",
            msg.hwnd, msg.message);
-        ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%d,%d)\n",
+        ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%ld,%ld)\n",
            x, y, msg.pt.x, msg.pt.y);
     }
 
@@ -4628,7 +4629,7 @@ static void test_mouse_input(HWND hwnd)
     }
     ok(msg.hwnd == child && msg.message == WM_NCLBUTTONDOWN, "hwnd %p/%p message %04x\n",
        msg.hwnd, child, msg.message);
-    ok(msg.wParam == HTSYSMENU, "wparam %ld\n", msg.wParam);
+    ok(msg.wParam == HTSYSMENU, "wparam %Id\n", msg.wParam);
 
     ret = wait_for_message( &msg );
     ok(ret, "no message available\n");
@@ -4641,7 +4642,7 @@ static void test_mouse_input(HWND hwnd)
     ok(ret, "no message available\n");
     ok(msg.hwnd == child && msg.message == WM_LBUTTONDBLCLK, "hwnd %p/%p message %04x\n",
        msg.hwnd, child, msg.message);
-    ok(msg.wParam == MK_LBUTTON, "wparam %ld\n", msg.wParam);
+    ok(msg.wParam == MK_LBUTTON, "wparam %Id\n", msg.wParam);
 
     ret = wait_for_message( &msg );
     ok(ret, "no message available\n");
@@ -4713,7 +4714,7 @@ static void nccalchelper(HWND hwnd, INT x, INT y, RECT *prc)
     GetWindowRect( hwnd, prc);
     rc = *prc;
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)prc);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     if (winetest_debug > 1)
         trace("window rect is %s, nccalc rect is %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(prc));
 }
@@ -4953,17 +4954,17 @@ static LRESULT WINAPI cbt_proc(int ncode, WPARAM wparam, LPARAM lparam)
 
     ts = c->lpcs->lpCreateParams;
     ok(ts != NULL, "lpCreateParams not set\n");
-    ok(c->lpcs->style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+    ok(c->lpcs->style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
             c->lpcs->style, ts->cs_style);
-    ok(c->lpcs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+    ok(c->lpcs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
             c->lpcs->dwExStyle, ts->cs_exstyle);
 
     style = GetWindowLongW(hwnd, GWL_STYLE);
-    ok(style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+    ok(style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
             style, ts->cs_style);
     style = GetWindowLongW(hwnd, GWL_EXSTYLE);
     ok(style == (ts->cs_exstyle & ~WS_EX_LAYERED),
-            "exstyle = 0x%08x, expected 0x%08x\n", style, ts->cs_exstyle);
+            "exstyle = 0x%08lx, expected 0x%08lx\n", style, ts->cs_exstyle);
     return CallNextHookEx(NULL, ncode, wparam, lparam);
 }
 
@@ -4981,16 +4982,16 @@ static LRESULT WINAPI StyleCheckProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
         ts = cs->lpCreateParams;
 
         ok(ts != NULL, "lpCreateParams not set\n");
-        ok(cs->style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+        ok(cs->style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
                 cs->style, ts->cs_style);
-        ok(cs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+        ok(cs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
                 cs->dwExStyle, ts->cs_exstyle);
 
         style = GetWindowLongW(hwnd, GWL_STYLE);
-        ok(style == ts->style, "style = 0x%08x, expected 0x%08x\n",
+        ok(style == ts->style, "style = 0x%08lx, expected 0x%08lx\n",
                 style, ts->style);
         style = GetWindowLongW(hwnd, GWL_EXSTYLE);
-        ok(style == ts->exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+        ok(style == ts->exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
                 style, ts->exstyle);
         break;
     }
@@ -5056,8 +5057,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
 
     dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
     dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
-    ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
-    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+    ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
 
     /* try setting the styles explicitly */
     SetWindowLongA( hwnd, GWL_EXSTYLE, dwExStyleIn );
@@ -5070,8 +5071,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
         dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
     else
         dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
-    ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
-    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+    ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
 
     SetWindowLongA( hwnd, GWL_STYLE, dwStyleIn );
     dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
@@ -5086,8 +5087,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
         dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
     else
         dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
-    ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
-    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+    ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+    ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
 
     DestroyWindow(hwnd);
     if (hwndParent) DestroyWindow(hwndParent);
@@ -5150,7 +5151,7 @@ static void test_window_styles(void)
         if ((tests[i].exstyle_in & WS_EX_LAYERED) && !pGetLayeredWindowAttributes)
             continue;
 
-        winetest_push_context("style %#x exstyle %#x", tests[i].style_in, tests[i].exstyle_in);
+        winetest_push_context("style %#lx exstyle %#lx", tests[i].style_in, tests[i].exstyle_in);
         check_window_style(tests[i].style_in, tests[i].exstyle_in, tests[i].style_out, tests[i].exstyle_out);
         winetest_pop_context();
     }
@@ -5189,40 +5190,40 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
         ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
         if (parent_is_child)
         {
-            ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
+            ok(IsWindowEnabled(param->parent), "wrong state for %08lx\n", style);
             disabled_hwnd = param->grand_parent;
         }
         else
         {
-            ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
+            ok(!IsWindowEnabled(param->parent), "wrong state for %08lx\n", style);
             disabled_hwnd = param->parent;
         }
 
         if (param->grand_parent)
         {
             if (parent_is_child)
-                ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
+                ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08lx\n", style);
             else
-                ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
+                ok(IsWindowEnabled(param->grand_parent), "wrong state for %08lx\n", style);
         }
 
         DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0);
-        ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style);
+        ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08lx\n", style);
 
         ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
         ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
         if (param->grand_parent)
-            ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
+            ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08lx)\n", param->grand_parent, style);
 
         DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
         ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
         ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
         if (param->grand_parent)
-            ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
+            ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08lx)\n", param->grand_parent, style);
 
         param->dlg_data->style |= WS_CHILD;
         DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
-        ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
+        ok(IsWindowEnabled(hwnd), "wrong state for %p (%08lx)\n", hwnd, style);
 
         EndDialog(hwnd, 0);
     }
@@ -5252,7 +5253,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
 
     parent = CreateWindowExA(0, "static", NULL, style_in,
                              0, 0, 0, 0, grand_parent, NULL, NULL, NULL);
-    ok(parent != 0, "parent creation failed, style %#x\n", style_in);
+    ok(parent != 0, "parent creation failed, style %#lx\n", style_in);
 
     dlg_data.dt.style = style_in;
     dlg_data.dt.dwExtendedStyle = ex_style_in;
@@ -5267,22 +5268,22 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
     dlg_data.caption[0] = 0;
 
     hwnd = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc, 0);
-    ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
+    ok(hwnd != 0, "dialog creation failed, style %#lx, exstyle %#lx\n", style_in, ex_style_in);
 
     flush_events( TRUE );
 
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
-    ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
-    ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+    ok(style == (style_out | DS_3DLOOK), "got %#lx\n", style);
+    ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
 
-    ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
+    ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#lx)\n", style_in);
 
     /* try setting the styles explicitly */
     SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
-    ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
+    ok(style == (style_out | DS_3DLOOK), "got %#lx\n", style);
     /* WS_EX_WINDOWEDGE can't always be changed */
     if (ex_style_in & WS_EX_DLGMODALFRAME)
         ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
@@ -5290,7 +5291,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
         ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
     else
         ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
-    ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+    ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
 
     SetWindowLongA(hwnd, GWL_STYLE, style_in);
     style = GetWindowLongA(hwnd, GWL_STYLE);
@@ -5298,7 +5299,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
     /* WS_CLIPSIBLINGS can't be reset on top-level windows */
     if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in;
     else style_out = style_in | WS_CLIPSIBLINGS;
-    ok(style == style_out, "expected style %#x, got %#x\n", style_out, style);
+    ok(style == style_out, "expected style %#lx, got %#lx\n", style_out, style);
     /* WS_EX_WINDOWEDGE can't always be changed */
     if (ex_style_in & WS_EX_DLGMODALFRAME)
         ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
@@ -5306,7 +5307,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
         ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
     else
         ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
-    ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+    ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
 
     DestroyWindow(hwnd);
 
@@ -5315,9 +5316,9 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
     param.dlg_data = &dlg_data.dt;
     DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc2, (LPARAM)&param);
 
-    ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
+    ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#lx)\n", style_in);
     if (grand_parent)
-        ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in);
+        ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#lx)\n", style_in);
 
     DestroyWindow(parent);
     DestroyWindow(grand_parent);
@@ -5546,7 +5547,7 @@ static void test_dialog_parent(void)
     param.root = parent;
     param.ga_root_owner = child;
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)&param);
-    ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
 
     /* Dialogs without WS_CHILD behave as expected, they use passed owner just like CreateWindow does. */
     dlg_data.dt.style = WS_OVERLAPPEDWINDOW;
@@ -5567,7 +5568,7 @@ static void test_dialog_parent(void)
     param.owner = child;
     param.root = param.ga_root_owner = NULL;
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)&param);
-    ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
 
     other = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
     SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)reparent_dialog_owner_proc);
@@ -5591,7 +5592,7 @@ static void test_dialog_parent(void)
     param.root = NULL;
     param.ga_root_owner = child;
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)&param);
-    ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
 
     /* If we change parent in WM_INITDIALOG for WS_CHILD dialog WM_ENTERIDLE is still sent to the original
      * parent. EndDialog will enable the new parent. */
@@ -5599,7 +5600,7 @@ static void test_dialog_parent(void)
     EnableWindow(other, FALSE);
     dlg_data.dt.style = WS_CHILD;
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_dlg_proc, (LPARAM)other);
-    ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
     ok(!IsWindowEnabled(other), "other is not disabled\n");
     ok(!IsWindowEnabled(child), "child is not disabled\n");
     ok(IsWindowEnabled(child2), "child2 is not enabled\n");
@@ -5611,7 +5612,7 @@ static void test_dialog_parent(void)
     EnableWindow(other, FALSE);
     dlg_data.dt.style = WS_OVERLAPPED;
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_owned_dlg_proc, (LPARAM)other);
-    ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
     ok(!IsWindowEnabled(other), "other is not disabled\n");
     ok(!IsWindowEnabled(child), "child is not disabled\n");
     ok(IsWindowEnabled(child2), "child2 is not enabled\n");
@@ -5621,14 +5622,14 @@ static void test_dialog_parent(void)
     /* Quit dialog message loop by sending WM_QUIT message. Dialog owner is not enabled. */
     SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)post_quit_dialog_owner_proc);
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0);
-    ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
     ok(!IsWindowEnabled(other), "other is enabled\n");
     EnableWindow(other, TRUE);
 
     /* Quit dialog message loop by destroying the window. Dialog owner is not enabled. */
     SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)destroy_dialog_owner_proc);
     ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0);
-    ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+    ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
     ok(!IsWindowEnabled(other), "other is enabled\n");
     EnableWindow(other, TRUE);
 
@@ -5663,7 +5664,7 @@ static void test_scrollwindow( HWND hwnd)
     flush_events(FALSE);
     /* expected: black should have scrolled to the upper half */
     colr = GetPixel( hdc, (rc2.left+rc2.right)/ 2,  rc2.bottom / 4 );
-    ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+    ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
     /* Repeat that test of ScrollWindow(Ex) now with clip rectangle */
     /* paint the lower half of the window black */
     rc2 = rc;
@@ -5683,7 +5684,7 @@ static void test_scrollwindow( HWND hwnd)
     flush_events(FALSE);
     /* expected: black should have scrolled to the upper half */
     colr = GetPixel( hdc, (rc2.left+rc2.right)/ 2,  rc2.bottom / 4 );
-    ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+    ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
 
     /* clean up */
     ReleaseDC( hwnd, hdc);
@@ -5914,11 +5915,11 @@ static void test_scrolldc( HWND parent)
     cliprc.top = (rc.top + rc.bottom) /2;
     /* test whether scrolled pixels are properly clipped */ 
     colr = GetPixel( hdc, (rc.left+rc.right)/2, ( rc.top + rc.bottom) /2 - 1);
-    ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+    ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
     /* this scroll should not cause any visible changes */ 
     ScrollDC( hdc, 5, -20, &rc, &cliprc, hrgn, &rcu);
     colr = GetPixel( hdc, (rc.left+rc.right)/2, ( rc.top + rc.bottom) /2 - 1);
-    ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+    ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
     /* test with NULL clip rect */
     ScrollDC( hdc, 20, -20, &rc, NULL, hrgn, &rcu);
     /*FillRgn(hdc, hrgn, GetStockObject(WHITE_BRUSH));*/
@@ -5971,7 +5972,7 @@ static void test_params(void)
     /* Just a param check */
     SetLastError(0xdeadbeef);
     rc = GetWindowTextA(hwndMain2, NULL, 1024);
-    ok(!rc, "GetWindowText: rc=%d err=%d\n",rc,GetLastError());
+    ok(!rc, "GetWindowText: rc=%d err=%ld\n",rc,GetLastError());
 
     SetLastError(0xdeadbeef);
     hwnd=CreateWindowA("LISTBOX", "TestList",
@@ -5983,7 +5984,7 @@ static void test_params(void)
        "CreateWindow with invalid menu handle should fail\n");
     if (!hwnd)
         ok(GetLastError() == ERROR_INVALID_MENU_HANDLE,
-           "wrong last error value %d\n", GetLastError());
+           "wrong last error value %ld\n", GetLastError());
 }
 
 static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu)
@@ -5996,7 +5997,7 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu)
 			  0,
 			  menu ? hmenu : 0,
 			  0, 0);
-    ok(hwnd != NULL, "Failed to create window class=%s, style=0x%08x, exStyle=0x%08x\n", class, style, exStyle);
+    ok(hwnd != NULL, "Failed to create window class=%s, style=0x%08lx, exStyle=0x%08lx\n", class, style, exStyle);
 
     ShowWindow(hwnd, SW_SHOW);
 
@@ -6080,7 +6081,7 @@ static void test_AWR_flags(void)
             rect2 = rect;
             AdjustWindowRectEx( &rect, style, FALSE, exstyle );
             wine_AdjustWindowRectEx( &rect2, style, FALSE, exstyle );
-            ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n",
+            ok( EqualRect( &rect, &rect2 ), "%08lx %08lx rects do not match: win %s wine %s\n",
                 style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 ));
             if (pAdjustWindowRectExForDpi)
             {
@@ -6088,7 +6089,7 @@ static void test_AWR_flags(void)
                 rect2 = rect;
                 pAdjustWindowRectExForDpi( &rect, style, FALSE, exstyle, 192 );
                 wine_AdjustWindowRectExForDpi( &rect2, style, FALSE, exstyle, 192 );
-                ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n",
+                ok( EqualRect( &rect, &rect2 ), "%08lx %08lx rects do not match: win %s wine %s\n",
                     style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 ));
             }
         }
@@ -6238,7 +6239,7 @@ static void zero_parentdc_test(struct parentdc_test *t)
 
 #define parentdc_field_ok(t, w, r, f, got) \
   ok (t.w.r.f==got.w.r.f, "window " #w ", rect " #r ", field " #f \
-      ": expected %d, got %d\n", \
+      ": expected %ld, got %ld\n", \
       t.w.r.f, got.w.r.f)
 
 #define parentdc_todo_field_ok(t, w, r, f, got) \
@@ -6611,7 +6612,7 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
         ok( EqualRect( &rect, r ), "passed rect %s doesn't match window rect %s\n",
             wine_dbgstr_rect( r ), wine_dbgstr_rect( &rect ));
         ret = DefWindowProcA(hwnd, msg, wp, lp);
-        ok(!ret, "got %08lx\n", ret);
+        ok(!ret, "got %08Ix\n", ret);
         return ret;
     }
     default:
@@ -6632,13 +6633,13 @@ static void test_CreateWindow(void)
 #define expect_menu(window, menu) \
     SetLastError(0xdeadbeef); \
     res = (GetMenu(window) == (HMENU)menu); \
-    ok(res, "GetMenu error %d\n", GetLastError())
+    ok(res, "GetMenu error %ld\n", GetLastError())
 
 #define expect_style(window, style)\
-    ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))
+    ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %lx != %lx\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))
 
 #define expect_ex_style(window, ex_style)\
-    ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))
+    ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %lx != %lx\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))
 
     hmenu = CreateMenu();
     assert(hmenu != 0);
@@ -6647,13 +6648,13 @@ static void test_CreateWindow(void)
 
     SetLastError(0xdeadbeef);
     res = IsMenu(hmenu);
-    ok(res, "IsMenu error %d\n", GetLastError());
+    ok(res, "IsMenu error %ld\n", GetLastError());
 
     /* WS_CHILD */
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, 1);
     expect_style(hwnd, WS_CHILD);
     expect_ex_style(hwnd, WS_EX_APPWINDOW);
@@ -6662,7 +6663,7 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_CAPTION,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, 1);
     expect_style(hwnd, WS_CHILD | WS_CAPTION);
     expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
@@ -6671,7 +6672,7 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, 1);
     expect_style(hwnd, WS_CHILD);
     expect_ex_style(hwnd, 0);
@@ -6680,7 +6681,7 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_CAPTION,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, 1);
     expect_style(hwnd, WS_CHILD | WS_CAPTION);
     expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
@@ -6690,63 +6691,63 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_POPUP | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_APPWINDOW);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     hmenu = CreateMenu();
     assert(hmenu != 0);
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     hmenu = CreateMenu();
     assert(hmenu != 0);
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_POPUP | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, 0);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     hmenu = CreateMenu();
     assert(hmenu != 0);
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     /* WS_CHILD | WS_POPUP */
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
     ok(!hwnd, "CreateWindowEx should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
     if (hwnd)
         DestroyWindow(hwnd);
 
@@ -6755,20 +6756,20 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_APPWINDOW);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
     ok(!hwnd, "CreateWindowEx should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
     if (hwnd)
         DestroyWindow(hwnd);
 
@@ -6777,20 +6778,20 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
     ok(!hwnd, "CreateWindowEx should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
     if (hwnd)
         DestroyWindow(hwnd);
 
@@ -6799,20 +6800,20 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, 0);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
     ok(!hwnd, "CreateWindowEx should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
     if (hwnd)
         DestroyWindow(hwnd);
 
@@ -6821,14 +6822,14 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
                            0, 0, 100, 100, parent, hmenu, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, hmenu);
     expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
     expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
     DestroyWindow(hwnd);
     SetLastError(0xdeadbeef);
     ok(!IsMenu(hmenu), "IsMenu should fail\n");
-    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
 
     /* test child window sizing */
     cls.style = 0;
@@ -6846,7 +6847,7 @@ static void test_CreateWindow(void)
     SetLastError(0xdeadbeef);
     parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
                            0, 0, 100, 100, 0, 0, 0, NULL);
-    ok(parent != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(parent != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(parent, 0);
     expect_style(parent, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_CLIPSIBLINGS);
     expect_ex_style(parent, WS_EX_WINDOWEDGE);
@@ -6869,7 +6870,7 @@ static void test_CreateWindow(void)
     hwnd = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
                           rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
                           parent, (HMENU)1, 0, NULL);
-    ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
     expect_menu(hwnd, 1);
     expect_style(hwnd, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME);
     expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
@@ -6892,49 +6893,49 @@ static void test_CreateWindow(void)
     SetRect( &expected_rect, 0, 0, 200000, 200000 );
     broken_rect = expected_rect;
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 300000, 300000, 200000, 200000, parent, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
     ok( rc.right == 200000 || rc.right == 65535 || broken(rc.right == (short)200000),
-        "invalid rect right %u\n", rc.right );
+        "invalid rect right %lu\n", rc.right );
     ok( rc.bottom == 200000 || rc.bottom == 65535 || broken(rc.bottom == (short)200000),
-        "invalid rect bottom %u\n", rc.bottom );
+        "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     expected_cx = expected_cy = -10;
     SetRectEmpty(&expected_rect);
     SetRect( &broken_rect, 0, 0, -10, -10 );
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
-    ok( rc.right == 0, "invalid rect right %u\n", rc.right );
-    ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom );
+    ok( rc.right == 0, "invalid rect right %lu\n", rc.right );
+    ok( rc.bottom == 0, "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     expected_cx = expected_cy = -200000;
     SetRectEmpty(&expected_rect);
     SetRect( &broken_rect, 0, 0, -200000, -200000 );
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
-    ok( rc.right == 0, "invalid rect right %u\n", rc.right );
-    ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom );
+    ok( rc.right == 0, "invalid rect right %lu\n", rc.right );
+    ok( rc.bottom == 0, "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     /* we need a parent at 0,0 so that child coordinates match */
     DestroyWindow(parent);
     parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
-    ok(parent != 0, "CreateWindowEx error %d\n", GetLastError());
+    ok(parent != 0, "CreateWindowEx error %ld\n", GetLastError());
 
     expected_cx = 100;
     expected_cy = 0x7fffffff;
     SetRect( &expected_rect, 10, 10, 110, 0x7fffffff );
     SetRect( &broken_rect, 10, 10, 110, 0x7fffffffU + 10 );
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 10, 10, 100, 0x7fffffff, parent, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
-    ok( rc.right == 100, "invalid rect right %u\n", rc.right );
+    ok( rc.right == 100, "invalid rect right %lu\n", rc.right );
     ok( rc.bottom == 0x7fffffff - 10 || rc.bottom ==65535 || broken(rc.bottom == 0),
-        "invalid rect bottom %u\n", rc.bottom );
+        "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     expected_cx = 0x7fffffff;
@@ -6942,22 +6943,22 @@ static void test_CreateWindow(void)
     SetRect( &expected_rect, 20, 10, 0x7fffffff, 0x7fffffff );
     SetRect( &broken_rect, 20, 10, 0x7fffffffU + 20, 0x7fffffffU + 10 );
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 20, 10, 0x7fffffff, 0x7fffffff, parent, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
     ok( rc.right == 0x7fffffff - 20 || rc.right == 65535 || broken(rc.right == 0),
-        "invalid rect right %u\n", rc.right );
+        "invalid rect right %lu\n", rc.right );
     ok( rc.bottom == 0x7fffffff - 10 || rc.right == 65535 || broken(rc.bottom == 0),
-        "invalid rect bottom %u\n", rc.bottom );
+        "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     /* top level window */
     expected_cx = expected_cy = 200000;
     SetRect( &expected_rect, 0, 0, GetSystemMetrics(SM_CXMAXTRACK), GetSystemMetrics(SM_CYMAXTRACK) );
     hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_OVERLAPPEDWINDOW, 300000, 300000, 200000, 200000, 0, 0, 0, NULL);
-    ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+    ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
     GetClientRect( hwnd, &rc );
-    ok( rc.right <= expected_cx, "invalid rect right %u\n", rc.right );
-    ok( rc.bottom <= expected_cy, "invalid rect bottom %u\n", rc.bottom );
+    ok( rc.right <= expected_cx, "invalid rect right %lu\n", rc.right );
+    ok( rc.bottom <= expected_cy, "invalid rect bottom %lu\n", rc.bottom );
     DestroyWindow(hwnd);
 
     /* invalid class */
@@ -6965,7 +6966,7 @@ static void test_CreateWindow(void)
     hwnd = CreateWindowExA(0, "INVALID_CLASS", NULL, WS_CHILD, 10, 10, 100, 100, parent, 0, 0, NULL);
     ok(hwnd == 0, "CreateWindowEx succeeded\n");
     ok(GetLastError() == ERROR_CLASS_DOES_NOT_EXIST || GetLastError() == ERROR_CANNOT_FIND_WND_CLASS,
-        "invalid error %u\n", GetLastError());
+        "invalid error %lu\n", GetLastError());
     DestroyWindow(hwnd);
 
     hdc = GetDC( parent );
@@ -6977,19 +6978,19 @@ static void test_CreateWindow(void)
         SetLastError( 0xdeadbeef );
         parent = CreateWindowExA(WS_EX_APPWINDOW | WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP,
                                 0, 0, 100, 100, 0, 0, 0, NULL);
-        ok( parent != 0, "creation failed err %u\n", GetLastError());
+        ok( parent != 0, "creation failed err %lu\n", GetLastError());
         expect_ex_style( parent, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL );
         hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL);
-        ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+        ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
         expect_ex_style( hwnd, WS_EX_LAYOUTRTL );
         DestroyWindow( hwnd );
         hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 20, 20, parent, 0, 0, NULL);
-        ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+        ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
         expect_ex_style( hwnd, 0 );
         DestroyWindow( hwnd );
         SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT );
         hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL);
-        ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+        ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
         expect_ex_style( hwnd, 0 );
         DestroyWindow( hwnd );
 
@@ -6999,31 +7000,31 @@ static void test_CreateWindow(void)
 
             SetLastError( 0xdeadbeef );
             ok( !pGetProcessDefaultLayout( NULL ), "GetProcessDefaultLayout succeeded\n" );
-            ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() );
+            ok( GetLastError() == ERROR_NOACCESS, "wrong error %lu\n", GetLastError() );
             SetLastError( 0xdeadbeef );
             res = pGetProcessDefaultLayout( &layout );
-            ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
-            ok( layout == 0, "GetProcessDefaultLayout wrong layout %x\n", layout );
+            ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+            ok( layout == 0, "GetProcessDefaultLayout wrong layout %lx\n", layout );
             SetLastError( 0xdeadbeef );
             res = pSetProcessDefaultLayout( 7 );
-            ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
+            ok( res, "SetProcessDefaultLayout failed err %lu\n", GetLastError ());
             res = pGetProcessDefaultLayout( &layout );
-            ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
-            ok( layout == 7, "GetProcessDefaultLayout wrong layout %x\n", layout );
+            ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+            ok( layout == 7, "GetProcessDefaultLayout wrong layout %lx\n", layout );
             SetLastError( 0xdeadbeef );
             res = pSetProcessDefaultLayout( LAYOUT_RTL );
-            ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
+            ok( res, "SetProcessDefaultLayout failed err %lu\n", GetLastError ());
             res = pGetProcessDefaultLayout( &layout );
-            ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
-            ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %x\n", layout );
+            ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+            ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %lx\n", layout );
             hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
                                   0, 0, 100, 100, 0, 0, 0, NULL);
-            ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+            ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
             expect_ex_style( hwnd, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL );
             DestroyWindow( hwnd );
             hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
                                   0, 0, 100, 100, parent, 0, 0, NULL);
-            ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+            ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
             expect_ex_style( hwnd, WS_EX_APPWINDOW );
             DestroyWindow( hwnd );
             pSetProcessDefaultLayout( 0 );
@@ -7087,103 +7088,103 @@ static void test_set_window_long_size(void)
     /* GWLP_USERDATA */
     SetWindowLongPtrA(hwnd, GWLP_USERDATA, ((LONG_PTR)1 << 32) | 123);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     retval = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
     ok(retval > 123, "Unexpected user data.\n");
     ret = GetWindowWord(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 124, "Unexpected user data %#x.\n", ret);
+    ok(ret == 124, "Unexpected user data %#lx.\n", ret);
     retval = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
     todo_wine
     ok(retval == 124, "Unexpected user data.\n");
 
     SetWindowLongA(hwnd, GWLP_USERDATA, (1 << 16) | 123);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
-    ok(ret == ((1 << 16) | 123), "Unexpected user data %#x.\n", ret);
+    ok(ret == ((1 << 16) | 123), "Unexpected user data %#lx.\n", ret);
     ret = GetWindowWord(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
 
     ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == ((1 << 16) | 124), "Unexpected user data %#x.\n", ret);
+    ok(ret == ((1 << 16) | 124), "Unexpected user data %#lx.\n", ret);
     ret = GetWindowWord(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 124, "Unexpected user data %#x.\n", ret);
+    ok(ret == 124, "Unexpected user data %#lx.\n", ret);
 
     /* GWLP_ID */
     ret = SetWindowLongA(hwnd, GWLP_ID, 1);
-    ok(!ret, "Unexpected id %#x.\n", ret);
+    ok(!ret, "Unexpected id %#lx.\n", ret);
 
     ret = GetWindowLongA(hwnd, GWLP_ID);
-    ok(ret == 1, "Unexpected id %#x.\n", ret);
+    ok(ret == 1, "Unexpected id %#lx.\n", ret);
 
     ret = GetWindowLongW(hwnd, GWLP_ID);
-    ok(ret == 1, "Unexpected id %#x.\n", ret);
+    ok(ret == 1, "Unexpected id %#lx.\n", ret);
 
     SetWindowLongPtrA(hwnd, GWLP_ID, ((LONG_PTR)1 << 32) | 123);
     ret = GetWindowLongA(hwnd, GWLP_ID);
-    ok(ret == 123, "Unexpected id %#x.\n", ret);
+    ok(ret == 123, "Unexpected id %#lx.\n", ret);
     ret = GetWindowLongW(hwnd, GWLP_ID);
-    ok(ret == 123, "Unexpected id %#x.\n", ret);
+    ok(ret == 123, "Unexpected id %#lx.\n", ret);
     retval = GetWindowLongPtrA(hwnd, GWLP_ID);
     ok(retval > 123, "Unexpected id.\n");
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_ID);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
 
     /* GWLP_HINSTANCE */
     retval = GetWindowLongPtrA(hwnd, GWLP_HINSTANCE);
-    ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#lx.\n", retval);
+    ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#Ix.\n", retval);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowLongA(hwnd, GWLP_HINSTANCE);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowLongW(hwnd, GWLP_HINSTANCE);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_HINSTANCE);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = SetWindowLongA(hwnd, GWLP_HINSTANCE, 1);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = SetWindowLongW(hwnd, GWLP_HINSTANCE, 1);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     /* GWLP_HWNDPARENT */
     SetLastError(0xdeadbeef);
     ret = GetWindowLongA(hwnd, GWLP_HWNDPARENT);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = SetWindowLongA(hwnd, GWLP_HWNDPARENT, 0);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = SetWindowLongW(hwnd, GWLP_HWNDPARENT, 0);
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_HWNDPARENT);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
 
     DestroyWindow(hwnd);
 #endif
@@ -7218,59 +7219,59 @@ static void test_set_window_word_size(void)
 
     /* GWLP_USERDATA */
     ret = SetWindowLongA(hwnd, GWLP_USERDATA, (1 << 16) | 123);
-    ok(!ret, "Unexpected user data %#x.\n", ret);
+    ok(!ret, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
-    ok(ret > 123, "Unexpected user data %#x.\n", ret);
+    ok(ret > 123, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowWord(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
     todo_wine
-    ok(ret == 123, "Unexpected user data %#x.\n", ret);
+    ok(ret == 123, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowWord(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == 124, "Unexpected user data %#x.\n", ret);
+    ok(ret == 124, "Unexpected user data %#lx.\n", ret);
     ret = GetWindowLongA(hwnd, GWLP_USERDATA);
     todo_wine
-    ok(ret == ((1 << 16) | 124), "Unexpected user data %#x.\n", ret);
+    ok(ret == ((1 << 16) | 124), "Unexpected user data %#lx.\n", ret);
 
     /* GWLP_ID */
     ret = SetWindowLongA(hwnd, GWLP_ID, 1);
-    ok(!ret, "Unexpected id %#x.\n", ret);
+    ok(!ret, "Unexpected id %#lx.\n", ret);
     ret = GetWindowLongA(hwnd, GWLP_ID);
-    ok(ret == 1, "Unexpected id %#x.\n", ret);
+    ok(ret == 1, "Unexpected id %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_ID);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
     SetLastError(0xdeadbeef);
     ret = SetWindowWord(hwnd, GWLP_ID, 2);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
 
     /* GWLP_HINSTANCE */
     retval = GetWindowLongPtrA(hwnd, GWLP_HINSTANCE);
-    ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#lx.\n", retval);
+    ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#Ix.\n", retval);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_HINSTANCE);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = SetWindowWord(hwnd, GWLP_HINSTANCE, 0xdead);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
 
     /* GWLP_HWNDPARENT */
     retval = GetWindowLongPtrA(hwnd, GWLP_HWNDPARENT);
-    ok(!!retval, "Unexpected parent window %#x.\n", ret);
+    ok(!!retval, "Unexpected parent window %#lx.\n", ret);
 
     SetLastError(0xdeadbeef);
     ret = GetWindowWord(hwnd, GWLP_HWNDPARENT);
     todo_wine
-    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+    ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
 
     DestroyWindow(hwnd);
 }
@@ -7282,24 +7283,24 @@ static void test_SetWindowLong(void)
 
     SetLastError(0xdeadbeef);
     retval = SetWindowLongPtrA(NULL, GWLP_WNDPROC, 0);
-    ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%lx\n", retval);
+    ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%Ix\n", retval);
     ok(check_error(GetLastError(), ERROR_INVALID_WINDOW_HANDLE),
-        "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %d\n", GetLastError());
+        "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     retval = SetWindowLongPtrA(hwndMain, 0xdeadbeef, 0);
-    ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%lx\n", retval);
+    ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%Ix\n", retval);
     ok(check_error(GetLastError(), ERROR_INVALID_INDEX),
-        "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %d\n", GetLastError());
+        "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     retval = SetWindowLongPtrA(hwndMain, GWLP_WNDPROC, 0);
     ok((WNDPROC)retval == main_window_procA,
-        "SetWindowLongPtr on invalid window proc should have returned address of main_window_procA instead of 0x%lx\n", retval);
-    ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %d\n", GetLastError());
+        "SetWindowLongPtr on invalid window proc should have returned address of main_window_procA instead of 0x%Ix\n", retval);
+    ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %ld\n", GetLastError());
     retval = GetWindowLongPtrA(hwndMain, GWLP_WNDPROC);
     ok((WNDPROC)retval == main_window_procA,
-        "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%lx\n", retval);
+        "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%Ix\n", retval);
     ok(!IsWindowUnicode(hwndMain), "hwndMain shouldn't be Unicode\n");
 
     old_window_procW = (WNDPROC)GetWindowLongPtrW(hwndMain, GWLP_WNDPROC);
@@ -7307,10 +7308,10 @@ static void test_SetWindowLong(void)
     retval = SetWindowLongPtrW(hwndMain, GWLP_WNDPROC, 0);
     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
     {
-        ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %d\n", GetLastError());
-        ok(retval != 0, "SetWindowLongPtr error %d\n", GetLastError());
+        ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %ld\n", GetLastError());
+        ok(retval != 0, "SetWindowLongPtr error %ld\n", GetLastError());
         ok((WNDPROC)retval == old_window_procW,
-            "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%lx\n", retval);
+            "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%Ix\n", retval);
         ok(IsWindowUnicode(hwndMain), "hwndMain should now be Unicode\n");
 
         /* set it back to ANSI */
@@ -7328,16 +7329,16 @@ static LRESULT WINAPI check_style_wnd_proc(HWND hwnd, UINT message, WPARAM wPara
 
     if (message == WM_STYLECHANGING && wParam == GWL_STYLE)
     {
-        ok(got->styleOld == expected[0].styleOld, "expected old style %#x, got %#x\n",
+        ok(got->styleOld == expected[0].styleOld, "expected old style %#lx, got %#lx\n",
             expected[0].styleOld, got->styleOld);
-        ok(got->styleNew == expected[0].styleNew, "expected new style %#x, got %#x\n",
+        ok(got->styleNew == expected[0].styleNew, "expected new style %#lx, got %#lx\n",
             expected[0].styleNew, got->styleNew);
     }
     else if (message == WM_STYLECHANGED && wParam == GWL_STYLE)
     {
-        ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
+        ok(got->styleOld == expected[1].styleOld, "expected old style %#lx, got %#lx\n",
             expected[1].styleOld, got->styleOld);
-        ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
+        ok(got->styleNew == expected[1].styleNew, "expected new style %#lx, got %#lx\n",
             expected[1].styleNew, got->styleNew);
     }
 
@@ -7400,10 +7401,10 @@ static void test_set_window_style(void)
         SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)&expected_stylestruct);
 
         old_style = SetWindowLongA(hwnd, GWL_STYLE, tests[i].style);
-        ok(old_style == tests[i].creation_style, "expected old style %#x, got %#x\n",
+        ok(old_style == tests[i].creation_style, "expected old style %#lx, got %#lx\n",
             tests[i].creation_style, old_style);
         new_style = GetWindowLongA(hwnd, GWL_STYLE);
-        ok(new_style == expected_style, "expected new style %#x, got %#x\n",
+        ok(new_style == expected_style, "expected new style %#lx, got %#lx\n",
             expected_style, new_style);
 
         SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0);
@@ -7471,7 +7472,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_SHOW);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7485,7 +7486,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_MINIMIZE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7502,7 +7503,7 @@ static void test_ShowWindow(void)
                        (rcMinimized.right - rcMinimized.left) * 2,
                        (rcMinimized.bottom - rcMinimized.top) * 2,
                        SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     GetWindowRect(hwnd, &rc);
     ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n",
        wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
@@ -7512,7 +7513,7 @@ static void test_ShowWindow(void)
     /* SetWindowPos shouldn't affect the client rect */
     ret = SetWindowPos(hwnd, 0, 0, 0, 0, 0,
                        SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     GetWindowRect(hwnd, &rc);
     ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n",
        wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
@@ -7523,12 +7524,12 @@ static void test_ShowWindow(void)
     GetWindowRect(hwnd, &rc);
     SetRect(&rcNonClient, rc.left, rc.top, rc.left, rc.top);
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&rc, &rcNonClient), "expected %s, got %s\n",
        wine_dbgstr_rect(&rcNonClient), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7542,7 +7543,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_MAXIMIZE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7553,14 +7554,14 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcMaximized), wine_dbgstr_rect(&rc));
     /* maximized windows can be resized */
     ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     SetRect(&rcResized, 300, 300, 500, 500);
     GetWindowRect(hwnd, &rc);
     ok(EqualRect(&rcResized, &rc), "expected %s, got %s\n",
        wine_dbgstr_rect(&rcResized), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7571,12 +7572,12 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rc));
 
     ret = EnableWindow(hwnd, FALSE);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
 
     ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7590,7 +7591,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7604,7 +7605,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_MINIMIZE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7618,7 +7619,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
 
     ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7632,7 +7633,7 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_DISABLED, "window should be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7646,14 +7647,14 @@ static void test_ShowWindow(void)
        wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
 
     ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     ok(IsWindow(hwnd), "window should exist\n");
 
     ret = EnableWindow(hwnd, TRUE);
-    ok(ret, "not expected ret: %lu\n", ret);
+    ok(ret, "not expected ret: %Iu\n", ret);
 
     ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
-    ok(!ret, "not expected ret: %lu\n", ret);
+    ok(!ret, "not expected ret: %Iu\n", ret);
     ok(!IsWindow(hwnd), "window should not exist\n");
 
     hwnd = CreateWindowExA(0, "MainWindowClass", NULL,
@@ -7662,7 +7663,7 @@ static void test_ShowWindow(void)
                           rcMain.left, rcMain.top,
                           rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
                           0, 0, 0, NULL);
-    ok(hwnd != NULL, "failed to create window with error %u\n", GetLastError());
+    ok(hwnd != NULL, "failed to create window with error %lu\n", GetLastError());
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_MINIMIZE, "window should be minimized\n");
     GetWindowRect(hwnd, &rc);
@@ -7680,7 +7681,7 @@ static void test_ShowWindow(void)
                           rcMain.left, rcMain.top,
                           rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
                           0, 0, 0, NULL);
-    ok(hwnd != NULL, "failed to create window with error %u\n", GetLastError());
+    ok(hwnd != NULL, "failed to create window with error %lu\n", GetLastError());
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(style & WS_MINIMIZE, "window should be minimized\n");
     GetWindowRect(hwnd, &rc);
@@ -7703,7 +7704,7 @@ static void test_ShowWindow(void)
                                rcMain.left, rcMain.top,
                                rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
                                0, 0, 0, NULL);
-        ok(hwnd != NULL, "Test %u: failed to create window with error %u\n", i, GetLastError());
+        ok(hwnd != NULL, "Test %u: failed to create window with error %lu\n", i, GetLastError());
 
         GetWindowRect(hwnd, &rcMain);
         ok(rcMain.left   > mon_info.rcMonitor.left   &&
@@ -7717,7 +7718,7 @@ static void test_ShowWindow(void)
                            0, GetWindowLongA(hwnd, GWL_EXSTYLE));
 
         ret = ShowWindow(hwnd, SW_MAXIMIZE);
-        ok(ret, "unexpected ret: %lu\n", ret);
+        ok(ret, "unexpected ret: %Iu\n", ret);
         style = GetWindowLongA(hwnd, GWL_STYLE);
         ok(style & WS_MAXIMIZE, "Test %u: window should be maximized\n", i);
         GetWindowRect(hwnd, &rc);
@@ -7734,7 +7735,7 @@ static void test_ShowWindow(void)
            wine_dbgstr_rect(&rc));
 
         ret = ShowWindow(hwnd, SW_RESTORE);
-        ok(ret, "unexpected ret: %lu\n", ret);
+        ok(ret, "unexpected ret: %Iu\n", ret);
         style = GetWindowLongA(hwnd, GWL_STYLE);
         ok(!(style & WS_MAXIMIZE), "Test %u: window should not be maximized\n", i);
         GetWindowRect(hwnd, &rc);
@@ -7761,12 +7762,12 @@ static void test_ShowWindow_owned(HWND hwndMain)
                          WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
                          orig.left, orig.top, orig.right - orig.left,
                          orig.bottom - orig.top, hwndMain, 0, 0, NULL);
-    ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
     hwnd2 = CreateWindowA("MainWindowClass", "owned2", WS_CAPTION | WS_SYSMENU |
                           WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE,
                           orig.left, orig.top, orig.right - orig.left,
                           orig.bottom - orig.top, hwndMain, 0, 0, NULL);
-    ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
 
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
@@ -7778,7 +7779,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_SHOW);
-    ok(!ret, "wrong ret %lu\n", ret);
+    ok(!ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7789,7 +7790,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7803,7 +7804,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* shouldn't be able to resize minimized windows */
     ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     todo_wine
     ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
@@ -7812,7 +7813,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
     GetWindowRect(hwnd, &rect);
     SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
        wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
 
@@ -7820,7 +7821,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
      * on top of each other) */
     OffsetRect(&expect, GetSystemMetrics(SM_CXMINIMIZED), 0);
     ret = ShowWindow(hwnd2, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd2, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7832,7 +7833,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7843,7 +7844,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MAXIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7857,14 +7858,14 @@ static void test_ShowWindow_owned(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* maximized windows can be resized */
     ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     SetRect(&expect, 300, 300, 500, 500);
     ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7891,12 +7892,12 @@ static void test_ShowWindow_child(HWND hwndMain)
                          WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD,
                          orig.left, orig.top, orig.right - orig.left,
                          orig.bottom - orig.top, hwndMain, 0, 0, NULL);
-    ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
     hwnd2 = CreateWindowA("MainWindowClass", "child2", WS_CAPTION | WS_SYSMENU |
                           WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD | WS_VISIBLE,
                           orig.left, orig.top, orig.right - orig.left,
                           orig.bottom - orig.top, hwndMain, 0, 0, NULL);
-    ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
 
     ClientToScreen(hwndMain, &pt);
     OffsetRect(&orig, pt.x, pt.y);
@@ -7911,7 +7912,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_SHOW);
-    ok(!ret, "wrong ret %lu\n", ret);
+    ok(!ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7922,7 +7923,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7937,7 +7938,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* shouldn't be able to resize minimized windows */
     ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -7945,7 +7946,7 @@ static void test_ShowWindow_child(HWND hwndMain)
     GetWindowRect(hwnd, &rect);
     SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
        wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
 
@@ -7953,7 +7954,7 @@ static void test_ShowWindow_child(HWND hwndMain)
      * fit more than one per row */
     OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
     ret = ShowWindow(hwnd2, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd2, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7964,7 +7965,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7975,7 +7976,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MAXIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7990,7 +7991,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* maximized windows can be resized */
     ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     SetRect(&expect, 300, 300, 500, 500);
     OffsetRect(&expect, pt.x, pt.y);
@@ -7998,7 +7999,7 @@ static void test_ShowWindow_child(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8026,17 +8027,17 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
     mdiclient = CreateWindowA("mdiclient", "MDI client", WS_CHILD,
                               rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
                               hwndMain, 0, 0, &mdi_client_cs);
-    ok(!!mdiclient, "failed to create window, error %u\n", GetLastError());
+    ok(!!mdiclient, "failed to create window, error %lu\n", GetLastError());
     hwnd = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child",
                            WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
                            orig.left, orig.top, orig.right - orig.left,
                            orig.bottom - orig.top, mdiclient, 0, 0, NULL);
-    ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
     hwnd2 = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child 2",
                             WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
                             orig.left, orig.top, orig.right - orig.left,
                             orig.bottom - orig.top, mdiclient, 0, 0, NULL);
-    ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
 
     ClientToScreen(hwndMain, &pt);
     OffsetRect(&orig, pt.x, pt.y);
@@ -8051,7 +8052,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8066,7 +8067,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* shouldn't be able to resize minimized windows */
     ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -8074,7 +8075,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
     GetWindowRect(hwnd, &rect);
     SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
        wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
 
@@ -8082,7 +8083,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
      * fit more than one per row */
     OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
     ret = ShowWindow(hwnd2, SW_MINIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd2, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8093,7 +8094,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8104,7 +8105,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_MAXIMIZE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8119,7 +8120,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
     /* maximized windows can be resized */
     ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     GetWindowRect(hwnd, &rect);
     SetRect(&expect, 300, 300, 500, 500);
     OffsetRect(&expect, pt.x, pt.y);
@@ -8127,7 +8128,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
        wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
 
     ret = ShowWindow(hwnd, SW_RESTORE);
-    ok(ret, "wrong ret %lu\n", ret);
+    ok(ret, "wrong ret %Iu\n", ret);
     style = GetWindowLongA(hwnd, GWL_STYLE);
     ok(!(style & WS_DISABLED), "window should not be disabled\n");
     ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8231,7 +8232,7 @@ static DWORD CALLBACK gettext_msg_thread( LPVOID arg )
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     return 0;
 }
@@ -8245,7 +8246,7 @@ static DWORD CALLBACK settext_msg_thread( LPVOID arg )
     num_settext_msgs = 0;
     success = SetWindowTextA( hwnd, "thread_caption" );
     ok( success, "SetWindowTextA failed\n" );
-    ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+    ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
 
     return 0;
 }
@@ -8264,7 +8265,7 @@ static void test_gettext(void)
     MSG msg;
 
     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 %ld\n", GetLastError() );
 
     /* test GetWindowTextA */
     num_gettext_msgs = 0;
@@ -8272,7 +8273,7 @@ static void test_gettext(void)
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     /* other process window */
     strcpy( buf, "a" );
@@ -8298,7 +8299,7 @@ static void test_gettext(void)
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len == 0, "got %d\n", buf_len );
     ok( *buf == 0, "got %x\n", *buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     strcpy( buf, "blah" );
@@ -8306,7 +8307,7 @@ static void test_gettext(void)
     buf_len = GetWindowTextA( hwnd, buf, 0 );
     ok( buf_len == 0, "got %d\n", buf_len );
     ok( !strcmp(buf, "blah"), "got %s\n", buf );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     bufW[0] = 0xcc;
     buf_len = InternalGetWindowText( hwnd, bufW, ARRAYSIZE(bufW) );
@@ -8317,7 +8318,7 @@ static void test_gettext(void)
 
     /* same for W window */
     hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL );
-    ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() );
+    ok( hwnd2 != 0, "CreateWindowExA error %ld\n", GetLastError() );
 
     g_wm_gettext_override.enabled = TRUE;
 
@@ -8327,7 +8328,7 @@ static void test_gettext(void)
     buf_len = GetWindowTextW( hwnd2, bufW, ARRAY_SIZE(bufW));
     ok( buf_len == 0, "got %d\n", buf_len );
     ok( *bufW == 0, "got %x\n", *bufW );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     memset( bufW, 0xcc, sizeof(bufW) );
@@ -8335,7 +8336,7 @@ static void test_gettext(void)
     buf_len = GetWindowTextW( hwnd2, bufW, 0 );
     ok( buf_len == 0, "got %d\n", buf_len );
     ok( *bufW == 0xcccc, "got %x\n", *bufW );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     g_wm_gettext_override.enabled = FALSE;
 
@@ -8347,33 +8348,33 @@ static void test_gettext(void)
     r = SendMessageA( hwnd, WM_GETTEXT, sizeof(buf), (LONG_PTR)buf );
     ok( r != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     /* test SetWindowTextA */
     num_settext_msgs = 0;
     success = SetWindowTextA( hwnd, "new_caption" );
     ok( success, "SetWindowTextA failed\n" );
-    ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+    ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
 
     num_gettext_msgs = 0;
     memset( buf, 0, sizeof(buf) );
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "new_caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     /* test WM_SETTEXT */
     num_settext_msgs = 0;
     r = SendMessageA( hwnd, WM_SETTEXT, 0, (ULONG_PTR)"another_caption" );
     ok( r != 0, "WM_SETTEXT failed\n" );
-    ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+    ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
 
     num_gettext_msgs = 0;
     memset( buf, 0, sizeof(buf) );
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
         DispatchMessageA( &msg );
@@ -8381,7 +8382,7 @@ static void test_gettext(void)
     /* test interthread GetWindowTextA */
     num_msgs = 0;
     thread = CreateThread( NULL, 0, gettext_msg_thread, hwnd, 0, &tid );
-    ok(thread != NULL, "CreateThread failed, error %d\n", GetLastError());
+    ok(thread != NULL, "CreateThread failed, error %ld\n", GetLastError());
     while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_SENDMESSAGE ) != WAIT_OBJECT_0)
     {
         while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
@@ -8389,12 +8390,12 @@ static void test_gettext(void)
         num_msgs++;
     }
     CloseHandle( thread );
-    ok( num_msgs >= 1, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs );
+    ok( num_msgs >= 1, "got %lu wakeups from MsgWaitForMultipleObjects\n", num_msgs );
 
     /* test interthread SetWindowText */
     num_msgs = 0;
     thread = CreateThread( NULL, 0, settext_msg_thread, hwnd, 0, &tid );
-    ok(thread != NULL, "CreateThread failed, error %d\n", GetLastError());
+    ok(thread != NULL, "CreateThread failed, error %ld\n", GetLastError());
     while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_SENDMESSAGE ) != WAIT_OBJECT_0)
     {
         while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
@@ -8402,14 +8403,14 @@ static void test_gettext(void)
         num_msgs++;
     }
     CloseHandle( thread );
-    ok( num_msgs >= 1, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs );
+    ok( num_msgs >= 1, "got %lu wakeups from MsgWaitForMultipleObjects\n", num_msgs );
 
     num_gettext_msgs = 0;
     memset( buf, 0, sizeof(buf) );
     buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
     ok( buf_len != 0, "expected a nonempty window text\n" );
     ok( !strcmp(buf, "thread_caption"), "got wrong window text '%s'\n", buf );
-    ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     /* WM_GETTEXT does not terminate returned string */
     memset( buf, 0x1c, sizeof(buf) );
@@ -8429,7 +8430,7 @@ static void test_gettext(void)
     g_wm_gettext_override.dont_terminate = FALSE;
 
     hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL );
-    ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() );
+    ok( hwnd2 != 0, "CreateWindowExA error %ld\n", GetLastError() );
 
     memset( buf, 0x1c, sizeof(buf) );
     g_wm_gettext_override.dont_terminate = TRUE;
@@ -8453,36 +8454,36 @@ static void test_gettext(void)
     if (0)
     {
     r = SendMessageA( hwnd, WM_GETTEXT, 0x10, 0x1000);
-    ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+    ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
 
     r = SendMessageA( hwnd, WM_GETTEXT, 0x10000, 0);
-    ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+    ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
 
     r = SendMessageA( hwnd, WM_GETTEXT, 0xff000000, 0x1000);
-    ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+    ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
 
     r = SendMessageA( hwnd, WM_GETTEXT, 0x1000, 0xff000000);
-    ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+    ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
     }
 
     /* GetWindowText doesn't crash */
     r = GetWindowTextA( hwnd, (LPSTR)0x10, 0x1000 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextA( hwnd, (LPSTR)0x10000, 0 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextA( hwnd, (LPSTR)0xff000000, 0x1000 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextA( hwnd, (LPSTR)0x1000, 0xff000000 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
 
     r = GetWindowTextW( hwnd, (LPWSTR)0x10, 0x1000 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextW( hwnd, (LPWSTR)0x10000, 0 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextW( hwnd, (LPWSTR)0xff000000, 0x1000 );
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
     r = GetWindowTextW( hwnd, (LPWSTR)0x1000, 0xff000000);
-    ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+    ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
 
     DestroyWindow(hwnd);
 }
@@ -8741,12 +8742,12 @@ static void test_GetWindowModuleFileName(void)
     buf1[0] = 0;
     SetLastError(0xdeadbeef);
     ret1 = GetModuleFileNameA(hinst, buf1, sizeof(buf1));
-    ok(ret1, "GetModuleFileName error %u\n", GetLastError());
+    ok(ret1, "GetModuleFileName error %lu\n", GetLastError());
 
     buf2[0] = 0;
     SetLastError(0xdeadbeef);
     ret2 = pGetWindowModuleFileNameA(hwnd, buf2, sizeof(buf2));
-    ok(ret2, "GetWindowModuleFileNameA error %u\n", GetLastError());
+    ok(ret2, "GetWindowModuleFileNameA error %lu\n", GetLastError());
 
     if (ret2)
     {
@@ -8760,28 +8761,28 @@ static void test_GetWindowModuleFileName(void)
     ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
     ok(GetLastError() == 0xdeadbeef /* XP */ ||
        GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
-       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret2 = GetModuleFileNameA(hinst, buf2, 0);
     ok(!ret2, "GetModuleFileName should return 0\n");
     ok(GetLastError() == 0xdeadbeef /* XP */ ||
        GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
-       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret2 = pGetWindowModuleFileNameA(hwnd, buf2, ret1 - 2);
     ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
     ok(GetLastError() == 0xdeadbeef /* XP */ ||
        GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
-       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret2 = pGetWindowModuleFileNameA(hwnd, buf2, 0);
     ok(!ret2, "expected 0, got %u\n", ret2);
     ok(GetLastError() == 0xdeadbeef /* XP */ ||
        GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
-       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+       "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
 
     DestroyWindow(hwnd);
 
@@ -8791,7 +8792,7 @@ static void test_GetWindowModuleFileName(void)
     ret1 = pGetWindowModuleFileNameA(hwnd, buf1, sizeof(buf1));
     ok(!ret1, "expected 0, got %u\n", ret1);
     ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
-       "expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+       "expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
 
     hwnd = FindWindowA("Shell_TrayWnd", NULL);
     ok(IsWindow(hwnd) || broken(!hwnd), "got invalid tray window %p\n", hwnd);
@@ -8865,7 +8866,7 @@ static void test_hwnd_message(void)
     SetLastError(0xdeadbeef);
     found = FindWindowExA( GetDesktopWindow(), 0, 0, "message window" );
     ok( found == 0, "found message window %p/%p\n", found, hwnd );
-    ok( GetLastError() == 0xdeadbeef, "expected deadbeef, got %d\n", GetLastError() );
+    ok( GetLastError() == 0xdeadbeef, "expected deadbeef, got %ld\n", GetLastError() );
     if (parent)
     {
         found = FindWindowExA( parent, 0, 0, "message window" );
@@ -8886,13 +8887,13 @@ static void test_hwnd_message(void)
     {
         SetLastError( 0xdeadbeef );
         result = GetWindowLongPtrW( parent, tests[i].offset );
-        ok( result == tests[i].expect, "offset %d, got %08lx expect %08lx\n",
+        ok( result == tests[i].expect, "offset %d, got %08Ix expect %08Ix\n",
             tests[i].offset, result, tests[i].expect );
         if (tests[i].error)
-            ok( GetLastError() == tests[i].error, "offset %d: error %d expect %d\n",
+            ok( GetLastError() == tests[i].error, "offset %d: error %ld expect %ld\n",
                 tests[i].offset, GetLastError(), tests[i].error );
         else
-            ok( GetLastError() == 0xdeadbeef, "offset %d: error %d expect unchanged\n",
+            ok( GetLastError() == 0xdeadbeef, "offset %d: error %ld expect unchanged\n",
                 tests[i].offset, GetLastError() );
     }
 
@@ -8928,7 +8929,7 @@ static void test_layered_window(void)
     SetLastError( 0xdeadbeef );
     ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
     ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( !ret, "GetLayeredWindowAttributes should fail on non-layered window\n" );
     ret = pSetLayeredWindowAttributes( hwnd, 0, 0, LWA_ALPHA );
@@ -8944,13 +8945,13 @@ static void test_layered_window(void)
     ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
-    ok( key == 0x123456 || key == 0, "wrong color key %x\n", key );
+    ok( key == 0x123456 || key == 0, "wrong color key %lx\n", key );
     ok( alpha == 44, "wrong alpha %u\n", alpha );
-    ok( flags == LWA_ALPHA, "wrong flags %x\n", flags );
+    ok( flags == LWA_ALPHA, "wrong flags %lx\n", flags );
     SetLastError( 0xdeadbeef );
     ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
     ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
 
     /* clearing WS_EX_LAYERED resets attributes */
     SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
@@ -8966,7 +8967,7 @@ static void test_layered_window(void)
     ok( ret, "UpdateLayeredWindow should succeed on layered window\n" );
     ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE | ULW_EX_NORESIZE );
     ok( !ret, "UpdateLayeredWindow should fail with ex flag\n" );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
     if (pUpdateLayeredWindowIndirect)
     {
         UPDATELAYEREDWINDOWINFO info;
@@ -8988,7 +8989,7 @@ static void test_layered_window(void)
         ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
         /* particular error code differs from version to version, could be ERROR_INCORRECT_SIZE,
            ERROR_MR_MID_NOT_FOUND or ERROR_GEN_FAILURE (Win8/Win10) */
-        ok( GetLastError() != 0, "wrong error %u\n", GetLastError() );
+        ok( GetLastError() != 0, "wrong error %lu\n", GetLastError() );
         info.dwFlags  = ULW_OPAQUE;
         ret = pUpdateLayeredWindowIndirect( hwnd, &info );
         ok( ret, "UpdateLayeredWindowIndirect should succeed on layered window\n" );
@@ -8996,38 +8997,38 @@ static void test_layered_window(void)
         info.dwFlags  = ULW_OPAQUE | 0xf00;
         ret = pUpdateLayeredWindowIndirect( hwnd, &info );
         ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
         info.cbSize--;
         info.dwFlags  = ULW_OPAQUE;
         ret = pUpdateLayeredWindowIndirect( hwnd, &info );
         ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
         ret = pUpdateLayeredWindowIndirect( hwnd, NULL );
         ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
     }
 
     ret = pSetLayeredWindowAttributes( hwnd, 0x654321, 22, LWA_COLORKEY | LWA_ALPHA );
     ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
-    ok( key == 0x654321, "wrong color key %x\n", key );
+    ok( key == 0x654321, "wrong color key %lx\n", key );
     ok( alpha == 22, "wrong alpha %u\n", alpha );
-    ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %x\n", flags );
+    ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %lx\n", flags );
     SetLastError( 0xdeadbeef );
     ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
     ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" );
-    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
 
     ret = pSetLayeredWindowAttributes( hwnd, 0x888888, 33, LWA_COLORKEY );
     ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
     alpha = 0;
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
-    ok( key == 0x888888, "wrong color key %x\n", key );
+    ok( key == 0x888888, "wrong color key %lx\n", key );
     /* alpha not changed on vista if LWA_ALPHA is not set */
     ok( alpha == 22 || alpha == 33, "wrong alpha %u\n", alpha );
-    ok( flags == LWA_COLORKEY, "wrong flags %x\n", flags );
+    ok( flags == LWA_COLORKEY, "wrong flags %lx\n", flags );
 
     /* color key may or may not be changed without LWA_COLORKEY */
     ret = pSetLayeredWindowAttributes( hwnd, 0x999999, 44, 0 );
@@ -9035,9 +9036,9 @@ static void test_layered_window(void)
     alpha = 0;
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
-    ok( key == 0x888888 || key == 0x999999, "wrong color key %x\n", key );
+    ok( key == 0x888888 || key == 0x999999, "wrong color key %lx\n", key );
     ok( alpha == 22 || alpha == 44, "wrong alpha %u\n", alpha );
-    ok( flags == 0, "wrong flags %x\n", flags );
+    ok( flags == 0, "wrong flags %lx\n", flags );
 
     /* default alpha and color key is 0 */
     SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
@@ -9046,9 +9047,9 @@ static void test_layered_window(void)
     ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
     ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
     ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
-    ok( key == 0 || key == 0x222222, "wrong color key %x\n", key );
+    ok( key == 0 || key == 0x222222, "wrong color key %lx\n", key );
     ok( alpha == 0 || alpha == 55, "wrong alpha %u\n", alpha );
-    ok( flags == 0, "wrong flags %x\n", flags );
+    ok( flags == 0, "wrong flags %lx\n", flags );
 
     /* test layered window with WS_CLIPCHILDREN flag */
     SetWindowLongA( hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_CLIPCHILDREN );
@@ -9056,7 +9057,7 @@ static void test_layered_window(void)
     SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
     child = CreateWindowExA( 0, "button", "button", WS_VISIBLE | WS_CHILD,
             0, 0, 50, 50, hwnd, 0, 0, NULL );
-    ok( child != NULL, "CreateWindowEx error %u\n", GetLastError() );
+    ok( child != NULL, "CreateWindowEx error %lu\n", GetLastError() );
     ShowWindow( hwnd, SW_SHOW );
 
     ret = pSetLayeredWindowAttributes( hwnd, 0, 255, LWA_ALPHA );
@@ -9107,16 +9108,16 @@ static LRESULT CALLBACK fullscreen_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPAR
         case WM_GETMINMAXINFO:
         {
             MINMAXINFO *minmax = (MINMAXINFO *)lp;
-            ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%d <= %d\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
-            ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%d <= %d\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
-            ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%d >= %d\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
-            ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%d >= %d\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
+            ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%ld <= %ld\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
+            ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%ld <= %ld\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
+            ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%ld >= %ld\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
+            ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%ld >= %ld\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
             break;
         }
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wp, lp);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wp, lp);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wp, lp);
             return ret;
         }
     }
@@ -9143,12 +9144,12 @@ static void test_fullscreen(void)
     pt.x = pt.y = 0;
     SetLastError(0xdeadbeef);
     hmon = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
-    ok(hmon != 0, "MonitorFromPoint error %u\n", GetLastError());
+    ok(hmon != 0, "MonitorFromPoint error %lu\n", GetLastError());
 
     mi.cbSize = sizeof(mi);
     SetLastError(0xdeadbeef);
     ret = GetMonitorInfoA(hmon, &mi);
-    ok(ret, "GetMonitorInfo error %u\n", GetLastError());
+    ok(ret, "GetMonitorInfo error %lu\n", GetLastError());
     trace("monitor %s, work %s\n", wine_dbgstr_rect(&mi.rcMonitor), wine_dbgstr_rect(&mi.rcWork));
 
     cls.style = 0;
@@ -9180,58 +9181,58 @@ static void test_fullscreen(void)
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
                rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
-               "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+               "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             DestroyWindow(hwnd);
 
             style = t_style[i] | WS_MAXIMIZE;
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
                rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
-               "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+               "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             DestroyWindow(hwnd);
 
             style = t_style[i] | WS_MAXIMIZE | WS_CAPTION;
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
                rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
-               "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+               "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             DestroyWindow(hwnd);
 
             style = t_style[i] | WS_CAPTION | WS_MAXIMIZEBOX;
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
                rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
-               "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+               "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             DestroyWindow(hwnd);
 
             style = t_style[i] | WS_MAXIMIZE | WS_CAPTION | WS_MAXIMIZEBOX;
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             /* Windows makes a maximized window slightly larger (to hide the borders?) */
             fixup = min(abs(rc.left), abs(rc.top));
             InflateRect(&rc, -fixup, -fixup);
             ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
                rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
-               "%#x/%#x: window rect %s must be in %s\n", ex_style, style, wine_dbgstr_rect(&rc),
+               "%#lx/%#lx: window rect %s must be in %s\n", ex_style, style, wine_dbgstr_rect(&rc),
                wine_dbgstr_rect(&mi.rcMonitor));
             DestroyWindow(hwnd);
 
@@ -9239,7 +9240,7 @@ static void test_fullscreen(void)
             hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
                                    mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
                                    GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
-            ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+            ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
             GetWindowRect(hwnd, &rc);
             /* Windows makes a maximized window slightly larger (to hide the borders?) */
             fixup = min(abs(rc.left), abs(rc.top));
@@ -9247,11 +9248,11 @@ static void test_fullscreen(void)
             if (style & (WS_CHILD | WS_POPUP))
                 ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
                    rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
-                   "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+                   "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             else
                 ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
                    rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
-                   "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+                   "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
             DestroyWindow(hwnd);
         }
     }
@@ -9260,7 +9261,7 @@ static void test_fullscreen(void)
     /* Add WS_THICKFRAME style later so that the window can cover the entire monitor */
     hwnd = CreateWindowA("fullscreen_class", NULL, WS_POPUP | WS_VISIBLE, 0, 0, mi.rcMonitor.right,
                          mi.rcMonitor.bottom, NULL, NULL, GetModuleHandleA(NULL), NULL);
-    ok(!!hwnd, "CreateWindow failed, error %#x.\n", GetLastError());
+    ok(!!hwnd, "CreateWindow failed, error %#lx.\n", GetLastError());
     flush_events(TRUE);
 
     /* Add WS_THICKFRAME and exit full screen */
@@ -9278,8 +9279,8 @@ static void test_fullscreen(void)
         if (rc.right - rc.left == 100 && rc.bottom - rc.top == 100)
             break;
     }
-    ok(rc.right - rc.left == 100, "Expect width %d, got %d.\n", 100, rc.right - rc.left);
-    ok(rc.bottom - rc.top == 100, "Expect height %d, got %d.\n", 100, rc.bottom - rc.top);
+    ok(rc.right - rc.left == 100, "Expect width %d, got %ld.\n", 100, rc.right - rc.left);
+    ok(rc.bottom - rc.top == 100, "Expect height %d, got %ld.\n", 100, rc.bottom - rc.top);
     DestroyWindow(hwnd);
 
     UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL));
@@ -9318,7 +9319,7 @@ static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM
             minmax = (MINMAXINFO *)lparam;
             if (winetest_debug > 1)
             {
-                trace("hwnd %p, WM_GETMINMAXINFO, %08lx, %08lx\n", hwnd, wparam, lparam);
+                trace("hwnd %p, WM_GETMINMAXINFO, %08Ix, %08Ix\n", hwnd, wparam, lparam);
                 dump_minmax_info( minmax );
             }
             test_thick_child_got_minmax = TRUE;
@@ -9382,7 +9383,7 @@ static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM
         case WM_NCCALCSIZE:
         {
             LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
-            ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+            ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
             return ret;
         }
     }
@@ -9473,7 +9474,7 @@ static void test_thick_child_size(HWND parentWindow)
     cls.lpszClassName = className;
     SetLastError(0xdeadbeef);
     success = RegisterClassA(&cls);
-    ok(success,"RegisterClassA failed, error: %u\n", GetLastError());
+    ok(success,"RegisterClassA failed, error: %lu\n", GetLastError());
 
     for(i = 0; i < NUMBER_OF_THICK_CHILD_TESTS; i++)
     {
@@ -9484,13 +9485,13 @@ static void test_thick_child_size(HWND parentWindow)
 
         SetLastError(0xdeadbeef);
         childWindow = CreateWindowExA( exStyles[i], className, "", styles[i],  0, 0, 0, 0, parentWindow, 0,  GetModuleHandleA(0),  NULL );
-        ok(childWindow != NULL, "Failed to create child window, error: %u\n", GetLastError());
+        ok(childWindow != NULL, "Failed to create child window, error: %lu\n", GetLastError());
 
         ok(test_thick_child_got_minmax, "Got no WM_GETMINMAXINFO\n");
 
         SetLastError(0xdeadbeef);
         success = GetWindowRect(childWindow, &childRect);
-        ok(success,"GetWindowRect call failed, error: %u\n", GetLastError());
+        ok(success,"GetWindowRect call failed, error: %lu\n", GetLastError());
         childWidth = childRect.right - childRect.left;
         childHeight = childRect.bottom - childRect.top;
 
@@ -9513,12 +9514,12 @@ static void test_thick_child_size(HWND parentWindow)
         }
 
         ok((childWidth == expectedWidth) && (childHeight == expectedHeight),
-            "size of window (%s) is wrong: expected size %dx%d != actual size %dx%d\n",
+            "size of window (%s) is wrong: expected size %ldx%ld != actual size %ldx%ld\n",
             test_thick_child_name, expectedWidth, expectedHeight, childWidth, childHeight);
 
         SetLastError(0xdeadbeef);
         success = DestroyWindow(childWindow);
-        ok(success,"DestroyWindow call failed, error: %u\n", GetLastError());
+        ok(success,"DestroyWindow call failed, error: %lu\n", GetLastError());
     }
     ok(UnregisterClassA(className, GetModuleHandleA(NULL)),"UnregisterClass call failed\n");
 }
@@ -9531,7 +9532,7 @@ static void test_handles( HWND full_hwnd )
 
     SetLastError( 0xdeadbeef );
     ret = GetWindowRect( hwnd, &rect );
-    ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+    ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
 
 #ifdef _WIN64
     if ((ULONG_PTR)full_hwnd >> 32)
@@ -9540,24 +9541,24 @@ static void test_handles( HWND full_hwnd )
         hwnd = (HWND)((ULONG_PTR)full_hwnd | ((ULONG_PTR)~0u << 32));
     SetLastError( 0xdeadbeef );
     ret = GetWindowRect( hwnd, &rect );
-    ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+    ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
 
     hwnd = (HWND)(((ULONG_PTR)full_hwnd & ~0u) | ((ULONG_PTR)0x1234 << 32));
     SetLastError( 0xdeadbeef );
     ret = GetWindowRect( hwnd, &rect );
-    ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+    ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
 
     hwnd = (HWND)(((ULONG_PTR)full_hwnd & 0xffff) | ((ULONG_PTR)0x9876 << 16));
     SetLastError( 0xdeadbeef );
     ret = GetWindowRect( hwnd, &rect );
     ok( !ret, "GetWindowRect succeeded for %p\n", hwnd );
-    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError() );
 
     hwnd = (HWND)(((ULONG_PTR)full_hwnd & 0xffff) | ((ULONG_PTR)0x12345678 << 16));
     SetLastError( 0xdeadbeef );
     ret = GetWindowRect( hwnd, &rect );
     ok( !ret, "GetWindowRect succeeded for %p\n", hwnd );
-    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() );
+    ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError() );
 #endif
 }
 
@@ -9579,7 +9580,7 @@ static void test_winregion(void)
     SetLastError(0xdeadbeef);
     ret = pGetWindowRgnBox(hwnd, NULL);
     ok( ret == ERROR, "Expected ERROR, got %d\n", ret);
-    ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError());
+    ok( GetLastError() == 0xdeadbeef, "Expected , got %ld\n", GetLastError());
 
     hrgn = CreateRectRgn(2, 3, 10, 15);
     ok( hrgn != NULL, "Region creation failed\n");
@@ -9590,7 +9591,7 @@ static void test_winregion(void)
         SetLastError(0xdeadbeef);
         ret = pGetWindowRgnBox(hwnd, NULL);
         ok( ret == ERROR, "Expected ERROR, got %d\n", ret);
-        ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError());
+        ok( GetLastError() == 0xdeadbeef, "Expected , got %ld\n", GetLastError());
 
         SetRectEmpty(&r);
         ret = pGetWindowRgnBox(hwnd, &r);
@@ -9649,7 +9650,7 @@ static void test_rtl_layout(void)
     ok( r.left == 30 && r.right == 10, "wrong rect %s\n", wine_dbgstr_rect( &r ));
     pt.x = pt.y = 12;
     MapWindowPoints( child, parent, &pt, 1 );
-    ok( pt.x == 22 && pt.y == 22, "wrong point %d,%d\n", pt.x, pt.y );
+    ok( pt.x == 22 && pt.y == 22, "wrong point %ld,%ld\n", pt.x, pt.y );
     SetWindowPos( parent, 0, 0, 0, 250, 250, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
     GetWindowRect( parent, &r );
     ok( r.left == 100 && r.right == 350, "wrong rect %s\n", wine_dbgstr_rect( &r ));
@@ -9686,13 +9687,13 @@ static void test_FlashWindow(void)
 
     hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP,
                             0, 0, 0, 0, 0, 0, 0, NULL );
-    ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+    ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
 
     SetLastError( 0xdeadbeef );
     ret = pFlashWindow( NULL, TRUE );
     ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
                  GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
-        "FlashWindow returned with %d\n", GetLastError() );
+        "FlashWindow returned with %ld\n", GetLastError() );
 
     DestroyWindow( hwnd );
 
@@ -9700,7 +9701,7 @@ static void test_FlashWindow(void)
     ret = pFlashWindow( hwnd, TRUE );
     ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
                  GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
-        "FlashWindow returned with %d\n", GetLastError() );
+        "FlashWindow returned with %ld\n", GetLastError() );
 }
 
 static void test_FlashWindowEx(void)
@@ -9717,7 +9718,7 @@ static void test_FlashWindowEx(void)
 
     hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP,
                             0, 0, 0, 0, 0, 0, 0, NULL );
-    ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+    ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
 
     finfo.cbSize = sizeof(FLASHWINFO);
     finfo.dwFlags = FLASHW_TIMER;
@@ -9728,13 +9729,13 @@ static void test_FlashWindowEx(void)
     ret = pFlashWindowEx(&finfo);
     ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
                 GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
-       "FlashWindowEx returned with %d\n", GetLastError());
+       "FlashWindowEx returned with %ld\n", GetLastError());
 
     finfo.hwnd = hwnd;
     SetLastError(0xdeadbeef);
     ret = pFlashWindowEx(NULL);
     ok(!ret && GetLastError() == ERROR_NOACCESS,
-       "FlashWindowEx returned with %d\n", GetLastError());
+       "FlashWindowEx returned with %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret = pFlashWindowEx(&finfo);
@@ -9759,32 +9760,32 @@ static void test_FlashWindowEx(void)
     ret = pFlashWindowEx(&finfo);
     ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
                 GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
-       "FlashWindowEx returned with %d\n", GetLastError());
+       "FlashWindowEx returned with %ld\n", GetLastError());
 
     ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize);
     ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd);
-    ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags);
+    ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %lx\n", finfo.dwFlags);
     ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount);
-    ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout);
+    ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %lx\n", finfo.dwTimeout);
 
     hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_VISIBLE | WS_POPUPWINDOW,
                             0, 0, 0, 0, 0, 0, 0, NULL );
-    ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+    ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
     finfo.hwnd = hwnd;
 
     SetLastError(0xdeadbeef);
     ret = pFlashWindowEx(NULL);
     ok(!ret && GetLastError() == ERROR_NOACCESS,
-       "FlashWindowEx returned with %d\n", GetLastError());
+       "FlashWindowEx returned with %ld\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     prev = pFlashWindowEx(&finfo);
 
     ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize);
     ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd);
-    ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags);
+    ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %lx\n", finfo.dwFlags);
     ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount);
-    ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout);
+    ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %lx\n", finfo.dwTimeout);
 
     finfo.dwFlags = FLASHW_STOP;
     SetLastError(0xdeadbeef);
@@ -9799,47 +9800,47 @@ static void test_FindWindowEx(void)
     HWND hwnd, found;
 
     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 %ld\n", GetLastError() );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "ClassThatDoesntExist", "" );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "ClassThatDoesntExist", NULL );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "MainWindowClass", "" );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "MainWindowClass", "caption" );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     DestroyWindow( hwnd );
 
     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 %ld\n", GetLastError() );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "MainWindowClass", "" );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     DestroyWindow( hwnd );
 
@@ -9855,47 +9856,47 @@ static void test_FindWindow(void)
     HWND hwnd, found;
 
     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 %ld\n", GetLastError() );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "ClassThatDoesntExist", "" );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "ClassThatDoesntExist", NULL );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "MainWindowClass", "" );
     ok( found == NULL, "expected a NULL hwnd\n" );
-    ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "MainWindowClass", NULL );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "MainWindowClass", "caption" );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     DestroyWindow( hwnd );
 
     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 %ld\n", GetLastError() );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "MainWindowClass", "" );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     num_gettext_msgs = 0;
     found = FindWindowA( "MainWindowClass", NULL );
     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 );
+    ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
 
     DestroyWindow( hwnd );
 
@@ -10238,7 +10239,7 @@ static void window_from_point_proc(HWND parent)
     ok(got_click, "button under static window didn't get WM_LBUTTONUP\n");
 
     ret = WaitForSingleObject(end_event, 5000);
-    ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
+    ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret);
 
     CloseHandle(start_event);
     CloseHandle(end_event);
@@ -10341,15 +10342,15 @@ static void test_map_points(void)
 
     /* Verify window rect and client rect (they should have the same width and height) */
     GetWindowRect(wnd, &window_rect);
-    ok(window_rect.left == pos.x, "left is %d instead of %d\n", window_rect.left, pos.x);
-    ok(window_rect.top == pos.y, "top is %d instead of %d\n", window_rect.top, pos.y);
-    ok(window_rect.right == pos.x + width, "right is %d instead of %d\n", window_rect.right, pos.x + width);
-    ok(window_rect.bottom == pos.y + height, "bottom is %d instead of %d\n", window_rect.bottom, pos.y + height);
+    ok(window_rect.left == pos.x, "left is %ld instead of %ld\n", window_rect.left, pos.x);
+    ok(window_rect.top == pos.y, "top is %ld instead of %ld\n", window_rect.top, pos.y);
+    ok(window_rect.right == pos.x + width, "right is %ld instead of %ld\n", window_rect.right, pos.x + width);
+    ok(window_rect.bottom == pos.y + height, "bottom is %ld instead of %ld\n", window_rect.bottom, pos.y + height);
     GetClientRect(wnd, &client_rect);
-    ok(client_rect.left == 0, "left is %d instead of 0\n", client_rect.left);
-    ok(client_rect.top == 0, "top is %d instead of 0\n", client_rect.top);
-    ok(client_rect.right == width, "right is %d instead of %d\n", client_rect.right, width);
-    ok(client_rect.bottom == height, "bottom is %d instead of %d\n", client_rect.bottom, height);
+    ok(client_rect.left == 0, "left is %ld instead of 0\n", client_rect.left);
+    ok(client_rect.top == 0, "top is %ld instead of 0\n", client_rect.top);
+    ok(client_rect.right == width, "right is %ld instead of %d\n", client_rect.right, width);
+    ok(client_rect.bottom == height, "bottom is %ld instead of %d\n", client_rect.bottom, height);
 
     /* Test MapWindowPoints */
 
@@ -10359,20 +10360,20 @@ static void test_map_points(void)
     n = MapWindowPoints(NULL, NULL, NULL, 0);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     SetLastError(0xdeadbeef);
     n = MapWindowPoints(wnd, wnd, NULL, 0);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     n = MapWindowPoints(wnd, NULL, NULL, 0);
-    ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %x\n",
+    ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %lx\n",
        n, MAKELONG(window_rect.left, window_rect.top));
 
     n = MapWindowPoints(NULL, wnd, NULL, 0);
-    ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %x\n",
+    ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %lx\n",
        n, MAKELONG(-window_rect.left, -window_rect.top));
 
     SetLastError(0xdeadbeef);
@@ -10380,69 +10381,69 @@ static void test_map_points(void)
     n = MapWindowPoints(dwnd, NULL, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(dwnd, wnd, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(NULL, dwnd, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(wnd, dwnd, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(dwnd, dwnd, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(NULL, NULL, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     n = MapWindowPoints(wnd, wnd, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %d, expected %d\n", n, 0);
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     p.x = p.y = 100;
     n = MapWindowPoints(wnd, NULL, &p, 1);
-    ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %x\n",
+    ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %lx\n",
        n, MAKELONG(window_rect.left, window_rect.top));
-    ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+    ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
        p.x, p.y, window_rect.left + 100, window_rect.top + 100);
 
     p.x = p.y = 100;
     n = MapWindowPoints(NULL, wnd, &p, 1);
-    ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %x\n",
+    ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %lx\n",
        n, MAKELONG(-window_rect.left, -window_rect.top));
-    ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+    ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
        p.x, p.y, -window_rect.left + 100, -window_rect.top + 100);
 
     SetLastError(0xdeadbeef);
@@ -10450,16 +10451,16 @@ static void test_map_points(void)
     n = MapWindowPoints(wnd0, NULL, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %x,  expected 0\n", n);
-    ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 0;
     n = MapWindowPoints(NULL, wnd0, &p, 1);
     err = GetLastError();
     ok(n == 0, "Got %x,  expected 0\n", n);
-    ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
-    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+    ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
+    ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
 
     /* Test ClientToScreen */
 
@@ -10469,34 +10470,34 @@ static void test_map_points(void)
     ret = ClientToScreen(NULL, NULL);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     ret = ClientToScreen(NULL, &p);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     ret = ClientToScreen(dwnd, &p);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     p.x = p.y = 100;
     ret = ClientToScreen(wnd, &p);
-    ok(ret, "Failed with error %u\n", GetLastError());
-    ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+    ok(ret, "Failed with error %lu\n", GetLastError());
+    ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
        p.x, p.y, window_rect.left + 100, window_rect.top + 100);
 
     p.x = p.y = 0;
     ret = ClientToScreen(wnd0, &p);
-    ok(ret, "Failed with error %u\n", GetLastError());
-    ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
+    ok(ret, "Failed with error %lu\n", GetLastError());
+    ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
 
     /* Test ScreenToClient */
 
@@ -10506,34 +10507,34 @@ static void test_map_points(void)
     ret = ScreenToClient(NULL, NULL);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     ret = ScreenToClient(NULL, &p);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     SetLastError(0xdeadbeef);
     p.x = p.y = 100;
     ret = ScreenToClient(dwnd, &p);
     err = GetLastError();
     ok(!ret, "Should fail\n");
-    ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
-    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+    ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+    ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
 
     p.x = p.y = 100;
     ret = ScreenToClient(wnd, &p);
-    ok(ret, "Failed with error %u\n", GetLastError());
-    ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got(%d, %d), expected (%d, %d)\n",
+    ok(ret, "Failed with error %lu\n", GetLastError());
+    ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got(%ld, %ld), expected (%ld, %ld)\n",
        p.x, p.y, -window_rect.left + 100, -window_rect.top + 100);
 
     p.x = p.y = 0;
     ret = ScreenToClient(wnd0, &p);
-    ok(ret, "Failed with error %u\n", GetLastError());
-    ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
+    ok(ret, "Failed with error %lu\n", GetLastError());
+    ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
 
     DestroyWindow(wnd);
     DestroyWindow(wnd0);
@@ -10673,7 +10674,7 @@ static LRESULT WINAPI smresult_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
 
         /* Send another message while we have a reply queued for the current one. */
         res = SendMessageA(data->thread_hwnd, WM_APP+2, 0, lparam);
-        ok(res == 0x449b0190, "unexpected result %lx\n", res);
+        ok(res == 0x449b0190, "unexpected result %Ix\n", res);
 
         return 0;
     }
@@ -10771,12 +10772,12 @@ static void test_smresult(void)
                                       100, 100, 200, 200, 0, 0, 0, NULL);
 
     hThread = CreateThread(NULL, 0, smresult_thread_proc, &data, 0, &tid);
-    ok(hThread != NULL, "CreateThread failed, error %d\n", GetLastError());
+    ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
 
     ok(WaitForSingleObject(data.thread_started, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
 
     res = SendMessageA(data.thread_hwnd, WM_APP, 0, (LPARAM)&data);
-    ok(res == 0x240408ea, "unexpected result %lx\n", res);
+    ok(res == 0x240408ea, "unexpected result %Ix\n", res);
 
     SendMessageA(data.thread_hwnd, WM_CLOSE, 0, 0);
 
@@ -10804,42 +10805,42 @@ static void test_GetMessagePos(void)
     SetCursorPos(120, 140);
     flush_events(TRUE);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
 
     SetCursorPos(340, 320);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
 
     SendMessageW(button, WM_APP, 0, 0);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
 
     PostMessageA(button, WM_APP, 0, 0);
     GetMessageA(&msg, button, 0, 0);
     ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
 
     PostMessageA(button, WM_APP, 0, 0);
     SetCursorPos(350, 330);
     GetMessageA(&msg, button, 0, 0);
     ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
 
     PostMessageA(button, WM_APP, 0, 0);
     SetCursorPos(320, 340);
     PostMessageA(button, WM_APP+1, 0, 0);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
     GetMessageA(&msg, button, 0, 0);
     ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(350, 330), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(350, 330), "pos = %08lx\n", pos);
     GetMessageA(&msg, button, 0, 0);
     ok(msg.message == WM_APP+1, "msg.message = %x\n", msg.message);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(320, 340), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(320, 340), "pos = %08lx\n", pos);
 
     SetTimer(button, 1, 250, NULL);
     SetCursorPos(330, 350);
@@ -10851,7 +10852,7 @@ static void test_GetMessagePos(void)
     }
     ok(msg.message == WM_TIMER, "msg.message = %x\n", msg.message);
     pos = GetMessagePos();
-    ok(pos == MAKELONG(330, 350), "pos = %08x\n", pos);
+    ok(pos == MAKELONG(330, 350), "pos = %08lx\n", pos);
     KillTimer(button, 1);
 
     DestroyWindow(button);
@@ -11090,7 +11091,7 @@ static LRESULT WINAPI winproc_convA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
     {
         const char *text = (const char*)lparam;
 
-        ok(!wparam, "wparam = %08lx\n", wparam);
+        ok(!wparam, "wparam = %08Ix\n", wparam);
         ok(!strcmp(text, "text"), "WM_SETTEXT lparam = %s\n", text);
         return 1;
     }
@@ -11104,7 +11105,7 @@ static LRESULT WINAPI winproc_convW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
     {
         const WCHAR *text = (const WCHAR*)lparam;
 
-        ok(!wparam, "wparam = %08lx\n", wparam);
+        ok(!wparam, "wparam = %08Ix\n", wparam);
         ok(!lstrcmpW(text, textW), "WM_SETTEXT lparam = %s\n", wine_dbgstr_w(text));
         return 1;
     }
@@ -11127,10 +11128,10 @@ static void test_winproc_handles(const char *argv0)
     wnd_classA.lpszClassName = "winproc_test";
     wnd_classA.lpfnWndProc = winproc;
     ret = RegisterClassA(&wnd_classA);
-    ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+    ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
 
     ret = GetClassInfoW(hinst, winproc_testW, &wnd_classW);
-    ok(ret, "GetClassInfoW failed with error %d\n", GetLastError());
+    ok(ret, "GetClassInfoW failed with error %ld\n", GetLastError());
     ok(wnd_classA.lpfnWndProc != wnd_classW.lpfnWndProc,
             "winproc pointers should not be identical\n");
 
@@ -11142,7 +11143,7 @@ static void test_winproc_handles(const char *argv0)
     ok(count == 1, "winproc should be called once (%d)\n", count);
 
     ret = UnregisterClassW(winproc_testW, hinst);
-    ok(ret, "UnregisterClass failed with error %d\n", GetLastError());
+    ok(ret, "UnregisterClass failed with error %ld\n", GetLastError());
 
     /* crashes on 64-bit windows because lpfnWndProc handle is already freed */
     if (sizeof(void*) == 4)
@@ -11189,12 +11190,12 @@ static void test_winproc_limit(void)
     ok(i != 0xffff, "unable to run out of winproc slots\n");
 
     ret = SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convA);
-    ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError());
+    ok(ret, "SetWindowLongPtr failed with error %ld\n", GetLastError());
     ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n");
     ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n");
 
     ret = SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convW);
-    ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError());
+    ok(ret, "SetWindowLongPtr failed with error %ld\n", GetLastError());
     ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n");
     ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n");
 
@@ -11236,21 +11237,21 @@ static void test_deferwindowpos(void)
     hdwp2 = DeferWindowPos(NULL, NULL, NULL, 0, 0, 10, 10, 0);
     todo_wine
     ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) ||
-        broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError());
+        broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %ld\n", hdwp2, GetLastError());
 
     hdwp2 = DeferWindowPos((HDWP)0xdead, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0);
     todo_wine
     ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) ||
-        broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError());
+        broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %ld\n", hdwp2, GetLastError());
 
     hdwp2 = DeferWindowPos(hdwp, NULL, NULL, 0, 0, 10, 10, 0);
-    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
 
     hdwp2 = DeferWindowPos(hdwp, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0);
-    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
 
     hdwp2 = DeferWindowPos(hdwp, (HWND)0xdead, NULL, 0, 0, 10, 10, 0);
-    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+    ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
 
     ret = EndDeferWindowPos(hdwp);
     ok(ret, "got %d\n", ret);
@@ -11259,7 +11260,7 @@ static void test_deferwindowpos(void)
 
     hwnd = create_tool_window(WS_POPUP, 0);
     hdwp2 = DeferWindowPos(hdwp, hwnd, NULL, 0, 0, 10, 10, 0);
-    ok(hdwp2 != NULL, "got %p, error %d\n", hdwp2, GetLastError());
+    ok(hdwp2 != NULL, "got %p, error %ld\n", hdwp2, GetLastError());
     DestroyWindow(hwnd);
 
     ret = EndDeferWindowPos(hdwp);
@@ -11314,7 +11315,7 @@ static void test_LockWindowUpdate(HWND parent)
                 COLORREF c = GetPixel(hdc, p.x, p.y); \
                 COLORREF e = tests[i].expect_valid ? (c_valid) : (c_invalid); \
                 todo_wine_if(!tests[i].expect_valid) \
-                ok(c == e, "%u: GetPixel: got %08x, expected %08x\n", i, c, e); \
+                ok(c == e, "%u: GetPixel: got %08lx, expected %08lx\n", i, c, e); \
             } while (0)
 
         SetPixel(hdc, p.x, p.y, c1);
@@ -11568,13 +11569,13 @@ static void test_desktop( void )
     {
         SetLastError( 0xdeadbeef );
         result = GetWindowLongPtrW( desktop, tests[i].offset );
-        ok( result == tests[i].expect, "offset %d, got %08lx expect %08lx\n",
+        ok( result == tests[i].expect, "offset %d, got %08Ix expect %08Ix\n",
             tests[i].offset, result, tests[i].expect );
         if (tests[i].error)
-            ok( GetLastError() == tests[i].error, "offset %d: error %d expect %d\n",
+            ok( GetLastError() == tests[i].error, "offset %d: error %ld expect %ld\n",
                 tests[i].offset, GetLastError(), tests[i].error );
         else
-            ok( GetLastError() == 0xdeadbeef, "offset %d: error %d expect unchanged\n",
+            ok( GetLastError() == 0xdeadbeef, "offset %d: error %ld expect unchanged\n",
                 tests[i].offset, GetLastError() );
     }
 }
@@ -11616,7 +11617,7 @@ static void test_topmost(void)
 
     owner = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
                               WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, 0);
-    ok(owner != 0, "Failed to create owner window (%d)\n", GetLastError());
+    ok(owner != 0, "Failed to create owner window (%ld)\n", GetLastError());
 
     /* Give current thread foreground state otherwise the tests may fail. */
     if (!SetForegroundWindow(owner))
@@ -11628,10 +11629,10 @@ static void test_topmost(void)
 
     hwnd = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
                               WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, owner);
-    ok(hwnd != 0, "Failed to create popup window (%d)\n", GetLastError());
+    ok(hwnd != 0, "Failed to create popup window (%ld)\n", GetLastError());
     hwnd2 = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
                               WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, owner);
-    ok(hwnd2 != 0, "Failed to create popup window (%d)\n", GetLastError());
+    ok(hwnd2 != 0, "Failed to create popup window (%ld)\n", GetLastError());
 
     flush_events( TRUE );
 
@@ -11738,11 +11739,11 @@ static void test_topmost(void)
     reset_window_state(state, ARRAY_SIZE(state));
 
     hwnd_child2 = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd);
-    ok(hwnd_child2 != 0, "Failed to create popup window (%d)\n", GetLastError());
+    ok(hwnd_child2 != 0, "Failed to create popup window (%ld)\n", GetLastError());
     hwnd_child = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd);
-    ok(hwnd_child != 0, "Failed to create popup window (%d)\n", GetLastError());
+    ok(hwnd_child != 0, "Failed to create popup window (%ld)\n", GetLastError());
     hwnd_grandchild = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd_child);
-    ok(hwnd_grandchild != 0, "Failed to create popup window (%d)\n", GetLastError());
+    ok(hwnd_grandchild != 0, "Failed to create popup window (%ld)\n", GetLastError());
 
     flush_events( TRUE );
 
@@ -11983,70 +11984,70 @@ static void test_display_affinity( HWND win )
 
     ret = pGetWindowDisplayAffinity(NULL, NULL);
     ok(!ret, "GetWindowDisplayAffinity succeeded\n");
-    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
 
     ret = pGetWindowDisplayAffinity(NULL, &affinity);
     ok(!ret, "GetWindowDisplayAffinity succeeded\n");
-    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
 
     ret = pGetWindowDisplayAffinity(win, NULL);
     ok(!ret, "GetWindowDisplayAffinity succeeded\n");
-    ok(GetLastError() == ERROR_NOACCESS, "Expected ERROR_NOACCESS, got %u\n", GetLastError());
+    ok(GetLastError() == ERROR_NOACCESS, "Expected ERROR_NOACCESS, got %lu\n", GetLastError());
 
     styleex = GetWindowLongW(win, GWL_EXSTYLE);
     SetWindowLongW(win, GWL_EXSTYLE, styleex & ~WS_EX_LAYERED);
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     /* Windows 7 fails with ERROR_NOT_ENOUGH_MEMORY when dwm compositing is disabled */
     ret = pSetWindowDisplayAffinity(win, WDA_MONITOR);
     ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
-       "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+       "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
     dwm = ret;
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%x\n", affinity);
-    else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%lx\n", affinity);
+    else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     ret = pSetWindowDisplayAffinity(win, WDA_NONE);
     ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
-       "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+       "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     SetWindowLongW(win, GWL_EXSTYLE, styleex | WS_EX_LAYERED);
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     ret = pSetWindowDisplayAffinity(win, WDA_MONITOR);
     ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
-       "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+       "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%x\n", affinity);
-    else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%lx\n", affinity);
+    else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     ret = pSetWindowDisplayAffinity(win, WDA_NONE);
     ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
-       "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+       "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
 
     affinity = 0xdeadbeef;
     ret = pGetWindowDisplayAffinity(win, &affinity);
-    ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
-    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+    ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+    ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
 
     SetWindowLongW(win, GWL_EXSTYLE, styleex);
 }
@@ -12114,7 +12115,7 @@ static DWORD CALLBACK destroy_thread1(void *user)
     destroy_data.thread1_wnd = CreateWindowExA(0, "destroy_test_thread1",
             "destroy test thread", WS_CHILD, 100, 100, 100, 100,
             destroy_data.main_wnd, 0, GetModuleHandleA(NULL), NULL);
-    ok(destroy_data.thread1_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(destroy_data.thread1_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     PostThreadMessageW(destroy_data.main_tid, WM_USER, 0, 0);
 
     while (GetMessageA(&msg, 0, 0, 0))
@@ -12135,7 +12136,7 @@ static DWORD CALLBACK destroy_thread2(void *user)
     destroy_data.thread2_wnd = CreateWindowExA(0, "destroy_test_thread2",
             "destroy test thread", WS_CHILD, 100, 100, 100, 100,
             destroy_data.main_wnd, 0, GetModuleHandleA(NULL), NULL);
-    ok(destroy_data.thread2_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(destroy_data.thread2_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
 
     PostThreadMessageW(destroy_data.main_tid, WM_USER + 1, 0, 0);
     Sleep( 100 );
@@ -12165,22 +12166,22 @@ static void test_destroy_quit(void)
     wnd_classA.lpszClassName = "destroy_test_main";
     wnd_classA.lpfnWndProc = destroy_main_wndproc;
     ret = RegisterClassA(&wnd_classA);
-    ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+    ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
 
     wnd_classA.lpszClassName = "destroy_test_thread1";
     wnd_classA.lpfnWndProc = destroy_thread1_wndproc;
     ret = RegisterClassA(&wnd_classA);
-    ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+    ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
 
     wnd_classA.lpszClassName = "destroy_test_thread2";
     wnd_classA.lpfnWndProc = destroy_thread2_wndproc;
     ret = RegisterClassA(&wnd_classA);
-    ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+    ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
 
     destroy_data.main_wnd = CreateWindowExA(0, "destroy_test_main",
             "destroy test main", WS_OVERLAPPED | WS_CAPTION, 100, 100, 100, 100,
             0, 0, GetModuleHandleA(NULL), NULL);
-    ok(destroy_data.main_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+    ok(destroy_data.main_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
     if (!destroy_data.main_wnd)
     {
         CloseHandle(destroy_data.evt);
@@ -12248,141 +12249,141 @@ static void test_window_placement(void)
 
     hwnd = CreateWindowA("MainWindowClass", "wp", WS_OVERLAPPEDWINDOW,
         orig.left, orig.top, orig.right - orig.left, orig.bottom - orig.top, 0, 0, 0, 0);
-    ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+    ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
 
     mon_info.cbSize = sizeof(mon_info);
     GetMonitorInfoW(MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY), &mon_info);
     work_rect = mon_info.rcWork;
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -1 && wp.ptMinPosition.y == -1,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_MINIMIZE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(!wp.flags, "got flags %#x\n", wp.flags);
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_RESTORE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_MAXIMIZE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     SetWindowPos(hwnd, 0, 100, 100, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == 100 && wp.ptMaxPosition.y == 100,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left,
                  work_rect.bottom - work_rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left - 1,
                  work_rect.bottom - work_rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == work_rect.left && wp.ptMaxPosition.y == work_rect.top,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left,
                  work_rect.bottom - work_rect.top - 1, SWP_NOZORDER | SWP_NOACTIVATE);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == work_rect.left && wp.ptMaxPosition.y == work_rect.top,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_MINIMIZE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.flags == WPF_RESTORETOMAXIMIZED, "got flags %#x\n", wp.flags);
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_RESTORE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ShowWindow(hwnd, SW_RESTORE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
@@ -12391,15 +12392,15 @@ static void test_window_placement(void)
     wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
     wp.rcNormalPosition = orig2;
     ret = SetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to set window placement, error %u\n", GetLastError());
+    ok(ret, "failed to set window placement, error %lu\n", GetLastError());
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
     GetWindowRect(hwnd, &rect);
@@ -12408,13 +12409,13 @@ static void test_window_placement(void)
     ShowWindow(hwnd, SW_MINIMIZE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(!wp.flags, "got flags %#x\n", wp.flags);
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
@@ -12426,16 +12427,16 @@ static void test_window_placement(void)
     wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
     wp.rcNormalPosition = orig;
     ret = SetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to set window placement, error %u\n", GetLastError());
+    ok(ret, "failed to set window placement, error %lu\n", GetLastError());
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(!wp.flags, "got flags %#x\n", wp.flags);
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
@@ -12447,15 +12448,15 @@ static void test_window_placement(void)
     wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
     wp.rcNormalPosition = orig;
     ret = SetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to set window placement, error %u\n", GetLastError());
+    ok(ret, "failed to set window placement, error %lu\n", GetLastError());
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
@@ -12465,30 +12466,30 @@ static void test_window_placement(void)
     wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
     wp.rcNormalPosition = orig;
     ret = SetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to set window placement, error %u\n", GetLastError());
+    ok(ret, "failed to set window placement, error %lu\n", GetLastError());
 
     ShowWindow(hwnd, SW_MINIMIZE);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
 
     ret = SetWindowPos(hwnd, NULL, 100, 100, 151, 151, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "failed to set window pos, error %u\n", GetLastError());
+    ok(ret, "failed to set window pos, error %lu\n", GetLastError());
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
     GetWindowRect(hwnd, &rect);
@@ -12497,12 +12498,12 @@ static void test_window_placement(void)
     ShowWindow(hwnd, SW_SHOWNORMAL);
 
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "failed to get window placement, error %u\n", GetLastError());
+    ok(ret, "failed to get window placement, error %lu\n", GetLastError());
     ok(wp.showCmd == SW_NORMAL, "got show cmd %u\n", wp.showCmd);
     ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
-        "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+        "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
     ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
-        "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+        "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
     ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
         wine_dbgstr_rect(&wp.rcNormalPosition));
     GetWindowRect(hwnd, &rect);
@@ -12522,7 +12523,7 @@ static void test_arrange_iconic_windows(void)
 
     parent = CreateWindowA("MainWindowClass", "parent", WS_OVERLAPPEDWINDOW,
             100, 200, 500, 300, NULL, 0, 0, NULL);
-    ok(!!parent, "failed to create window, error %u\n", GetLastError());
+    ok(!!parent, "failed to create window, error %lu\n", GetLastError());
 
     GetClientRect(parent, &parent_rect);
     ClientToScreen(parent, &pt);
@@ -12533,25 +12534,25 @@ static void test_arrange_iconic_windows(void)
     mm.iVertGap = 3;
     mm.iArrange = ARW_TOPLEFT | ARW_RIGHT;
     ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
-    ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
+    ok(ret, "failed to set minimized metrics, error %lu\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     ret = ArrangeIconicWindows(parent);
     ok(!ret, "wrong ret %u\n", ret);
-    ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
+    ok(GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError());
 
     for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
     {
         hwnds[i] = CreateWindowA("MainWindowClass", "child", WS_CHILD |
             WS_OVERLAPPEDWINDOW, orig.left, orig.top, orig.right - orig.left,
             orig.bottom - orig.top, parent, 0, 0, NULL);
-        ok(!!hwnds[i], "failed to create window %u, error %u\n", i, GetLastError());
+        ok(!!hwnds[i], "failed to create window %u, error %lu\n", i, GetLastError());
     }
 
     SetLastError(0xdeadbeef);
     ret = ArrangeIconicWindows(parent);
     ok(!ret, "wrong ret %u\n", ret);
-    ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
+    ok(GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError());
 
     for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
     {
@@ -12568,7 +12569,7 @@ static void test_arrange_iconic_windows(void)
     {
         ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
             SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
-        ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+        ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
     }
 
     ret = ArrangeIconicWindows(parent);
@@ -12595,7 +12596,7 @@ static void test_arrange_iconic_windows(void)
         ShowWindow(hwnds[i], SW_MINIMIZE);
         ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
             SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
-        ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+        ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
     }
 
     ret = ArrangeIconicWindows(parent);
@@ -12624,13 +12625,13 @@ static void test_arrange_iconic_windows(void)
     mm.iArrange = ARW_BOTTOMRIGHT | ARW_UP;
     mm.iVertGap = 10;
     ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
-    ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
+    ok(ret, "failed to set minimized metrics, error %lu\n", GetLastError());
 
     for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
     {
         ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
             SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
-        ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+        ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
     }
 
     ret = ArrangeIconicWindows(parent);
@@ -12661,7 +12662,7 @@ static void test_arrange_iconic_windows(void)
     DestroyWindow(parent);
 
     ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0);
-    ok(ret, "failed to restore minimized metrics, error %u\n", GetLastError());
+    ok(ret, "failed to restore minimized metrics, error %lu\n", GetLastError());
 }
 
 static void other_process_proc(HWND hwnd)
@@ -12677,36 +12678,36 @@ static void other_process_proc(HWND hwnd)
 
     /* SW_SHOW */
     ret = WaitForSingleObject(window_ready_event, 5000);
-    ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+    ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "Unexpected ret %#x.\n", ret);
+    ok(ret, "Unexpected ret %#lx.\n", ret);
     ok(wp.showCmd == SW_SHOWNORMAL, "Unexpected showCmd %#x.\n", wp.showCmd);
     ok(!wp.flags, "Unexpected flags %#x.\n", wp.flags);
     SetEvent(test_done_event);
 
     /* SW_SHOWMAXIMIZED */
     ret = WaitForSingleObject(window_ready_event, 5000);
-    ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+    ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "Unexpected ret %#x.\n", ret);
+    ok(ret, "Unexpected ret %#lx.\n", ret);
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
     todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
     SetEvent(test_done_event);
 
     /* SW_SHOWMINIMIZED */
     ret = WaitForSingleObject(window_ready_event, 5000);
-    ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+    ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "Unexpected ret %#x.\n", ret);
+    ok(ret, "Unexpected ret %#lx.\n", ret);
     ok(wp.showCmd == SW_SHOWMINIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
     todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
     SetEvent(test_done_event);
 
     /* SW_RESTORE */
     ret = WaitForSingleObject(window_ready_event, 5000);
-    ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+    ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
     ret = GetWindowPlacement(hwnd, &wp);
-    ok(ret, "Unexpected ret %#x.\n", ret);
+    ok(ret, "Unexpected ret %#lx.\n", ret);
     ok(wp.showCmd == SW_SHOWMAXIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
     todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
     SetEvent(test_done_event);
@@ -12726,10 +12727,10 @@ static void test_SC_SIZE(void)
     ok(!!hwnd, "CreateWindowEx failed.\n");
 
     GetWindowRect(hwnd, &rect);
-    ok(rect.left == 100, "rect.left = %d\n", rect.left);
-    ok(rect.top == 100, "rect.top = %d\n", rect.top);
-    ok(rect.right == 200, "rect.right = %d\n", rect.right);
-    ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
+    ok(rect.left == 100, "rect.left = %ld\n", rect.left);
+    ok(rect.top == 100, "rect.top = %ld\n", rect.top);
+    ok(rect.right == 200, "rect.right = %ld\n", rect.right);
+    ok(rect.bottom == 200, "rect.bottom = %ld\n", rect.bottom);
 
     SetCursorPos(100, 100);
     PostMessageA(hwnd, WM_SYSCOMMAND, SC_SIZE | 9, MAKELONG(100, 100));
@@ -12746,10 +12747,10 @@ static void test_SC_SIZE(void)
     }
 
     GetWindowRect(hwnd, &rect);
-    ok(rect.left == 110, "rect.left = %d\n", rect.left);
-    ok(rect.top == 100, "rect.top = %d\n", rect.top);
-    ok(rect.right == 210, "rect.right = %d\n", rect.right);
-    ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
+    ok(rect.left == 110, "rect.left = %ld\n", rect.left);
+    ok(rect.top == 100, "rect.top = %ld\n", rect.top);
+    ok(rect.right == 210, "rect.right = %ld\n", rect.right);
+    ok(rect.bottom == 200, "rect.bottom = %ld\n", rect.bottom);
 
     DestroyWindow(hwnd);
 }
@@ -12825,11 +12826,11 @@ static void test_cancel_mode(void)
     ok(GetCapture() == hwnd1, "got capture %p\n", GetCapture());
 
     ret = SendMessageA(hwnd2, WM_CANCELMODE, 0, 0);
-    ok(!ret, "got %ld\n", ret);
+    ok(!ret, "got %Id\n", ret);
     ok(GetCapture() == hwnd1, "got capture %p\n", GetCapture());
 
     ret = SendMessageA(hwnd1, WM_CANCELMODE, 0, 0);
-    ok(!ret, "got %ld\n", ret);
+    ok(!ret, "got %Id\n", ret);
     ok(!GetCapture(), "got capture %p\n", GetCapture());
 
     child = CreateWindowA("MainWindowClass", "child", WS_CHILD,
@@ -12839,15 +12840,15 @@ static void test_cancel_mode(void)
     ok(GetCapture() == child, "got capture %p\n", GetCapture());
 
     ret = SendMessageA(hwnd2, WM_CANCELMODE, 0, 0);
-    ok(!ret, "got %ld\n", ret);
+    ok(!ret, "got %Id\n", ret);
     ok(GetCapture() == child, "got capture %p\n", GetCapture());
 
     ret = SendMessageA(hwnd1, WM_CANCELMODE, 0, 0);
-    ok(!ret, "got %ld\n", ret);
+    ok(!ret, "got %Id\n", ret);
     ok(GetCapture() == child, "got capture %p\n", GetCapture());
 
     ret = SendMessageA(child, WM_CANCELMODE, 0, 0);
-    ok(!ret, "got %ld\n", ret);
+    ok(!ret, "got %Id\n", ret);
     ok(!GetCapture(), "got capture %p\n", GetCapture());
 
     DestroyWindow(child);
@@ -12885,23 +12886,23 @@ static LRESULT WINAPI ncdestroy_test_proc( HWND hwnd, UINT msg, WPARAM wp, LPARA
         todo_wine
         ok( !ret, "SetWindowPos succeeded\n" );
         todo_wine
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
 
         SetLastError( 0xdeadbeef );
         parent = SetParent( hwnd, hwndMain );
         ok( parent == 0, "SetParent returned %p\n", parent );
-        ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+        ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
 
         ret = GetWindowRect( hwnd, &rect );
-        ok( ret, "GetWindowRect failed: %u\n", GetLastError() );
+        ok( ret, "GetWindowRect failed: %lu\n", GetLastError() );
         SetRect( &exp, 10, 20, 110, 220 );
         ok( EqualRect( &rect, &exp ), "unexpected rect %s, expected %s\n", wine_dbgstr_rect( &rect ),
             wine_dbgstr_rect( &exp ));
 
         ret = MoveWindow( hwnd, 11, 12, 20, 30, FALSE );
-        ok( ret, "MoveWindow failed: %u\n", GetLastError() );
+        ok( ret, "MoveWindow failed: %lu\n", GetLastError() );
         ret = GetWindowRect( hwnd, &rect );
-        ok( ret, "GetWindowRect failed: %u\n", GetLastError() );
+        ok( ret, "GetWindowRect failed: %lu\n", GetLastError() );
         SetRect( &exp, 11, 12, 31, 42 );
         ok( EqualRect( &rect, &exp ), "unexpected rect %s, expected %s\n", wine_dbgstr_rect( &rect ),
             wine_dbgstr_rect( &exp ));
@@ -12909,7 +12910,7 @@ static LRESULT WINAPI ncdestroy_test_proc( HWND hwnd, UINT msg, WPARAM wp, LPARA
         child = CreateWindowExA( 0, "ToolWindowClass", "Tool window 1", WS_CHILD,
                                  0, 0, 100, 100, hwnd, 0, 0, NULL );
         ok( !child && GetLastError() == ERROR_INVALID_PARAMETER,
-            "CreateWindowExA returned %p %u\n", child, GetLastError() );
+            "CreateWindowExA returned %p %lu\n", child, GetLastError() );
         break;
     }
 
@@ -12945,12 +12946,12 @@ static void test_WM_NCCALCSIZE(void)
     cls.lpszMenuName = NULL;
     cls.lpszClassName = "dummy_window_class";
     ret = RegisterClassA(&cls);
-    ok(ret, "RegisterClass error %u\n", GetLastError());
+    ok(ret, "RegisterClass error %lu\n", GetLastError());
 
     hwnd = CreateWindowExA(0, "dummy_window_class", NULL,
                            WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP,
                            100, 100, 200, 200, 0, 0, GetModuleHandleA(NULL), NULL);
-    ok(hwnd != 0, "CreateWindowEx error %u\n", GetLastError());
+    ok(hwnd != 0, "CreateWindowEx error %lu\n", GetLastError());
 
     GetWindowRect(hwnd, &window_rect);
     params.rgrc[0] = window_rect;
@@ -12969,22 +12970,22 @@ static void test_WM_NCCALCSIZE(void)
     params.lppos = &winpos;
 
     ret = SendMessageW(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)&params);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&params.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(&params.rgrc[0]));
 
     params.rgrc[0] = window_rect;
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)&params);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&params.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(&params.rgrc[0]));
 
     GetWindowRect(hwnd, &window_rect);
     ret = SendMessageW(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
 
     GetWindowRect(hwnd, &window_rect);
     ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect);
-    ok(!ret, "got %08lx\n", ret);
+    ok(!ret, "got %08Ix\n", ret);
     ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
 
     DestroyWindow(hwnd);




More information about the wine-devel mailing list