[PATCH 05/31] dlls/comctl32/tests: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Thu Feb 24 04:27:05 CST 2022


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

---
 dlls/comctl32/tests/Makefile.in  |    1 
 dlls/comctl32/tests/animate.c    |    4 -
 dlls/comctl32/tests/button.c     |  196 ++++++++++++++++-----------------
 dlls/comctl32/tests/combo.c      |  114 ++++++++++---------
 dlls/comctl32/tests/datetime.c   |   62 +++++-----
 dlls/comctl32/tests/dpa.c        |   68 ++++++-----
 dlls/comctl32/tests/edit.c       |  198 +++++++++++++++++----------------
 dlls/comctl32/tests/header.c     |   74 ++++++------
 dlls/comctl32/tests/imagelist.c  |  120 ++++++++++----------
 dlls/comctl32/tests/listbox.c    |  226 +++++++++++++++++++-------------------
 dlls/comctl32/tests/listview.c   |  138 ++++++++++++-----------
 dlls/comctl32/tests/misc.c       |   58 +++++-----
 dlls/comctl32/tests/monthcal.c   |   40 +++----
 dlls/comctl32/tests/mru.c        |   28 ++---
 dlls/comctl32/tests/msg.h        |   16 +--
 dlls/comctl32/tests/pager.c      |   30 +++--
 dlls/comctl32/tests/progress.c   |   12 +-
 dlls/comctl32/tests/propsheet.c  |   84 +++++++-------
 dlls/comctl32/tests/rebar.c      |   20 ++-
 dlls/comctl32/tests/static.c     |    4 -
 dlls/comctl32/tests/status.c     |   13 ++
 dlls/comctl32/tests/subclass.c   |    2 
 dlls/comctl32/tests/syslink.c    |   10 +-
 dlls/comctl32/tests/tab.c        |   40 +++----
 dlls/comctl32/tests/taskdialog.c |   16 +--
 dlls/comctl32/tests/toolbar.c    |  184 +++++++++++++++----------------
 dlls/comctl32/tests/tooltips.c   |   82 +++++++-------
 dlls/comctl32/tests/trackbar.c   |   10 +-
 dlls/comctl32/tests/treeview.c   |   58 +++++-----
 dlls/comctl32/tests/updown.c     |   22 ++--
 dlls/comctl32/tests/v6util.h     |    4 -
 31 files changed, 969 insertions(+), 965 deletions(-)

diff --git a/dlls/comctl32/tests/Makefile.in b/dlls/comctl32/tests/Makefile.in
index 79d7485de73..4669efcf2b5 100644
--- a/dlls/comctl32/tests/Makefile.in
+++ b/dlls/comctl32/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 TESTDLL   = comctl32.dll
 IMPORTS   = ole32 user32 gdi32 advapi32
 
diff --git a/dlls/comctl32/tests/animate.c b/dlls/comctl32/tests/animate.c
index 400de55b5eb..ad7e16ace65 100644
--- a/dlls/comctl32/tests/animate.c
+++ b/dlls/comctl32/tests/animate.c
@@ -136,13 +136,13 @@ static void test_play(void)
     res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(INVALID_AVI_INDEX));
     err = GetLastError();
     ok(res == 0, "Invalid video should have failed\n");
-    ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err);
+    ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %lu\n", err);
 
     SetLastError(0xdeadbeef);
     res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1));
     err = GetLastError();
     ok(res == 0, "Play should have failed\n");
-    ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %u\n", err);
+    ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", err);
     destroy_animate();
 
     create_animate(0, 0);
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c
index f30e9f665e5..0443a36718b 100644
--- a/dlls/comctl32/tests/button.c
+++ b/dlls/comctl32/tests/button.c
@@ -67,7 +67,7 @@ static WCHAR* get_versioned_classname(const WCHAR *name)
     memset(&data, 0, sizeof(data));
     data.cbSize = sizeof(data);
     ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data);
-    ok(ret, "Failed to find class redirection section, error %u\n", GetLastError());
+    ok(ret, "Failed to find class redirection section, error %lu\n", GetLastError());
     wnddata = (struct wndclass_redirect_data*)data.lpData;
     return (WCHAR*)((BYTE*)wnddata + wnddata->name_offset);
 }
@@ -237,10 +237,10 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam
         }
 
         ok_(__FILE__,test_cd.line)(!(cd->dwDrawStage & CDDS_ITEM),
-            "[%u] CDDS_ITEM is set\n", test_cd.button);
+            "[%lu] CDDS_ITEM is set\n", test_cd.button);
 
         ok_(__FILE__,test_cd.line)(state == test_cd.state,
-            "[%u] expected uItemState %u, got %u\n", test_cd.button,
+            "[%lu] expected uItemState %u, got %u\n", test_cd.button,
             test_cd.state, state);
 
         msg.message = message;
@@ -265,7 +265,7 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam
             case CDDS_POSTERASE:
             case CDDS_POSTPAINT:
                 ok_(__FILE__,test_cd.line)(cd->dwItemSpec == 0xdeadbeef,
-                    "[%u] NMCUSTOMDRAW was not shared, stage %u\n", test_cd.button, msg.stage);
+                    "[%lu] NMCUSTOMDRAW was not shared, stage %lu\n", test_cd.button, msg.stage);
                 break;
         }
         return ret;
@@ -278,9 +278,9 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam
 
         GetClientRect(bcd->hdr.hwndFrom, &rc);
 
-        ok(bcd->hdr.hwndFrom != NULL, "Received BCN_DROPDOWN with no hwnd attached, wParam %lu id %lu\n",
+        ok(bcd->hdr.hwndFrom != NULL, "Received BCN_DROPDOWN with no hwnd attached, wParam %Iu id %Iu\n",
            wParam, bcd->hdr.idFrom);
-        ok(bcd->hdr.idFrom == wParam, "[%u] Mismatch between wParam (%lu) and idFrom (%lu)\n",
+        ok(bcd->hdr.idFrom == wParam, "[%u] Mismatch between wParam (%Iu) and idFrom (%Iu)\n",
            button, wParam, bcd->hdr.idFrom);
         ok(EqualRect(&rc, &bcd->rcButton), "[%u] Wrong rcButton, expected %s got %s\n",
            button, wine_dbgstr_rect(&rc), wine_dbgstr_rect(&bcd->rcButton));
@@ -636,7 +636,7 @@ static HWND create_button(DWORD style, HWND parent)
         menuid = (HMENU)ID_BUTTON;
     }
     hwnd = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, parent, menuid, 0, NULL);
-    ok(hwnd != NULL, "failed to create a button, 0x%08x, %p\n", style, parent);
+    ok(hwnd != NULL, "failed to create a button, 0x%08lx, %p\n", style, parent);
     pSetWindowSubclass(hwnd, button_subclass_proc, 0, 0);
     return hwnd;
 }
@@ -775,9 +775,9 @@ static void test_button_messages(void)
         style &= ~(WS_CHILD | BS_NOTIFY);
         /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
         if (button[i].style == BS_USERBUTTON)
-            ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %x\n", style);
+            ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %lx\n", style);
         else
-            ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style);
+            ok(style == button[i].style, "expected style %lx got %lx\n", button[i].style, style);
 
         dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
         if (button[i].style == BS_SPLITBUTTON ||
@@ -785,10 +785,10 @@ static void test_button_messages(void)
                 button[i].style == BS_COMMANDLINK ||
                 button[i].style == BS_DEFCOMMANDLINK)
         {
-            ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08x\n", i, dlg_code);
+            ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08lx\n", i, dlg_code);
         }
         else
-            ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code);
+            ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08lx\n", i, dlg_code);
 
         ShowWindow(hwnd, SW_SHOW);
         UpdateWindow(hwnd);
@@ -828,10 +828,10 @@ static void test_button_messages(void)
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_VISIBLE | WS_CHILD | BS_NOTIFY);
         /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */
-        ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
+        ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
 
         state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
-        ok(state == 0, "expected state 0, got %04x\n", state);
+        ok(state == 0, "expected state 0, got %04lx\n", state);
 
         cd_seq = (button[i].cd_setstate_type == cd_seq_empty) ? empty_cd_seq : pre_pre_cd_seq;
         flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -844,11 +844,11 @@ static void test_button_messages(void)
         check_cd_seq(cd_setstate_type, "BM_SETSTATE/TRUE");
 
         state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
-        ok(state == BST_PUSHED, "expected state 0x0004, got %04x\n", state);
+        ok(state == BST_PUSHED, "expected state 0x0004, got %04lx\n", state);
 
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
-        ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
+        ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
 
         flush_sequences(sequences, NUM_MSG_SEQUENCES);
         set_test_cd_state(0);
@@ -860,14 +860,14 @@ static void test_button_messages(void)
         check_cd_seq(cd_setstate_type, "BM_SETSTATE/FALSE");
 
         state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
-        ok(state == 0, "expected state 0, got %04x\n", state);
+        ok(state == 0, "expected state 0, got %04lx\n", state);
 
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
-        ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
+        ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
 
         state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
-        ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
+        ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
 
         cd_seq = (button[i].cd_setcheck_type == cd_seq_empty) ? empty_cd_seq : pre_pre_cd_seq;
         flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -888,11 +888,11 @@ static void test_button_messages(void)
         check_cd_seq(cd_setcheck_type, "BM_SETCHECK");
 
         state = SendMessageA(hwnd, BM_GETCHECK, 0, 0);
-        ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
+        ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
 
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
-        ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
+        ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
 
         flush_sequences(sequences, NUM_MSG_SEQUENCES);
         set_test_cd_state(0);
@@ -914,18 +914,18 @@ static void test_button_messages(void)
             button[i].style == BS_COMMANDLINK ||
             button[i].style == BS_DEFCOMMANDLINK)
         {
-            ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04x\n", state);
+            ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04lx\n", state);
         }
         else
-            ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04x\n", state);
+            ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04lx\n", state);
 
         style = GetWindowLongA(hwnd, GWL_STYLE);
         style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE);
         if (button[i].style == BS_RADIOBUTTON ||
             button[i].style == BS_AUTORADIOBUTTON)
-            ok(style == (button[i].style | WS_TABSTOP), "expected style %04x | WS_TABSTOP got %04x\n", button[i].style, style);
+            ok(style == (button[i].style | WS_TABSTOP), "expected style %04lx | WS_TABSTOP got %04lx\n", button[i].style, style);
         else
-            ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
+            ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
 
         /* Test that original font is not selected back after painting */
         hfont = (HFONT)SendMessageA(hwnd, WM_GETFONT, 0, 0);
@@ -1128,8 +1128,8 @@ static void test_note(void)
             ok(!ret, "Expect BCM_GETNOTE return false\n");
             ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
                wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
-            ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
-            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size);
+            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_INVALID_PARAMETER, error);
 
             /* Get note length when note is not set */
@@ -1141,7 +1141,7 @@ static void test_note(void)
             ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)test_w);
             ok(ret, "Expect BCM_SETNOTE return true\n");
             error = GetLastError();
-            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
+            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
 
             SetLastError(0xdeadbeef);
             lstrcpyW(buffer_w, deadbeef_w);
@@ -1150,9 +1150,9 @@ static void test_note(void)
             ok(ret, "Expect BCM_GETNOTE return true\n");
             ok(!lstrcmpW(buffer_w, test_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(test_w),
                wine_dbgstr_w(buffer_w));
-            ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
+            ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size);
             error = GetLastError();
-            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
+            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
 
             ret = SendMessageA(hwnd, BCM_GETNOTELENGTH, 0, 0);
             ok(ret == ARRAY_SIZE(test_w) - 1, "Got: %d\n", ret);
@@ -1165,9 +1165,9 @@ static void test_note(void)
             ok(!ret, "Expect BCM_GETNOTE return false\n");
             ok(!lstrcmpW(buffer_w, tes_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(tes_w),
                wine_dbgstr_w(buffer_w));
-            ok(size == ARRAY_SIZE(test_w), "Got: %d\n", size);
+            ok(size == ARRAY_SIZE(test_w), "Got: %ld\n", size);
             error = GetLastError();
-            ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_INSUFFICIENT_BUFFER, error);
 
             /* Set note with NULL buffer */
@@ -1175,7 +1175,7 @@ static void test_note(void)
             ret = SendMessageA(hwnd, BCM_SETNOTE, 0, 0);
             ok(ret, "Expect BCM_SETNOTE return false\n");
             error = GetLastError();
-            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
+            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
 
             /* Check that set note with NULL buffer make note empty */
             SetLastError(0xdeadbeef);
@@ -1184,9 +1184,9 @@ static void test_note(void)
             ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
             ok(ret, "Expect BCM_GETNOTE return true\n");
             ok(!*buffer_w, "Expect note length 0\n");
-            ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
+            ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size);
             error = GetLastError();
-            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
+            ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
             ret = SendMessageA(hwnd, BCM_GETNOTELENGTH, 0, 0);
             ok(ret == 0, "Expect note length: %d, got: %d\n", 0, ret);
 
@@ -1195,9 +1195,9 @@ static void test_note(void)
             size = ARRAY_SIZE(buffer_w);
             ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, 0);
             ok(!ret, "Expect BCM_SETNOTE return false\n");
-            ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
+            ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size);
             error = GetLastError();
-            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_INVALID_PARAMETER, error);
 
             /* Get note with NULL size */
@@ -1208,7 +1208,7 @@ static void test_note(void)
             ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
                wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
             error = GetLastError();
-            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_INVALID_PARAMETER, error);
 
             /* Get note with zero size */
@@ -1219,9 +1219,9 @@ static void test_note(void)
             ok(!ret, "Expect BCM_GETNOTE return false\n");
             ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
                wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
-            ok(size == 1, "Got: %d\n", size);
+            ok(size == 1, "Got: %ld\n", size);
             error = GetLastError();
-            ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_INSUFFICIENT_BUFFER, error);
 
             DestroyWindow(hwnd);
@@ -1235,7 +1235,7 @@ static void test_note(void)
             ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
             ok(!ret, "Expect BCM_GETNOTE return false\n");
             error = GetLastError();
-            ok(error == ERROR_NOT_SUPPORTED, "Expect last error: 0x%08x, got: 0x%08x\n",
+            ok(error == ERROR_NOT_SUPPORTED, "Expect last error: 0x%08x, got: 0x%08lx\n",
                ERROR_NOT_SUPPORTED, error);
             DestroyWindow(hwnd);
         }
@@ -1527,8 +1527,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE | BCSIF_STYLE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x36, "[%u] expected 0x36 default glyph, got 0x%p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x default style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle);
-    ok(info.size.cx == glyph_size, "[%u] expected %d default size.cx, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0 default size.cy, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d default size.cx, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0 default size.cy, got %ld\n", button, info.size.cy);
 
     info.mask = BCSIF_SIZE;
     info.size.cx = glyph_size + 7;
@@ -1539,8 +1539,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info);
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask);
-    ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %d\n", button, glyph_size + 7, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %ld\n", button, glyph_size + 7, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 
     /* Invalid size.cx resets it to default glyph size, while size.cy is stored */
     info.size.cx = 0;
@@ -1551,8 +1551,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info);
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask);
-    ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == -20, "[%u] expected -20, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == -20, "[%u] expected -20, got %ld\n", button, info.size.cy);
 
     info.size.cx = -glyph_size - 7;
     info.size.cy = -10;
@@ -1562,8 +1562,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info);
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask);
-    ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == -10, "[%u] expected -10, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == -10, "[%u] expected -10, got %ld\n", button, info.size.cy);
 
     /* Set to a valid size other than glyph_size */
     info.mask = BCSIF_SIZE;
@@ -1575,8 +1575,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info);
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask);
-    ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %d\n", button, glyph_size + 7, info.size.cx);
-    ok(info.size.cy == 11, "[%u] expected 11, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %ld\n", button, glyph_size + 7, info.size.cx);
+    ok(info.size.cy == 11, "[%u] expected 11, got %ld\n", button, info.size.cy);
 
     /* Change the glyph, size.cx should be automatically adjusted and size.cy set to 0 */
     dummy.mask = BCSIF_GLYPH;
@@ -1588,8 +1588,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x35, "[%u] expected 0x35, got %p\n", button, info.himlGlyph);
-    ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 
     /* Unless the size is specified manually */
     dummy.mask = BCSIF_GLYPH | BCSIF_SIZE;
@@ -1602,8 +1602,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret);
     ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x34, "[%u] expected 0x34, got %p\n", button, info.himlGlyph);
-    ok(info.size.cx == glyph_size + 11, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == 7, "[%u] expected 7, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size + 11, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == 7, "[%u] expected 7, got %ld\n", button, info.size.cy);
 
     /* Add the BCSS_IMAGE style manually with the wrong BCSIF_GLYPH mask, should treat it as invalid image */
     info.mask = BCSIF_GLYPH | BCSIF_STYLE;
@@ -1617,8 +1617,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_GLYPH | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == BCSS_IMAGE, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE, info.uSplitStyle);
-    ok(info.size.cx == border_w, "[%u] expected %d, got %d\n", button, border_w, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == border_w, "[%u] expected %d, got %ld\n", button, border_w, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 
     /* Change the size to prevent ambiguity */
     dummy.mask = BCSIF_SIZE;
@@ -1631,8 +1631,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_GLYPH | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == BCSS_IMAGE, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE, info.uSplitStyle);
-    ok(info.size.cx == glyph_size + 5, "[%u] expected %d, got %d\n", button, glyph_size + 5, info.size.cx);
-    ok(info.size.cy == 4, "[%u] expected 4, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size + 5, "[%u] expected %d, got %ld\n", button, glyph_size + 5, info.size.cx);
+    ok(info.size.cy == 4, "[%u] expected 4, got %ld\n", button, info.size.cy);
 
     /* Now remove the BCSS_IMAGE style manually with the wrong BCSIF_IMAGE mask */
     info.mask = BCSIF_IMAGE | BCSIF_STYLE;
@@ -1646,8 +1646,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x35, "[%u] expected 0x35, got %p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle);
-    ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 
     /* Add a proper valid image, the BCSS_IMAGE style should be set automatically */
     img = pImageList_Create(42, 33, ILC_COLOR, 1, 1);
@@ -1662,8 +1662,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == img, "[%u] expected %p, got %p\n", button, img, info.himlGlyph);
     ok(info.uSplitStyle == (BCSS_IMAGE | BCSS_STRETCH), "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE | BCSS_STRETCH, info.uSplitStyle);
-    ok(info.size.cx == 42 + border_w, "[%u] expected %d, got %d\n", button, 42 + border_w, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == 42 + border_w, "[%u] expected %d, got %ld\n", button, 42 + border_w, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
     pImageList_Destroy(img);
     dummy.mask = BCSIF_SIZE;
     dummy.size.cx = glyph_size + 5;
@@ -1682,8 +1682,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_GLYPH | BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle);
-    ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 
     /* Try a NULL image */
     info.mask = BCSIF_IMAGE;
@@ -1696,8 +1696,8 @@ static void test_bcm_splitinfo(HWND hwnd)
     ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask);
     ok(info.himlGlyph == NULL, "[%u] expected NULL, got %p\n", button, info.himlGlyph);
     ok(info.uSplitStyle == (BCSS_IMAGE | BCSS_STRETCH), "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE | BCSS_STRETCH, info.uSplitStyle);
-    ok(info.size.cx == border_w, "[%u] expected %d, got %d\n", button, border_w, info.size.cx);
-    ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy);
+    ok(info.size.cx == border_w, "[%u] expected %d, got %ld\n", button, border_w, info.size.cx);
+    ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
 }
 
 static void test_button_data(void)
@@ -1897,7 +1897,7 @@ static void test_state(void)
     {
         hwnd = create_button(type, NULL);
         state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
-        ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08x\n", BST_UNCHECKED, state);
+        ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08lx\n", BST_UNCHECKED, state);
         DestroyWindow(hwnd);
     }
 }
@@ -2012,9 +2012,9 @@ static void test_bcm_get_ideal_size(void)
         ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
         /* Ideal size contains text rect even show bitmap only */
         ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight),
-                "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx,
+                "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx,
                 image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight));
-        ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height);
+        ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height);
         DestroyWindow(hwnd);
 
         /* Image alignments when button has bitmap and text*/
@@ -2033,13 +2033,13 @@ static void test_bcm_get_ideal_size(void)
                 if (!(style & (BS_CENTER | BS_VCENTER)) || ((style & BS_CENTER) && (style & BS_CENTER) != BS_CENTER)
                     || !(style & BS_VCENTER) || (style & BS_VCENTER) == BS_VCENTER)
                     ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight),
-                       "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx,
+                       "Style: 0x%08lx expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", style, size.cx,
                        image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight));
                 else
                     ok(size.cx >= max(text_width, height) + pushtype[k].extra_width && size.cy >= height + tm.tmHeight,
-                       "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx,
+                       "Style: 0x%08lx expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", style, size.cx,
                        max(text_width, height) + pushtype[k].extra_width, size.cy, height + tm.tmHeight);
-                ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height);
+                ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height);
                 DestroyWindow(hwnd);
             }
 
@@ -2059,17 +2059,17 @@ static void test_bcm_get_ideal_size(void)
             ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
             if (biml.uAlign == BUTTON_IMAGELIST_ALIGN_TOP || biml.uAlign == BUTTON_IMAGELIST_ALIGN_BOTTOM)
                 ok(size.cx >= max(text_width, height) + pushtype[k].extra_width && size.cy >= height + tm.tmHeight,
-                   "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx,
+                   "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", biml.uAlign, size.cx,
                    max(text_width, height) + pushtype[k].extra_width, size.cy, height + tm.tmHeight);
             else if (biml.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT || biml.uAlign == BUTTON_IMAGELIST_ALIGN_RIGHT)
                 ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight),
-                   "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx,
+                   "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", biml.uAlign, size.cx,
                    image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight));
             else
                 ok(size.cx >= image_width + pushtype[k].extra_width && size.cy >= height,
-                   "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n",
+                   "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n",
                    biml.uAlign, size.cx, image_width + pushtype[k].extra_width, size.cy, height);
-            ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height);
+            ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height);
             DestroyWindow(hwnd);
         }
 
@@ -2093,9 +2093,9 @@ static void test_bcm_get_ideal_size(void)
         ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
         /* Ideal size contains text rect even show icons only */
         ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight),
-           "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx,
+           "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx,
            image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight));
-        ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height);
+        ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height);
         DestroyWindow(hwnd);
 
         /* Show icon and text */
@@ -2109,9 +2109,9 @@ static void test_bcm_get_ideal_size(void)
         ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
         ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
         ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight),
-           "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx,
+           "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx,
            image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight));
-        ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height);
+        ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height);
         DestroyWindow(hwnd);
         DestroyIcon(hicon);
     }
@@ -2130,7 +2130,7 @@ static void test_bcm_get_ideal_size(void)
     ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
     ok((size.cx <= image_width + text_width && size.cx >= text_width && size.cy <= max(height, tm.tmHeight)
         && size.cy >= tm.tmHeight),
-       "Expect ideal cx %d within range (%d, %d ) and ideal cy %d within range (%d, %d )\n", size.cx,
+       "Expect ideal cx %ld within range (%ld, %ld ) and ideal cy %ld within range (%ld, %ld )\n", size.cx,
        text_width, image_width + text_width, size.cy, tm.tmHeight, max(height, tm.tmHeight));
     DestroyWindow(hwnd);
 
@@ -2145,7 +2145,7 @@ static void test_bcm_get_ideal_size(void)
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
     ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
-       "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
+       "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width, size.cy,
        max(height, tm.tmHeight));
     DestroyWindow(hwnd);
 
@@ -2159,7 +2159,7 @@ static void test_bcm_get_ideal_size(void)
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
     ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
-       "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
+       "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width, size.cy,
        max(height, tm.tmHeight));
     DestroyWindow(hwnd);
 
@@ -2178,13 +2178,13 @@ static void test_bcm_get_ideal_size(void)
 
         if (type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK)
         {
-            ok((size.cx == 0 && size.cy > 0), "Style 0x%08x expect ideal cx %d == %d and ideal cy %d > %d\n",
+            ok((size.cx == 0 && size.cy > 0), "Style 0x%08lx expect ideal cx %ld == %d and ideal cy %ld > %d\n",
                style, size.cx, 0, size.cy, 0);
         }
         else
         {
             ok(size.cx == client_width && size.cy == client_height,
-               "Style 0x%08x expect size.cx == %d and size.cy == %d, got size.cx: %d size.cy: %d\n", style,
+               "Style 0x%08lx expect size.cx == %ld and size.cy == %ld, got size.cx: %ld size.cy: %ld\n", style,
                client_width, client_height, size.cx, size.cy);
         }
         DestroyWindow(hwnd);
@@ -2210,19 +2210,19 @@ static void test_bcm_get_ideal_size(void)
                 || type == BS_OWNERDRAW)
             {
                 ok(size.cx == client_width && size.cy == client_height,
-                   "Style 0x%08x expect ideal size (%d,%d), got (%d,%d)\n", style, client_width, client_height, size.cx,
+                   "Style 0x%08lx expect ideal size (%ld,%ld), got (%ld,%ld)\n", style, client_width, client_height, size.cx,
                    size.cy);
             }
             else if (type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK)
             {
                 ok((size.cx == 0 && size.cy > 0),
-                   "Style 0x%08x expect ideal cx %d == %d and ideal cy %d > %d\n", style, size.cx, 0,
+                   "Style 0x%08lx expect ideal cx %ld == %d and ideal cy %ld > %d\n", style, size.cx, 0,
                    size.cy, 0);
             }
             else
             {
                 height = line_count == 2 ? 2 * tm.tmHeight : tm.tmHeight;
-                ok(size.cx >= 0 && size.cy >= height, "Style 0x%08x expect ideal cx %d >= 0 and ideal cy %d >= %d\n",
+                ok(size.cx >= 0 && size.cy >= height, "Style 0x%08lx expect ideal cx %ld >= 0 and ideal cy %ld >= %ld\n",
                     style, size.cx, size.cy, height);
             }
             DestroyWindow(hwnd);
@@ -2239,14 +2239,14 @@ static void test_bcm_get_ideal_size(void)
     size.cy = 0;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
-    ok(size.cx == 13 && size.cy > 0, "Expected ideal cx %d == %d and ideal cy %d > %d\n", size.cx, 13, size.cy, 0);
+    ok(size.cx == 13 && size.cy > 0, "Expected ideal cx %ld == %d and ideal cy %ld > %d\n", size.cx, 13, size.cy, 0);
     height = size.cy;
     size.cx = 32767;
     size.cy = 7;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
     ok(size.cx < 32767, "Expected ideal cx to have been adjusted\n");
-    ok(size.cx > image_width && size.cy == height, "Expected ideal cx %d > %d and ideal cy %d == %d\n", size.cx, image_width, size.cy, height);
+    ok(size.cx > image_width && size.cy == height, "Expected ideal cx %ld > %ld and ideal cy %ld == %ld\n", size.cx, image_width, size.cy, height);
 
     /* Try longer note without word breaks, shouldn't extend height because no word splitting */
     ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)L"WWWWWWWWWWWWWWWW");
@@ -2255,14 +2255,14 @@ static void test_bcm_get_ideal_size(void)
     size.cy = 0;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
-    ok(size.cx == k && size.cy == height, "Expected ideal cx %d == %d and ideal cy %d == %d\n", size.cx, k, size.cy, height);
+    ok(size.cx == k && size.cy == height, "Expected ideal cx %ld == %d and ideal cy %ld == %ld\n", size.cx, k, size.cy, height);
 
     /* Now let it extend the width */
     size.cx = 32767;
     size.cy = 0;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
-    ok(size.cx > k && size.cy == height, "Expected ideal cx %d > %d and ideal cy %d == %d\n", size.cx, k, size.cy, height);
+    ok(size.cx > k && size.cy == height, "Expected ideal cx %ld > %d and ideal cy %ld == %ld\n", size.cx, k, size.cy, height);
 
     /* Use a very long note with words and the same width, should extend the height due to word wrap */
     ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)L"This is a long note for the button with many words, which should "
@@ -2271,13 +2271,13 @@ static void test_bcm_get_ideal_size(void)
     k = size.cx;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
-    ok(size.cx <= k && size.cy > height, "Expected ideal cx %d <= %d and ideal cy %d > %d\n", size.cx, k, size.cy, height);
+    ok(size.cx <= k && size.cy > height, "Expected ideal cx %ld <= %d and ideal cy %ld > %ld\n", size.cx, k, size.cy, height);
 
     /* Now try the wordy note with a width smaller than the image itself, which prevents wrapping */
     size.cx = 13;
     ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n");
-    ok(size.cx == 13 && size.cy == height, "Expected ideal cx %d == %d and ideal cy %d == %d\n", size.cx, 13, size.cy, height);
+    ok(size.cx == 13 && size.cy == height, "Expected ideal cx %ld == %d and ideal cy %ld == %ld\n", size.cx, 13, size.cy, height);
     DestroyWindow(hwnd);
 
 
@@ -2302,12 +2302,12 @@ static void test_style(void)
 
         type = GetWindowLongW(button, GWL_STYLE) & BS_TYPEMASK;
         expected_type = (i == BS_USERBUTTON ? BS_PUSHBUTTON : i);
-        ok(type == expected_type, "Expected type %#x, got %#x.\n", expected_type, type);
+        ok(type == expected_type, "Expected type %#lx, got %#lx.\n", expected_type, type);
 
         for (j = BS_PUSHBUTTON; j <= BS_DEFCOMMANDLINK; ++j)
         {
             ret = SendMessageA(button, BM_SETSTYLE, j, FALSE);
-            ok(ret == 0, "Expected %#x, got %#lx.\n", 0, ret);
+            ok(ret == 0, "Expected %#x, got %#Ix.\n", 0, ret);
 
             type = GetWindowLongW(button, GWL_STYLE) & BS_TYPEMASK;
             if (i >= BS_SPLITBUTTON && j <= BS_DEFPUSHBUTTON)
@@ -2316,7 +2316,7 @@ static void test_style(void)
                 expected_type = j;
 
             ok(type == expected_type || broken(type == j), /* XP */
-                    "Original type %#x, expected new type %#x, got %#x.\n", i, expected_type, type);
+                    "Original type %#lx, expected new type %#lx, got %#lx.\n", i, expected_type, type);
         }
         DestroyWindow(button);
     }
@@ -2360,7 +2360,7 @@ static void test_visual(void)
         BitBlt(mem_dc2, 0, 0, width, height, button_dc, 0, 0, SRCCOPY);
 
         todo_wine_if(type == BS_PUSHBOX || (is_theme_active && type == BS_GROUPBOX))
-        ok(equal_dc(mem_dc1, mem_dc2, width, height), "Type %#x: Expected content unchanged.\n", type);
+        ok(equal_dc(mem_dc1, mem_dc2, width, height), "Type %#lx: Expected content unchanged.\n", type);
 
         DeleteObject(mem_bitmap2);
         DeleteObject(mem_bitmap1);
diff --git a/dlls/comctl32/tests/combo.c b/dlls/comctl32/tests/combo.c
index dd197db5a90..0dd05befa06 100644
--- a/dlls/comctl32/tests/combo.c
+++ b/dlls/comctl32/tests/combo.c
@@ -63,7 +63,7 @@ static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
 
     info->cbSize = sizeof(*info);
     ret = GetComboBoxInfo(hwnd, info);
-    ok(ret, "Failed to get combobox info structure, error %d\n", GetLastError());
+    ok(ret, "Failed to get combobox info structure, error %ld\n", GetLastError());
 }
 
 static HWND createComboEx(DWORD style) {
@@ -168,19 +168,19 @@ static void test_comboex(void)
 
     /* Add items onto the end of the combobox */
     res = addItem(myHwnd, -1, first_item);
-    ok(res == 0, "Adding simple item failed (%d)\n", res);
+    ok(res == 0, "Adding simple item failed (%ld)\n", res);
     res = addItem(myHwnd, -1, second_item);
-    ok(res == 1, "Adding simple item failed (%d)\n", res);
+    ok(res == 1, "Adding simple item failed (%ld)\n", res);
     res = addItem(myHwnd, 2, third_item);
-    ok(res == 2, "Adding simple item failed (%d)\n", res);
+    ok(res == 2, "Adding simple item failed (%ld)\n", res);
     res = addItem(myHwnd, 1, middle_item);
-    ok(res == 1, "Inserting simple item failed (%d)\n", res);
+    ok(res == 1, "Inserting simple item failed (%ld)\n", res);
 
     /* Add an item completely out of range */
     res = addItem(myHwnd, 99, out_of_range_item);
-    ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res);
     res = addItem(myHwnd, 5, out_of_range_item);
-    ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res);
     /* Removed: Causes traps on Windows XP
        res = addItem(myHwnd, -2, "Out Of Range Item");
        ok(res == -1, "Adding out of range worked unexpectedly (%ld)\n", res);
@@ -188,62 +188,62 @@ static void test_comboex(void)
 
     /* Get an item completely out of range */ 
     res = getItem(myHwnd, 99, &cbexItem); 
-    ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
+    ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText);
     res = getItem(myHwnd, 4, &cbexItem); 
-    ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
+    ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText);
     res = getItem(myHwnd, -2, &cbexItem); 
-    ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
+    ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText);
 
     /* Get an item in range */ 
     res = getItem(myHwnd, 0, &cbexItem); 
-    ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
+    ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res);
     ok(strcmp(first_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
 
     res = getItem(myHwnd, 1, &cbexItem); 
-    ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
+    ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res);
     ok(strcmp(middle_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
 
     res = getItem(myHwnd, 2, &cbexItem); 
-    ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
+    ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res);
     ok(strcmp(second_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
 
     res = getItem(myHwnd, 3, &cbexItem); 
-    ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
+    ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res);
     ok(strcmp(third_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
 
     /* Set an item completely out of range */ 
     res = setItem(myHwnd, 99, replacement_item); 
-    ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res);
     res = setItem(myHwnd, 4, replacement_item); 
-    ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res);
     res = setItem(myHwnd, -2, replacement_item); 
-    ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res);
 
     /* Set an item in range */ 
     res = setItem(myHwnd, 0, replacement_item);
-    ok(res != 0, "Setting first item failed (%d)\n", res);
+    ok(res != 0, "Setting first item failed (%ld)\n", res);
     res = setItem(myHwnd, 3, replacement_item);
-    ok(res != 0, "Setting last item failed (%d)\n", res);
+    ok(res != 0, "Setting last item failed (%ld)\n", res);
 
     /* Remove items completely out of range (4 items in control at this point) */
     res = delItem(myHwnd, -1);
-    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res);
     res = delItem(myHwnd, 4);
-    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res);
 
     /* Remove items in range (4 items in control at this point) */
     res = delItem(myHwnd, 3);
-    ok(res == 3, "Deleting using out of range index failed (%d)\n", res);
+    ok(res == 3, "Deleting using out of range index failed (%ld)\n", res);
     res = delItem(myHwnd, 0);
-    ok(res == 2, "Deleting using out of range index failed (%d)\n", res);
+    ok(res == 2, "Deleting using out of range index failed (%ld)\n", res);
     res = delItem(myHwnd, 0);
-    ok(res == 1, "Deleting using out of range index failed (%d)\n", res);
+    ok(res == 1, "Deleting using out of range index failed (%ld)\n", res);
     res = delItem(myHwnd, 0);
-    ok(res == 0, "Deleting using out of range index failed (%d)\n", res);
+    ok(res == 0, "Deleting using out of range index failed (%ld)\n", res);
 
     /* Remove from an empty box */
     res = delItem(myHwnd, 0);
-    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
+    ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res);
 
 
     /* Cleanup */
@@ -294,7 +294,7 @@ static void test_comboex_WM_LBUTTONDOWN(void)
     x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2;
     y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2;
     result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
-    ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
+    ok(result, "WM_LBUTTONDOWN was not processed. LastError=%ld\n",
        GetLastError());
     ok(GetFocus() == hCombo ||
        broken(GetFocus() != hCombo), /* win98 */
@@ -306,7 +306,7 @@ static void test_comboex_WM_LBUTTONDOWN(void)
     ok(idx == 0, "For TopIndex expected %d, got %d\n", 0, idx);
 
     result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
-    ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n",
+    ok(result, "WM_LBUTTONUP was not processed. LastError=%ld\n",
        GetLastError());
     ok(GetFocus() == hCombo ||
        broken(GetFocus() != hCombo), /* win98 */
@@ -319,7 +319,7 @@ static void test_comboex_WM_LBUTTONDOWN(void)
     x = rect.left + (rect.right-rect.left)/2;
     y = item_height/2 + item_height*4;
     result = SendMessageA(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
-    ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n",
+    ok(!result, "WM_MOUSEMOVE was not processed. LastError=%ld\n",
        GetLastError());
     ok(GetFocus() == hCombo ||
        broken(GetFocus() != hCombo), /* win98 */
@@ -327,7 +327,7 @@ static void test_comboex_WM_LBUTTONDOWN(void)
        GetFocus());
 
     result = SendMessageA(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
-    ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
+    ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%ld\n",
        GetLastError());
     ok(GetFocus() == hCombo ||
        broken(GetFocus() != hCombo), /* win98 */
@@ -337,7 +337,7 @@ static void test_comboex_WM_LBUTTONDOWN(void)
        "The dropdown list should still be visible.\n");
 
     result = SendMessageA(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
-    ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n",
+    ok(!result, "WM_LBUTTONUP was not processed. LastError=%ld\n",
        GetLastError());
     todo_wine ok(GetFocus() == hEdit ||
        broken(GetFocus() == hCombo), /* win98 */
@@ -642,7 +642,7 @@ static void test_comboex_get_set_item(void)
     item.pszText = textA;
     item.iItem = -1;
     ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
-    ok(ret == 1, "Unexpected return value %d.\n", ret);
+    ok(ret == 1, "Unexpected return value %ld.\n", ret);
 
     ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
 
@@ -651,17 +651,17 @@ static void test_comboex_get_set_item(void)
     item.iItem = -1;
     item.lParam = 0xdeadbeef;
     ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
-    ok(ret == 1, "Unexpected return value %d.\n", ret);
-    ok(item.lParam == 0, "Expected zero, got %lx\n", item.lParam);
+    ok(ret == 1, "Unexpected return value %ld.\n", ret);
+    ok(item.lParam == 0, "Expected zero, got %Ix\n", item.lParam);
 
     item.lParam = 0x1abe11ed;
     ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
-    ok(ret == 1, "Unexpected return value %d.\n", ret);
+    ok(ret == 1, "Unexpected return value %ld.\n", ret);
 
     item.lParam = 0;
     ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
-    ok(ret == 1, "Unexpected return value %d.\n", ret);
-    ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %lx\n", item.lParam);
+    ok(ret == 1, "Unexpected return value %ld.\n", ret);
+    ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %Ix\n", item.lParam);
 
     DestroyWindow(hComboEx);
 }
@@ -931,29 +931,29 @@ static void test_combo_changesize(DWORD style)
     /* first make it slightly smaller */
     MoveWindow( hCombo, 10, 10, clwidth - 2, clheight - 2, TRUE);
     GetClientRect( hCombo, &rc);
-    ok( rc.right - rc.left == clwidth - 2, "clientrect width is %d vs %d\n",
+    ok( rc.right - rc.left == clwidth - 2, "clientrect width is %ld vs %d\n",
             rc.right - rc.left, clwidth - 2);
-    ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n",
+    ok( rc.bottom - rc.top == clheight, "clientrect height is %ld vs %d\n",
                 rc.bottom - rc.top, clheight);
     SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc);
-    ok( rc.right - rc.left == clwidth - 2, "drop-down rect width is %d vs %d\n",
+    ok( rc.right - rc.left == clwidth - 2, "drop-down rect width is %ld vs %d\n",
             rc.right - rc.left, clwidth - 2);
-    ok( rc.bottom - rc.top == ddheight, "drop-down rect height is %d vs %d\n",
+    ok( rc.bottom - rc.top == ddheight, "drop-down rect height is %ld vs %d\n",
             rc.bottom - rc.top, ddheight);
-    ok( rc.right - rc.left == ddwidth -2, "drop-down rect width is %d vs %d\n",
+    ok( rc.right - rc.left == ddwidth -2, "drop-down rect width is %ld vs %d\n",
             rc.right - rc.left, ddwidth - 2);
     /* new cx, cy is slightly bigger than the initial values */
     MoveWindow( hCombo, 10, 10, clwidth + 2, clheight + 2, TRUE);
     GetClientRect( hCombo, &rc);
-    ok( rc.right - rc.left == clwidth + 2, "clientrect width is %d vs %d\n",
+    ok( rc.right - rc.left == clwidth + 2, "clientrect width is %ld vs %d\n",
             rc.right - rc.left, clwidth + 2);
-    ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n",
+    ok( rc.bottom - rc.top == clheight, "clientrect height is %ld vs %d\n",
             rc.bottom - rc.top, clheight);
     SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc);
-    ok( rc.right - rc.left == clwidth + 2, "drop-down rect width is %d vs %d\n",
+    ok( rc.right - rc.left == clwidth + 2, "drop-down rect width is %ld vs %d\n",
             rc.right - rc.left, clwidth + 2);
     todo_wine {
-        ok( rc.bottom - rc.top == clheight + 2, "drop-down rect height is %d vs %d\n",
+        ok( rc.bottom - rc.top == clheight + 2, "drop-down rect height is %ld vs %d\n",
                 rc.bottom - rc.top, clheight + 2);
     }
 
@@ -1193,8 +1193,8 @@ static void test_combo_listbox_styles(DWORD cb_style)
 
     style = GetWindowLongW( info.hwndList, GWL_STYLE );
     exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
-    ok(style == expect_style, "%08x: got %08x\n", cb_style, style);
-    ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
+    ok(style == expect_style, "%08lx: got %08lx\n", cb_style, style);
+    ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
 
     if (cb_style != CBS_SIMPLE)
         expect_exstyle |= WS_EX_TOPMOST;
@@ -1202,14 +1202,14 @@ static void test_combo_listbox_styles(DWORD cb_style)
     SendMessageW(combo, CB_SHOWDROPDOWN, TRUE, 0 );
     style = GetWindowLongW( info.hwndList, GWL_STYLE );
     exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
-    ok(style == (expect_style | WS_VISIBLE), "%08x: got %08x\n", cb_style, style);
-    ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
+    ok(style == (expect_style | WS_VISIBLE), "%08lx: got %08lx\n", cb_style, style);
+    ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
 
     SendMessageW(combo, CB_SHOWDROPDOWN, FALSE, 0 );
     style = GetWindowLongW( info.hwndList, GWL_STYLE );
     exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
-    ok(style == expect_style, "%08x: got %08x\n", cb_style, style);
-    ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
+    ok(style == expect_style, "%08lx: got %08lx\n", cb_style, style);
+    ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
 
     DestroyWindow(combo);
 }
@@ -1462,7 +1462,7 @@ static void test_comboex_CBEN_GETDISPINFO(void)
     item.iIndent = I_INDENTCALLBACK;
 
     res = SendMessageA(combo, CBEM_INSERTITEMA, 0, (LPARAM)&item);
-    ok(!res, "Unexpected return value %u.\n", res);
+    ok(!res, "Unexpected return value %lu.\n", res);
 
     for (i = 0; i < ARRAY_SIZE(test_masks); ++i)
     {
@@ -1471,7 +1471,7 @@ static void test_comboex_CBEN_GETDISPINFO(void)
         memset(&item, 0, sizeof(item));
         item.mask = test_masks[i];
         res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item);
-        ok(res == 1, "Unexpected return value %u.\n", res);
+        ok(res == 1, "Unexpected return value %lu.\n", res);
 
         ok_sequence(sequences, PARENT_SEQ_INDEX, getdisp_parent_seq, "Get disp mask seq", TRUE);
     }
@@ -1484,7 +1484,7 @@ static void test_comboex_CBEN_GETDISPINFO(void)
     item.mask = CBEIF_IMAGE;
     di_context.mask = 0;
     res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item);
-    ok(res == 1, "Unexpected return value %u.\n", res);
+    ok(res == 1, "Unexpected return value %lu.\n", res);
     todo_wine
     ok(di_context.mask == CBEIF_IMAGE, "Unexpected mask %#x.\n", di_context.mask);
 
@@ -1495,7 +1495,7 @@ static void test_comboex_CBEN_GETDISPINFO(void)
     memset(&item, 0, sizeof(item));
     item.mask = CBEIF_IMAGE;
     res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item);
-    ok(res == 1, "Unexpected return value %u.\n", res);
+    ok(res == 1, "Unexpected return value %lu.\n", res);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "Get disp after DI_SETITEM seq", FALSE);
 
     /* Request two fields, one was set. */
@@ -1503,7 +1503,7 @@ static void test_comboex_CBEN_GETDISPINFO(void)
     item.mask = CBEIF_IMAGE | CBEIF_INDENT;
     di_context.mask = 0;
     res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item);
-    ok(res == 1, "Unexpected return value %u.\n", res);
+    ok(res == 1, "Unexpected return value %lu.\n", res);
     todo_wine
     ok(di_context.mask == CBEIF_INDENT, "Unexpected mask %#x.\n", di_context.mask);
 
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index 47d7a8fbe56..e5dbd6bec45 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -24,9 +24,9 @@
 #include "msg.h"
 #include "v6util.h"
 
-#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %ld\n", (EXPECTED), (GOT))
+#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %Id\n", (EXPECTED), (GOT))
 
-#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %ld(successful)\n", (EXPECTED), (GOT))
+#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %Id(successful)\n", (EXPECTED), (GOT))
 
 #define NUM_MSG_SEQUENCES   1
 #define DATETIME_SEQ_INDEX    0
@@ -220,17 +220,17 @@ static void test_mccolor_types(HWND hWndDateTime, int mccolor_type, const char*
 
     theColor=RGB(0,0,0);
     crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
-    ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
+    ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
     prevColor=theColor;
     theColor=RGB(255,255,255);
     crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
-    ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
+    ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
     prevColor=theColor;
     theColor=RGB(100,180,220);
     crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
-    ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
+    ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
     crColor = SendMessageA(hWndDateTime, DTM_GETMCCOLOR, mccolor_type, 0);
-    ok(crColor==theColor, "%s: GETMCCOLOR: Expected %d, got %d\n", mccolor_name, theColor, crColor);
+    ok(crColor==theColor, "%s: GETMCCOLOR: Expected %ld, got %ld\n", mccolor_name, theColor, crColor);
 }
 
 static void test_dtm_set_and_get_mccolor(void)
@@ -282,7 +282,7 @@ static void test_dtm_get_monthcal(void)
 
     todo_wine {
         r = SendMessageA(hWnd, DTM_GETMONTHCAL, 0, 0);
-        ok(r == 0, "Expected NULL(no child month calendar control), got %ld\n", r);
+        ok(r == 0, "Expected NULL(no child month calendar control), got %Id\n", r);
     }
 
     ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_get_monthcal_seq, "test_dtm_get_monthcal", FALSE);
@@ -348,7 +348,7 @@ static void test_dtm_set_and_get_range(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r);
+    ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
 
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
@@ -362,7 +362,7 @@ static void test_dtm_set_and_get_range(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r);
+    ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r);
     expect_systime(&st[1], &getSt[1]);
 
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
@@ -376,7 +376,7 @@ static void test_dtm_set_and_get_range(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
     expect_systime(&st[1], &getSt[1]);
 
@@ -388,7 +388,7 @@ static void test_dtm_set_and_get_range(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
     expect_systime(&st[1], &getSt[1]);
 
@@ -400,7 +400,7 @@ static void test_dtm_set_and_get_range(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
     expect_systime(&st[1], &getSt[1]);
 
@@ -408,9 +408,9 @@ static void test_dtm_set_and_get_range(void)
 
     /* DTM_SETRANGE with 0 flags */
     r = SendMessageA(hWnd, DTM_SETRANGE, 0, (LPARAM)st);
-    ok(r, "got %lu\n", r);
+    ok(r, "got %Iu\n", r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == 0, "got %lu\n", r);
+    ok(r == 0, "got %Iu\n", r);
     ok(getSt[0].wYear == 0 && getSt[1].wYear == 0, "got %u, %u\n", getSt[0].wYear, getSt[1].wYear);
 
     DestroyWindow(hWnd);
@@ -435,7 +435,7 @@ static void test_dtm_set_range_swap_min_max(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&origSt);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     expect_systime(&st[0], &origSt);
 
     /* set st[0] to value higher than st[1] */
@@ -447,7 +447,7 @@ static void test_dtm_set_range_swap_min_max(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     todo_wine {
         ok(compare_systime(&st[0], &getSt[0]) == 1 ||
            broken(compare_systime(&st[0], &getSt[1]) == 1), /* comctl32 version  <= 5.80 */
@@ -463,7 +463,7 @@ static void test_dtm_set_range_swap_min_max(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     /* the time part seems to not change after swapping the min and max values
     and doing DTM_SETSYSTEMTIME */
     expect_systime_date(&st[0], &getSt[0]);
@@ -484,7 +484,7 @@ static void test_dtm_set_range_swap_min_max(void)
     whenever we do a DTM_SETRANGE, the DTM_GETRANGE will return the values
     swapped*/
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     todo_wine {
         ok(compare_systime(&st[0], &getSt[1]) == 1 ||
            broken(compare_systime(&st[0], &getSt[0]) == 1), /* comctl32 version  <= 5.80 */
@@ -504,7 +504,7 @@ static void test_dtm_set_range_swap_min_max(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[1]);
     expect_systime(&st[1], &getSt[0]);
 
@@ -516,7 +516,7 @@ static void test_dtm_set_range_swap_min_max(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
     expect_systime(&st[1], &getSt[1]);
 
@@ -544,7 +544,7 @@ static void test_dtm_set_and_get_system_time(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
-    ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %ld\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);
+    ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %Id\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);
 
     /* set st to lowest possible value */
     fill_systime_struct(&st, 1601, 1, 0, 1, 0, 0, 0, 0);
@@ -564,7 +564,7 @@ static void test_dtm_set_and_get_system_time(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     expect_systime(&st, &getSt);
 
     /* set st to invalid value */
@@ -687,7 +687,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
     r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
-    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
+    ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
     expect_systime(&st[0], &getSt[0]);
     expect_systime(&st[1], &getSt[1]);
 
@@ -696,7 +696,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     expect_systime(&refSt, &getSt[0]);
 
     /* Now set an out-of-bounds time */
@@ -705,7 +705,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     expect_systime(&refSt, &getSt[0]);
 
     fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0);
@@ -713,7 +713,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
     r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
     expect(1, r);
     r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
-    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
+    ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
     expect_systime(&refSt, &getSt[0]);
 
     ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_systime_with_limits, "test_dtm_set_and_get_systime_with_limits", FALSE);
@@ -755,7 +755,7 @@ static void test_dtm_get_ideal_size(void)
     r = SendMessageA(hwnd, DTM_GETIDEALSIZE, 0, (LPARAM)&size);
     ok(r, "Expect DTM_GETIDEALSIZE message to return true\n");
     ok(size.cx > 0 && size.cy >= tm.tmHeight,
-       "Expect size.cx > 0 and size.cy >= %d, got cx:%d cy:%d\n", tm.tmHeight, size.cx, size.cy);
+       "Expect size.cx > 0 and size.cy >= %ld, got cx:%ld cy:%ld\n", tm.tmHeight, size.cx, size.cy);
 
     DestroyWindow(hwnd);
     DeleteObject(hfont);
@@ -775,7 +775,7 @@ static void test_wm_set_get_text(void)
     ok(CB_ERR == ret ||
        broken(0 == ret) || /* comctl32 <= 4.72 */
        broken(1 == ret), /* comctl32 <= 4.70 */
-       "Expected CB_ERR, got %ld\n", ret);
+       "Expected CB_ERR, got %Id\n", ret);
 
     buff[0] = 0;
     ret = SendMessageA(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
@@ -785,20 +785,20 @@ static void test_wm_set_get_text(void)
     SetLastError(0xdeadbeef);
     ret = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_ICALENDARTYPE, caltype, 3);
     if (ret == 0)
-        skip("Must know local calendar type (%x)\n", GetLastError());
+        skip("Must know local calendar type (%lx)\n", GetLastError());
     else if (atoi(caltype) != CAL_GREGORIAN)
         skip("DateTimePicker Control only supports Gregorian calendar (type: %s)\n", caltype);
     else {
         SetLastError(0xdeadbeef);
         ret = GetDateFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
         if (ret == 0)
-            skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError());
+            skip("GetDateFormat failed, returned %Id, error %ld\n", ret, GetLastError());
         else
         {
             ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
 
             ret = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
-            ok(ret == strlen(time), "Got wrong length: %ld, expected %d.\n", ret, strlen(time));
+            ok(ret == strlen(time), "Got wrong length: %Id, expected %Id.\n", ret, strlen(time));
         }
     }
 
diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c
index 841076ef00f..3eaa1d5810f 100644
--- a/dlls/comctl32/tests/dpa.c
+++ b/dlls/comctl32/tests/dpa.c
@@ -35,7 +35,7 @@
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 typedef struct _STREAMDATA
@@ -96,13 +96,13 @@ static void init_functions(void)
 /* Callbacks */
 static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
 {
-    ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
+    ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
     return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
 }
 
 static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
 {
-    ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
+    ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
     return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;
 }
 
@@ -115,14 +115,14 @@ static INT nMessages[4];
 static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
 {
     nMessages[op]++;
-    ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
+    ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
     return p1;
 }        
 
 static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
 {
     nMessages[op]++;
-    ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
+    ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
     return ((PCHAR)p2)+1;
 }
 
@@ -209,12 +209,12 @@ static void test_dpa(void)
     
     GetSystemInfo(&si);
     hHeap = HeapCreate(0, 1, 2);
-    ok(hHeap != NULL, "error=%d\n", GetLastError());
+    ok(hHeap != NULL, "error=%ld\n", GetLastError());
     dpa3 = pDPA_CreateEx(0, hHeap);
     ok(dpa3 != NULL, "\n");
     ret = pDPA_Grow(dpa3, si.dwPageSize + 1);
     ok(!ret && GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
-       "ret=%d error=%d\n", ret, GetLastError());
+       "ret=%d error=%ld\n", ret, GetLastError());
 
     dpa = pDPA_Create(0);
     ok(dpa != NULL, "\n");
@@ -224,7 +224,7 @@ static void test_dpa(void)
     /* Fill the created gap */
     ok(pDPA_SetPtr(dpa, 0, (PVOID)5), "\n");
     rc=CheckDPA(dpa, 0x56, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     
     /* Prepend item */
     ret = pDPA_InsertPtr(dpa, 1, (PVOID)1);
@@ -240,7 +240,7 @@ static void test_dpa(void)
     ok(ret == 5, "ret=%d\n", ret);
 
     rc=CheckDPA(dpa, 0x516324, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     for(i = 1; i <= 6; i++)
     {
@@ -254,28 +254,28 @@ static void test_dpa(void)
     /* Sort DPA */
     ok(pDPA_Sort(dpa, CB_CmpGT, 0x1abe11ed), "\n");
     rc=CheckDPA(dpa, 0x654321, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     
     /* Clone into a new DPA */
     dpa2 = pDPA_Clone(dpa, NULL);
     ok(dpa2 != NULL, "\n");
     /* The old data should have been preserved */
     rc=CheckDPA(dpa2, 0x654321, &dw2);
-    ok(rc, "dw=0x%x\n", dw2);
+    ok(rc, "dw=0x%lx\n", dw2);
     ok(pDPA_Sort(dpa, CB_CmpLT, 0x1abe11ed), "\n");
     
     /* Test if the DPA itself was really copied */
     rc=CheckDPA(dpa,  0x123456, &dw);
-    ok(rc, "dw=0x%x\n",  dw );
+    ok(rc, "dw=0x%lx\n",  dw );
     rc=CheckDPA(dpa2, 0x654321, &dw2);
-    ok(rc, "dw2=0x%x\n", dw2);
+    ok(rc, "dw2=0x%lx\n", dw2);
 
     /* Clone into an old DPA */
     SetLastError(ERROR_SUCCESS);
     p = pDPA_Clone(dpa, dpa3);
     ok(p == dpa3, "p=%p\n", p);
     rc=CheckDPA(dpa3, 0x123456, &dw3);
-    ok(rc, "dw3=0x%x\n", dw3);
+    ok(rc, "dw3=0x%lx\n", dw3);
 
     for(i = 1; i <= 6; i++)
     {
@@ -309,7 +309,7 @@ static void test_dpa(void)
     p = pDPA_DeletePtr(dpa, 2);
     ok(p == (PVOID)3, "p=%p\n", p);
     rc=CheckDPA(dpa, 0x12456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     /* Check where to re-insert the deleted item */
     i = pDPA_Search(dpa, (PVOID)3, 0, 
@@ -328,7 +328,7 @@ static void test_dpa(void)
     ret = pDPA_InsertPtr(dpa, 2, (PVOID)3);
     ok(ret == 2, "ret=%d i=%d\n", ret, 2);
     rc=CheckDPA(dpa, 0x123456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     
     /* When doing a binary search while claiming reverse order all indexes
      * should be bogus */
@@ -346,7 +346,7 @@ static void test_dpa(void)
           
     pDPA_DeleteAllPtrs(dpa2);
     rc=CheckDPA(dpa2, 0, &dw2);
-    ok(rc, "dw2=0x%x\n", dw2);
+    ok(rc, "dw2=0x%lx\n", dw2);
 
     pDPA_Destroy(dpa);
     pDPA_Destroy(dpa2);
@@ -372,7 +372,7 @@ static void test_DPA_Merge(void)
     ok(ret == 2, "ret=%d\n", ret);
 
     rc = CheckDPA(dpa, 0x135, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     for (i = 0; i < 6; i++)
     {
@@ -383,16 +383,16 @@ static void test_DPA_Merge(void)
     }
 
     rc = CheckDPA(dpa2, 0x654321, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     rc = CheckDPA(dpa3, 0x123456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     /* Delete all odd entries from dpa2 */
     memset(nMessages, 0, sizeof(nMessages));
     pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
                CB_CmpLT, CB_MergeDeleteOddSrc, 0x1abe11ed);
     rc = CheckDPA(dpa2, 0x246, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     expect(3, nMessages[DPAMM_MERGE]);
     expect(3, nMessages[DPAMM_DELETE]);
@@ -409,7 +409,7 @@ static void test_DPA_Merge(void)
     pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
                CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
     rc = CheckDPA(dpa2, 0x135, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     expect(3, nMessages[DPAMM_MERGE]);
     expect(6, nMessages[DPAMM_DELETE]);
@@ -431,7 +431,7 @@ static void test_DPA_Merge(void)
     rc = CheckDPA(dpa2, 0x123456, &dw);
     ok(rc ||
        broken(!rc && dw == 0x23456), /* 4.7x */
-       "dw=0x%x\n", dw);
+       "dw=0x%lx\n", dw);
 
     expect(0, nMessages[DPAMM_MERGE]);
     expect(0, nMessages[DPAMM_DELETE]);
@@ -463,13 +463,13 @@ static void test_DPA_Merge(void)
        "Expected 3, got %d\n", nMessages[DPAMM_INSERT]);
 
     rc = CheckDPA(dpa,  0x123456, &dw);
-    ok(rc, "dw=0x%x\n",  dw);
+    ok(rc, "dw=0x%lx\n",  dw);
     rc = CheckDPA(dpa2, 0x123456, &dw);
     ok(rc ||
        broken(!rc), /* win98 */
-       "dw=0x%x\n", dw);
+       "dw=0x%lx\n", dw);
     rc = CheckDPA(dpa3, 0x123456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     pDPA_Destroy(dpa);
     pDPA_Destroy(dpa2);
@@ -492,13 +492,13 @@ static void test_DPA_EnumCallback(void)
     }
 
     rc = CheckDPA(dpa, 0x123456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
 
     nEnum = 0;
     /* test callback sets first 3 items to 7 */
     pDPA_EnumCallback(dpa, CB_EnumFirstThree, dpa);
     rc = CheckDPA(dpa, 0x777456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     ok(nEnum == 3, "nEnum=%d\n", nEnum);
 
     pDPA_Destroy(dpa);
@@ -535,7 +535,7 @@ static void test_DPA_LoadStream(void)
     HDPA dpa;
 
     hRes = CoInitialize(NULL);
-    ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes);
+    ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);
 
     dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE;
     hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg);
@@ -622,10 +622,10 @@ static void test_DPA_LoadStream(void)
     expect(E_FAIL, hRes);
 
     ret = IStream_Release(pStm);
-    ok(!ret, "ret=%d\n", ret);
+    ok(!ret, "ret=%ld\n", ret);
 
     ret = IStorage_Release(pStg);
-    ok(!ret, "ret=%d\n", ret);
+    ok(!ret, "ret=%ld\n", ret);
 
     CoUninitialize();
 }
@@ -643,7 +643,7 @@ static void test_DPA_SaveStream(void)
     LARGE_INTEGER liZero;
 
     hRes = CoInitialize(NULL);
-    ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes);
+    ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);
 
     dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE;
     hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg);
@@ -657,7 +657,7 @@ static void test_DPA_SaveStream(void)
     /* simple parameter check */
     hRes = pDPA_SaveStream(dpa, NULL, pStm, NULL);
     ok(hRes == E_INVALIDARG ||
-       broken(hRes == S_OK) /* XP and below */, "Wrong result, %d\n", hRes);
+       broken(hRes == S_OK) /* XP and below */, "Wrong result, %ld\n", hRes);
 if (0) {
     /* crashes on XP */
     hRes = pDPA_SaveStream(NULL, CB_Save, pStm, NULL);
@@ -688,7 +688,7 @@ if (0) {
     hRes = pDPA_LoadStream(&dpa, CB_Load, pStm, (void*)0xdeadbeef);
     expect(S_OK, hRes);
     rc = CheckDPA(dpa, 0x123456, &dw);
-    ok(rc, "dw=0x%x\n", dw);
+    ok(rc, "dw=0x%lx\n", dw);
     pDPA_Destroy(dpa);
 
     ret = IStream_Release(pStm);
diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index 2c108ed419c..4bfbecc713b 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -669,7 +669,7 @@ static void set_client_height(HWND Wnd, unsigned Height)
 
     GetClientRect(Wnd, &ClientRect);
     ok(ClientRect.bottom - ClientRect.top == Height,
-        "The client height should be %d, but is %d\n",
+        "The client height should be %d, but is %ld\n",
         Height, ClientRect.bottom - ClientRect.top);
 }
 
@@ -685,52 +685,52 @@ static void test_edit_control_1(void)
     trace("EDIT: Single line\n");
     hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = get_edit_style(hwEdit);
-    ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%x\n", r);
+    ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%lx\n", r);
     for (i = 0; i < 65535; i++)
     {
         msMessage.wParam = i;
         r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
         ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
-            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
+            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r);
     }
     DestroyWindow(hwEdit);
 
     trace("EDIT: Single line want returns\n");
     hwEdit = create_editcontrol(ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = get_edit_style(hwEdit);
-    ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%x\n", r);
+    ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%lx\n", r);
     for (i = 0; i < 65535; i++)
     {
         msMessage.wParam = i;
         r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
         ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
-            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
+            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r);
     }
     DestroyWindow(hwEdit);
 
     trace("EDIT: Multiline line\n");
     hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = get_edit_style(hwEdit);
-    ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%x\n", r);
+    ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%lx\n", r);
     for (i = 0; i < 65535; i++)
     {
         msMessage.wParam = i;
         r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
         ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
-            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
+            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r);
     }
     DestroyWindow(hwEdit);
 
     trace("EDIT: Multi line want returns\n");
     hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = get_edit_style(hwEdit);
-    ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%x\n", r);
+    ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%lx\n", r);
     for (i = 0; i < 65535; i++)
     {
         msMessage.wParam = i;
         r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
         ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
-            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
+            "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r);
     }
     DestroyWindow(hwEdit);
 }
@@ -765,11 +765,11 @@ static void test_edit_control_2(void)
     trace("EDIT: SETTEXT atomicity\n");
     /* Send messages to "type" in the word 'foo'. */
     r = SendMessageA(hwndET2, WM_CHAR, 'f', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     r = SendMessageA(hwndET2, WM_CHAR, 'o', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     r = SendMessageA(hwndET2, WM_CHAR, 'o', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     /* 'foo' should have been changed to 'bar' by the UPDATE handler. */
     GetWindowTextA(hwndET2, szLocalString, MAXLEN);
     ok(strcmp(szLocalString, "bar")==0,
@@ -777,34 +777,34 @@ static void test_edit_control_2(void)
 
     /* try setting the caret before it's visible */
     r = SetCaretPos(0, 0);
-    todo_wine ok(0 == r, "SetCaretPos succeeded unexpectedly, expected: 0, got: %d\n", r);
+    todo_wine ok(0 == r, "SetCaretPos succeeded unexpectedly, expected: 0, got: %ld\n", r);
     phwnd = SetFocus(hwndET2);
     ok(phwnd != NULL, "SetFocus failed unexpectedly, expected non-zero, got NULL\n");
     r = SetCaretPos(0, 0);
-    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
+    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
     r = GetCaretPos(&cpos);
-    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
-    ok(cpos.x == 0 && cpos.y == 0, "Wrong caret position, expected: (0,0), got: (%d,%d)\n", cpos.x, cpos.y);
+    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
+    ok(cpos.x == 0 && cpos.y == 0, "Wrong caret position, expected: (0,0), got: (%ld,%ld)\n", cpos.x, cpos.y);
     r = SetCaretPos(-1, -1);
-    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
+    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
     r = GetCaretPos(&cpos);
-    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
-    ok(cpos.x == -1 && cpos.y == -1, "Wrong caret position, expected: (-1,-1), got: (%d,%d)\n", cpos.x, cpos.y);
+    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
+    ok(cpos.x == -1 && cpos.y == -1, "Wrong caret position, expected: (-1,-1), got: (%ld,%ld)\n", cpos.x, cpos.y);
     r = SetCaretPos(w << 1, h << 1);
-    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
+    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
     r = GetCaretPos(&cpos);
-    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
-    ok(cpos.x == (w << 1) && cpos.y == (h << 1), "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w << 1, h << 1, cpos.x, cpos.y);
+    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
+    ok(cpos.x == (w << 1) && cpos.y == (h << 1), "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w << 1, h << 1, cpos.x, cpos.y);
     r = SetCaretPos(w, h);
-    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
+    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
     r = GetCaretPos(&cpos);
-    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
-    ok(cpos.x == w && cpos.y == h, "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w, h, cpos.x, cpos.y);
+    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
+    ok(cpos.x == w && cpos.y == h, "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w, h, cpos.x, cpos.y);
     r = SetCaretPos(w - 1, h - 1);
-    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
+    ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
     r = GetCaretPos(&cpos);
-    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r);
-    ok(cpos.x == (w - 1) && cpos.y == (h - 1), "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w - 1, h - 1, cpos.x, cpos.y);
+    ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r);
+    ok(cpos.x == (w - 1) && cpos.y == (h - 1), "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w - 1, h - 1, cpos.x, cpos.y);
 
     DestroyWindow(hwndET2);
     DestroyWindow(hwndMain);
@@ -1361,7 +1361,7 @@ static void test_edit_control_5(void)
 
     /* size of non-child edit control is (much) bigger than requested */
     GetWindowRect( hWnd, &rc);
-    ok( rc.right - rc.left > 20, "size of the window (%d) is smaller than expected\n",
+    ok( rc.right - rc.left > 20, "size of the window (%ld) is smaller than expected\n",
             rc.right - rc.left);
     DestroyWindow(hWnd);
     /* so create a parent, and give it edit controls children to test with */
@@ -1413,25 +1413,25 @@ static void test_edit_control_6(void)
     ok(hWnd != NULL, "Failed to create edit control.\n");
 
     ret = SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)str);
-    ok(ret == TRUE, "Expected %d, got %d\n", TRUE, ret);
+    ok(ret == TRUE, "Expected %d, got %ld\n", TRUE, ret);
     ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
-    ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret);
+    ok(ret == strlen(str), "Expected %s, got len %ld\n", str, ret);
     ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
 
     buf[0] = 0;
     ret = SendMessageA(hWnd, WM_DESTROY, 0, 0);
     todo_wine
-    ok(ret == 1, "Unexpected return value %d\n", ret);
+    ok(ret == 1, "Unexpected return value %ld\n", ret);
     ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
-    ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret);
+    ok(ret == strlen(str), "Expected %s, got len %ld\n", str, ret);
     ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
 
     buf[0] = 0;
     ret = SendMessageA(hWnd, WM_NCDESTROY, 0, 0);
-    ok(ret == 0, "Expected 0, got %d\n", ret);
+    ok(ret == 0, "Expected 0, got %ld\n", ret);
     ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf);
 todo_wine {
-    ok(ret == strlen("Test"), "Unexpected text length %d\n", ret);
+    ok(ret == strlen("Test"), "Unexpected text length %ld\n", ret);
     ok(!strcmp(buf, "Test"), "Unexpected text %s\n", buf);
 }
     DestroyWindow(hWnd);
@@ -1446,20 +1446,20 @@ static void test_edit_control_limittext(void)
     trace("EDIT: buffer limit for single-line\n");
     hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
-    ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r);
+    ok(r == 30000, "Incorrect default text limit, expected 30000 got %lu\n", r);
     SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0);
     r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
-    ok( r == 2147483646, "got limit %u (expected 2147483646)\n", r);
+    ok( r == 2147483646, "got limit %lu (expected 2147483646)\n", r);
     DestroyWindow(hwEdit);
 
     /* Test default limit for multi-line control */
     trace("EDIT: buffer limit for multi-line\n");
     hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
     r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
-    ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r);
+    ok(r == 30000, "Incorrect default text limit, expected 30000 got %lu\n", r);
     SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0);
     r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0);
-    ok( r == 4294967295U, "got limit %u (expected 4294967295)\n", r);
+    ok( r == 4294967295U, "got limit %lu (expected 4294967295)\n", r);
     DestroyWindow(hwEdit);
 }
 
@@ -1479,16 +1479,16 @@ static void test_edit_control_scroll(void)
     ok(hwEdit != NULL, "Failed to create Edit control.\n");
 
     ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
-    ok(!ret, "Returned %x, expected 0.\n", ret);
+    ok(!ret, "Returned %lx, expected 0.\n", ret);
 
     ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEUP, 0);
-    ok(!ret, "Returned %x, expected 0.\n", ret);
+    ok(!ret, "Returned %lx, expected 0.\n", ret);
 
     ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEUP, 0);
-    ok(!ret, "Returned %x, expected 0.\n", ret);
+    ok(!ret, "Returned %lx, expected 0.\n", ret);
 
     ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEDOWN, 0);
-    ok(!ret, "Returned %x, expected 0.\n", ret);
+    ok(!ret, "Returned %lx, expected 0.\n", ret);
 
     DestroyWindow (hwEdit);
 
@@ -1500,7 +1500,7 @@ static void test_edit_control_scroll(void)
     ok(hwEdit != NULL, "Failed to create Edit control.\n");
 
     ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0);
-    ok(!ret, "Returned %x, expected 0.\n", ret);
+    ok(!ret, "Returned %lx, expected 0.\n", ret);
 
     DestroyWindow (hwEdit);
 }
@@ -1782,16 +1782,16 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam,
 
             memset(&rect, 0, sizeof(rect));
             SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rect);
-            ok(!rect.right && !rect.bottom, "Invalid size after NCCREATE: %d x %d\n", rect.right, rect.bottom);
+            ok(!rect.right && !rect.bottom, "Invalid size after NCCREATE: %ld x %ld\n", rect.right, rect.bottom);
 
             /* test that messages between WM_NCCREATE and WM_CREATE
                don't crash or cause unexpected behavior */
             r = SendMessageA(hwnd, EM_SETSEL, 0, 0);
-            ok(r == 1, "Returned %ld, expected 1.\n", r);
+            ok(r == 1, "Returned %Id, expected 1.\n", r);
             r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010);
-            todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r);
+            todo_wine ok(r == 1, "Returned %Id, expected 1.\n", r);
             r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1);
-            ok(r == 1, "Returned %ld, expected 1.\n", r);
+            ok(r == 1, "Returned %Id, expected 1.\n", r);
 
             return result;
 
@@ -1799,11 +1799,11 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam,
             /* test that messages between WM_NCCREATE and WM_CREATE
                don't crash or cause unexpected behavior */
             r = SendMessageA(hwnd, EM_SETSEL, 0, 0);
-            ok(r == 1, "Returned %ld, expected 1.\n", r);
+            ok(r == 1, "Returned %Id, expected 1.\n", r);
             r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010);
-            todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r);
+            todo_wine ok(r == 1, "Returned %Id, expected 1.\n", r);
             r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1);
-            ok(r == 1, "Returned %ld, expected 1.\n", r);
+            ok(r == 1, "Returned %Id, expected 1.\n", r);
 
             break;
     }
@@ -2035,7 +2035,7 @@ static void test_margins_font_change(void)
 #define edit_pos_ok(expected, got, txt) edit_pos_ok_(__LINE__, expected, got, #txt)
 static inline void edit_pos_ok_(unsigned line, DWORD expected, DWORD got, const char* txt)
 {
-    ok_(__FILE__, line)(expected == got, "wrong %s expected %d got %d\n", txt, expected, got);
+    ok_(__FILE__, line)(expected == got, "wrong %s expected %ld got %ld\n", txt, expected, got);
 }
 
 #define check_pos(hwEdit, set_height, test_top, test_height, test_left) \
@@ -2188,39 +2188,39 @@ static void test_espassword(void)
 
     hwEdit = create_editcontrol(ES_PASSWORD, 0);
     r = get_edit_style(hwEdit);
-    ok(r == ES_PASSWORD, "Wrong style expected ES_PASSWORD got: 0x%x\n", r);
+    ok(r == ES_PASSWORD, "Wrong style expected ES_PASSWORD got: 0x%lx\n", r);
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) password);
-    ok(r == TRUE, "Expected: %d, got: %d\n", TRUE, r);
+    ok(r == TRUE, "Expected: %d, got: %ld\n", TRUE, r);
 
     /* select all, cut (ctrl-x) */
     SendMessageA(hwEdit, EM_SETSEL, 0, -1);
     r = SendMessageA(hwEdit, WM_CHAR, 24, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
-    ok(r == strlen(password), "Expected: %s, got len %d\n", password, r);
+    ok(r == strlen(password), "Expected: %s, got len %ld\n", password, r);
     ok(strcmp(buffer, password) == 0, "expected %s, got %s\n", password, buffer);
 
     r = OpenClipboard(hwEdit);
-    ok(r == TRUE, "expected %d, got %d\n", TRUE, r);
+    ok(r == TRUE, "expected %d, got %ld\n", TRUE, r);
     r = EmptyClipboard();
-    ok(r == TRUE, "expected %d, got %d\n", TRUE, r);
+    ok(r == TRUE, "expected %d, got %ld\n", TRUE, r);
     r = CloseClipboard();
-    ok(r == TRUE, "expected %d, got %d\n", TRUE, r);
+    ok(r == TRUE, "expected %d, got %ld\n", TRUE, r);
 
     /* select all, copy (ctrl-c) and paste (ctrl-v) */
     SendMessageA(hwEdit, EM_SETSEL, 0, -1);
     r = SendMessageA(hwEdit, WM_CHAR, 3, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     r = SendMessageA(hwEdit, WM_CHAR, 22, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
-    ok(r == 0, "Expected: 0, got: %d\n", r);
+    ok(r == 0, "Expected: 0, got: %ld\n", r);
     ok(strcmp(buffer, "") == 0, "expected empty string, got %s\n", buffer);
 
     DestroyWindow(hwEdit);
@@ -2236,48 +2236,48 @@ static void test_undo(void)
 
     hwEdit = create_editcontrol(0, 0);
     r = get_edit_style(hwEdit);
-    ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
+    ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) text);
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     /* select all, */
     cpMin = cpMax = 0xdeadbeef;
     SendMessageA(hwEdit, EM_SETSEL, 0, -1);
     r = SendMessageA(hwEdit, EM_GETSEL, (WPARAM) &cpMin, (LPARAM) &cpMax);
-    ok((strlen(text) << 16) == r, "Unexpected length %d\n", r);
-    ok(0 == cpMin, "Expected: %d, got %d\n", 0, cpMin);
-    ok(9 == cpMax, "Expected: %d, got %d\n", 9, cpMax);
+    ok((strlen(text) << 16) == r, "Unexpected length %ld\n", r);
+    ok(0 == cpMin, "Expected: %d, got %ld\n", 0, cpMin);
+    ok(9 == cpMax, "Expected: %d, got %ld\n", 9, cpMax);
 
     /* cut (ctrl-x) */
     r = SendMessageA(hwEdit, WM_CHAR, 24, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
-    ok(0 == r, "Expected: %d, got len %d\n", 0, r);
+    ok(0 == r, "Expected: %d, got len %ld\n", 0, r);
     ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
 
     /* undo (ctrl-z) */
     r = SendMessageA(hwEdit, WM_CHAR, 26, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
-    ok(strlen(text) == r, "Unexpected length %d\n", r);
+    ok(strlen(text) == r, "Unexpected length %ld\n", r);
     ok(0 == strcmp(buffer, text), "expected %s, got %s\n", text, buffer);
 
     /* undo again (ctrl-z) */
     r = SendMessageA(hwEdit, WM_CHAR, 26, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
-    ok(r == 0, "Expected: %d, got len %d\n", 0, r);
+    ok(r == 0, "Expected: %d, got len %ld\n", 0, r);
     ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
 
     DestroyWindow(hwEdit);
@@ -2292,19 +2292,19 @@ static void test_enter(void)
     /* multiline */
     hwEdit = create_editcontrol(ES_MULTILINE, 0);
     r = get_edit_style(hwEdit);
-    ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r);
+    ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%lx\n", r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
-    ok(2 == r, "Expected: %d, got len %d\n", 2, r);
+    ok(2 == r, "Expected: %d, got len %ld\n", 2, r);
     ok(0 == strcmp(buffer, "\r\n"), "expected \"\\r\\n\", got \"%s\"\n", buffer);
 
     DestroyWindow (hwEdit);
@@ -2312,19 +2312,19 @@ static void test_enter(void)
     /* single line */
     hwEdit = create_editcontrol(0, 0);
     r = get_edit_style(hwEdit);
-    ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
+    ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
-    ok(0 == r, "Expected: %d, got len %d\n", 0, r);
+    ok(0 == r, "Expected: %d, got len %ld\n", 0, r);
     ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
 
     DestroyWindow(hwEdit);
@@ -2332,19 +2332,19 @@ static void test_enter(void)
     /* single line with ES_WANTRETURN */
     hwEdit = create_editcontrol(ES_WANTRETURN, 0);
     r = get_edit_style(hwEdit);
-    ok(ES_WANTRETURN == r, "Wrong style expected ES_WANTRETURN got: 0x%x\n", r);
+    ok(ES_WANTRETURN == r, "Wrong style expected ES_WANTRETURN got: 0x%lx\n", r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
-    ok(0 == r, "Expected: %d, got len %d\n", 0, r);
+    ok(0 == r, "Expected: %d, got len %ld\n", 0, r);
     ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
 
     DestroyWindow(hwEdit);
@@ -2359,19 +2359,19 @@ static void test_tab(void)
     /* multiline */
     hwEdit = create_editcontrol(ES_MULTILINE, 0);
     r = get_edit_style(hwEdit);
-    ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r);
+    ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%lx\n", r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
-    ok(1 == r, "Expected: %d, got len %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got len %ld\n", 1, r);
     ok(0 == strcmp(buffer, "\t"), "expected \"\\t\", got \"%s\"\n", buffer);
 
     DestroyWindow(hwEdit);
@@ -2379,19 +2379,19 @@ static void test_tab(void)
     /* single line */
     hwEdit = create_editcontrol(0, 0);
     r = get_edit_style(hwEdit);
-    ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r);
+    ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
 
     /* set text */
     r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) "");
-    ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r);
+    ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
 
     r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     /* get text */
     buffer[0] = 0;
     r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer);
-    ok(0 == r, "Expected: %d, got len %d\n", 0, r);
+    ok(0 == r, "Expected: %d, got len %ld\n", 0, r);
     ok(0 == strcmp(buffer, ""), "expected \"\", got \"%s\"\n", buffer);
 
     DestroyWindow(hwEdit);
@@ -2802,11 +2802,11 @@ static void test_fontsize(void)
         ShowWindow (hwEdit, SW_SHOW);
 
     r = SendMessageA(hwEdit, WM_CHAR, 'A', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     r = SendMessageA(hwEdit, WM_CHAR, 'B', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
     r = SendMessageA(hwEdit, WM_CHAR, 'C', 1);
-    ok(1 == r, "Expected: %d, got: %d\n", 1, r);
+    ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
 
     GetWindowTextA(hwEdit, szLocalString, MAXLEN);
     ok(strcmp(szLocalString, "ABC")==0,
@@ -2992,7 +2992,7 @@ static void test_dialogmode(void)
 
     hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
         100, 100, 50, 20, hwParent, (HMENU)ID_EDITTESTDBUTTON, hinst, NULL);
-    ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
+    ok(hwButton!=NULL, "CreateWindow failed with error code %ld\n", GetLastError());
 
     r = SendMessageA(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
     ok(1 == r, "expected 1, got %d\n", r);
@@ -3290,13 +3290,13 @@ static void test_wordbreak_proc(void)
     ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
 
     ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)test_wordbreak_procA);
-    ok(ret == 1, "Unexpected return value %ld.\n", ret);
+    ok(ret == 1, "Unexpected return value %Id.\n", ret);
 
     proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
     ok(proc == test_wordbreak_procA, "Unexpected wordbreak proc %p.\n", proc);
 
     ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, 0);
-    ok(ret == 1, "Unexpected return value %ld.\n", ret);
+    ok(ret == 1, "Unexpected return value %Id.\n", ret);
 
     proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
     ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index 143bc8f84f4..7261da2a5f3 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -59,7 +59,7 @@ static HWND hWndHeader;
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define NUM_MSG_SEQUENCES    2
@@ -397,13 +397,13 @@ static WCHAR pszUniTestW[] = {'T','S','T',0};
 
 #define TEST_GET_ITEM(i,c)\
 {   res = getItem(hWndHeader, i, buffer);\
-    ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%d)\n", i, res);\
+    ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%ld)\n", i, res);\
     ok(strcmp(str_items[c], buffer) == 0, "Getting item[%d] returned \"%s\" expecting \"%s\"\n", i, buffer, str_items[c]);\
 }
 
 #define TEST_GET_ITEMCOUNT(i)\
 {   res = getItemCount(hWndHeader);\
-    ok(res == i, "Got Item Count as %d\n", res);\
+    ok(res == i, "Got Item Count as %ld\n", res);\
 }
 
 static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -734,25 +734,25 @@ static void test_header_control (void)
     {
         TEST_GET_ITEMCOUNT(3-i);
         res = addItem(hWndHeader, 0, str_items[i]);
-        ok(res == 0, "Adding simple item failed (%d)\n", res);
+        ok(res == 0, "Adding simple item failed (%ld)\n", res);
     }
 
     TEST_GET_ITEMCOUNT(4);
     res = addItem(hWndHeader, 99, str_items[i+1]);
-    ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
+    ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res);
     TEST_GET_ITEMCOUNT(5);
     res = addItem(hWndHeader, 5, str_items[i+1]);
-    ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
+    ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res);
     TEST_GET_ITEMCOUNT(6);
 
     for (i = 0; i < 4; i++) { TEST_GET_ITEM(i,i); TEST_GET_ITEMCOUNT(6); }
 
     res=getItem(hWndHeader, 99, buffer);
-    ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
+    ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer);
     res=getItem(hWndHeader, 5, buffer);
-    ok(res == 1, "Getting Out of Range item should fail with 1 (%d), got %s\n", res,buffer);
+    ok(res == 1, "Getting Out of Range item should fail with 1 (%ld), got %s\n", res,buffer);
     res=getItem(hWndHeader, -2, buffer);
-    ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
+    ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer);
 
     if (winetest_interactive)
     {
@@ -762,17 +762,17 @@ static void test_header_control (void)
 
     TEST_GET_ITEMCOUNT(6);
     res=setItem(hWndHeader, 99, str_items[5], FALSE);
-    ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
+    ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res);
     res=setItem(hWndHeader, 5, str_items[5], TRUE);
-    ok(res == 1, "Setting Out of Range item should fail with 1 (%d)\n", res);
+    ok(res == 1, "Setting Out of Range item should fail with 1 (%ld)\n", res);
     res=setItem(hWndHeader, -2, str_items[5], FALSE);
-    ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
+    ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res);
     TEST_GET_ITEMCOUNT(6);
 
     for (i = 0; i < 4; i++)
     {
         res = setItem(hWndHeader, i, str_items[4], TRUE);
-        ok(res != 0, "Setting %d item failed (%d)\n", i+1, res);
+        ok(res != 0, "Setting %d item failed (%ld)\n", i+1, res);
         TEST_GET_ITEM(i, 4);
         TEST_GET_ITEMCOUNT(6);
     }
@@ -800,22 +800,22 @@ static void test_header_control (void)
     TEST_GET_ITEMCOUNT(6);
 
     res = delItem(hWndHeader, 5);
-    ok(res == 1, "Deleting Out of Range item should fail with 1 (%d)\n", res);
+    ok(res == 1, "Deleting Out of Range item should fail with 1 (%ld)\n", res);
     res = delItem(hWndHeader, -2);
-    ok(res == 0, "Deleting Out of Range item should fail with 0 (%d)\n", res);
+    ok(res == 0, "Deleting Out of Range item should fail with 0 (%ld)\n", res);
     TEST_GET_ITEMCOUNT(5);
 
     res = delItem(hWndHeader, 3);
-    ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
+    ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
     TEST_GET_ITEMCOUNT(4);
     res = delItem(hWndHeader, 0);
-    ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
+    ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
     TEST_GET_ITEMCOUNT(3);
     res = delItem(hWndHeader, 0);
-    ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
+    ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
     TEST_GET_ITEMCOUNT(2);
     res = delItem(hWndHeader, 0);
-    ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
+    ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
     TEST_GET_ITEMCOUNT(1);
 
     DestroyWindow(hWndHeader);
@@ -1370,13 +1370,13 @@ static void test_hds_nosizing(HWND hParent)
 }
 
 #define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \
-    ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
+    ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %ld\n", draw_stage, nm->dwDrawStage); \
     if (item_spec != -1) \
-        ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \
-    ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
+        ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %Id\n", item_spec, nm->dwItemSpec); \
+    ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %Id\n", lparam, nm->lItemlParam); \
     ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
         broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \
-        "Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
+        "Invalid rect (%d,%d)-(%d,%ld) vs %s\n", _left, _top, _right, _bottom, \
         wine_dbgstr_rect(&nm->rc));
 
 static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
@@ -1394,7 +1394,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
         return 0;
     }
 
-    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
+    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
     return -1;
 }
 
@@ -1421,7 +1421,7 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
         return 0;
     }
 
-    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
+    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
     return 0;
 }
 
@@ -1451,7 +1451,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
         return 0;
     }
 
-    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
+    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
     return 0;
 }
 
@@ -1479,7 +1479,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
         return 0;
     }
 
-    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
+    ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
     return 0;
 }
 
@@ -1502,7 +1502,7 @@ static void test_customdraw(void)
     hWndHeader = create_header_control();
     GetClientRect(hWndHeader, &rect);
     ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight,
-        "Tests will fail as header size is %dx%d instead of 670x%d\n",
+        "Tests will fail as header size is %ldx%ld instead of 670x%ld\n",
         rect.right - rect.left, rect.bottom - rect.top, g_customheight);
 
     for (i = 0; i < 3; i++)
@@ -1654,10 +1654,10 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
         compare(di->hwndItem,  g_DrawItem.hwndItem, "%p");
         compare(di->itemID,    g_DrawItem.itemID, "%d");
         compare(di->itemState, g_DrawItem.itemState, "%d");
-        compare(di->rcItem.left,   g_DrawItem.rcItem.left, "%d");
-        compare(di->rcItem.top,    g_DrawItem.rcItem.top, "%d");
-        compare(di->rcItem.right,  g_DrawItem.rcItem.right, "%d");
-        compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%d");
+        compare(di->rcItem.left,   g_DrawItem.rcItem.left, "%ld");
+        compare(di->rcItem.top,    g_DrawItem.rcItem.top, "%ld");
+        compare(di->rcItem.right,  g_DrawItem.rcItem.right, "%ld");
+        compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%ld");
         break;
 
     case WM_DESTROY:
@@ -1707,7 +1707,7 @@ static BOOL init(void)
     GetTextMetricsA(hdc, &tm);
     /* 2 dot extra space are needed for the border */
     g_customheight = tm.tmHeight + 2;
-    trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
+    trace("customdraw height: %ld (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
     SelectObject(hdc, hOldFont);
     ReleaseDC(0, hdc);
 
@@ -1736,22 +1736,22 @@ static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected,
         order[i-1] = start>>(4*(count-i)) & 0xf;
 
     ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
-    ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
+    ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);
 
     /* new order */
     for(i = 1; i<=count; i++)
         order[i-1] = set>>(4*(count-i)) & 0xf;
     ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
-    ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
+    ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);
 
     /* check actual order */
     ret = SendMessageA(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order);
-    ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %d\n", ret);
+    ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %ld\n", ret);
     for(i = 1; i<=count; i++)
         array |= order[i-1]<<(4*(count-i));
 
     todo_wine_if(todo)
-        ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array);
+        ok_(__FILE__, line)(array == expected, "Expected %lx, got %lx\n", expected, array);
 }
 
 static void test_hdm_orderarray(void)
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c
index 66a70982e6f..e7e3582ec35 100644
--- a/dlls/comctl32/tests/imagelist.c
+++ b/dlls/comctl32/tests/imagelist.c
@@ -373,7 +373,7 @@ static void test_hotspot(void)
             /* check new hotspot, it should be the same like the old one */
             himlNew = pImageList_GetDragImage(NULL, &ppt);
             ok(ppt.x == dx1 && ppt.y == dy1,
-                    "Expected drag hotspot [%d,%d] got [%d,%d]\n",
+                    "Expected drag hotspot [%d,%d] got [%ld,%ld]\n",
                     dx1, dy1, ppt.x, ppt.y);
             /* check size of new dragged image */
             pImageList_GetIconSize(himlNew, &newx, &newy);
@@ -755,7 +755,7 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER
 
     if (is_v6_test())
     {
-        ok(origin == STREAM_SEEK_CUR, "Unexpected origin %d.\n", origin);
+        ok(origin == STREAM_SEEK_CUR, "Unexpected origin %ld.\n", origin);
         ok(offset.QuadPart == 0, "Unexpected offset %s.\n", wine_dbgstr_longlong(offset.QuadPart));
         ok(new_pos != NULL, "Unexpected out position pointer.\n");
         return IStream_Seek(stream->stream, offset, origin, new_pos);
@@ -844,7 +844,7 @@ static void init_memstream(struct memstream *stream)
 
     stream->IStream_iface.lpVtbl = &Test_Stream_Vtbl;
     hr = CreateStreamOnHGlobal(NULL, TRUE, &stream->stream);
-    ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
 }
 
 static void cleanup_memstream(struct memstream *stream)
@@ -868,19 +868,19 @@ static ULONG check_bitmap_data(const ILHEAD *header, const char *bm_data,
     if (bmih->biBitCount <= 8) hdr_size += (1 << bpp) * sizeof(RGBQUAD);
 
     ok(bmfh->bfType == (('M' << 8) | 'B'), "wrong bfType 0x%02x\n", bmfh->bfType);
-    ok(bmfh->bfSize == hdr_size, "wrong bfSize 0x%02x\n", bmfh->bfSize);
+    ok(bmfh->bfSize == hdr_size, "wrong bfSize 0x%02lx\n", bmfh->bfSize);
     ok(bmfh->bfReserved1 == 0, "wrong bfReserved1 0x%02x\n", bmfh->bfReserved1);
     ok(bmfh->bfReserved2 == 0, "wrong bfReserved2 0x%02x\n", bmfh->bfReserved2);
-    ok(bmfh->bfOffBits == hdr_size, "wrong bfOffBits 0x%02x\n", bmfh->bfOffBits);
+    ok(bmfh->bfOffBits == hdr_size, "wrong bfOffBits 0x%02lx\n", bmfh->bfOffBits);
 
-    ok(bmih->biSize == sizeof(*bmih), "wrong biSize %d\n", bmih->biSize);
+    ok(bmih->biSize == sizeof(*bmih), "wrong biSize %ld\n", bmih->biSize);
     ok(bmih->biPlanes == 1, "wrong biPlanes %d\n", bmih->biPlanes);
     ok(bmih->biBitCount == bpp, "wrong biBitCount %d\n", bmih->biBitCount);
 
     image_size = DIB_GetWidthBytes(bmih->biWidth, bmih->biBitCount) * bmih->biHeight;
-    ok(bmih->biSizeImage == image_size, "wrong biSizeImage %u\n", bmih->biSizeImage);
-    ok(bmih->biWidth == bmpsize->cx && bmih->biHeight == bmpsize->cy, "Unexpected bitmap size %d x %d, "
-            "expected %d x %d\n", bmih->biWidth, bmih->biHeight, bmpsize->cx, bmpsize->cy);
+    ok(bmih->biSizeImage == image_size, "wrong biSizeImage %lu\n", bmih->biSizeImage);
+    ok(bmih->biWidth == bmpsize->cx && bmih->biHeight == bmpsize->cy, "Unexpected bitmap size %ld x %ld, "
+            "expected %ld x %ld\n", bmih->biWidth, bmih->biHeight, bmpsize->cx, bmpsize->cy);
 
 if (0)
 {
@@ -927,7 +927,7 @@ static void check_ilhead_data(const ILHEAD *ilh, INT cx, INT cy, INT cur, INT ma
 
     ok(ilh->cx == cx, "wrong cx %d (expected %d)\n", ilh->cx, cx);
     ok(ilh->cy == cy, "wrong cy %d (expected %d)\n", ilh->cy, cy);
-    ok(ilh->bkcolor == CLR_NONE, "wrong bkcolor %x\n", ilh->bkcolor);
+    ok(ilh->bkcolor == CLR_NONE, "wrong bkcolor %lx\n", ilh->bkcolor);
     ok(ilh->flags == flags || broken(!(ilh->flags & 0xfe) && (flags & 0xfe) == ILC_COLOR4),  /* <= w2k */
        "wrong flags %04x\n", ilh->flags);
     ok(ilh->ovls[0] == -1, "wrong ovls[0] %04x\n", ilh->ovls[0]);
@@ -1014,10 +1014,10 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN
     ok(b, "%s: ImageList_Write failed\n", comment);
 
     hr = GetHGlobalFromStream(stream.stream, &hglobal);
-    ok(hr == S_OK, "%s: Failed to get hglobal, %#x\n", comment, hr);
+    ok(hr == S_OK, "%s: Failed to get hglobal, %#lx\n", comment, hr);
 
     hr = IStream_Stat(stream.stream, &stat, STATFLAG_NONAME);
-    ok(hr == S_OK, "Stat() failed, hr %#x.\n", hr);
+    ok(hr == S_OK, "Stat() failed, hr %#lx.\n", hr);
 
     data = GlobalLock(hglobal);
 
@@ -1031,7 +1031,7 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN
             &bmpsize, flags & 0xfe, comment);
     if (!is_v6_header(header) && size < stat.cbSize.LowPart - sizeof(ILHEAD))  /* mask is present */
     {
-        ok( flags & ILC_MASK, "%s: extra data %u/%u but mask not expected\n", comment, stat.cbSize.LowPart, size );
+        ok( flags & ILC_MASK, "%s: extra data %lu/%u but mask not expected\n", comment, stat.cbSize.LowPart, size );
         check_bitmap_data(header, data + sizeof(ILHEAD) + size, stat.cbSize.LowPart - sizeof(ILHEAD) - size,
             &bmpsize, 1, comment);
     }
@@ -1341,7 +1341,7 @@ static void test_shell_imagelist(void)
 
     /* Get system image list */
     hr = pSHGetImageList(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml);
-    ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%lx\n", hr);
 
     if (hr != S_OK) {
         FreeLibrary(hShell32);
@@ -1358,7 +1358,7 @@ static void test_shell_imagelist(void)
     /* Check icon size matches */
     IImageList_GetImageRect(iml, 0, &rect);
     ok(((rect.right == cx) && (rect.bottom == cy)),
-                 "IImageList_GetImageRect returned r:%d,b:%d\n",
+                 "IImageList_GetImageRect returned r:%ld,b:%ld\n",
                  rect.right, rect.bottom);
 
     IImageList_Release(iml);
@@ -1530,7 +1530,7 @@ static void test_ImageList_DrawIndirect(void)
     ok(himl != 0, "ImageList_Create failed\n");
 
     hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl);
-    ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
+    ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
 
     /* Add a no-alpha image */
     hbmImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_image);
@@ -1540,14 +1540,14 @@ static void test_ImageList_DrawIndirect(void)
     ok(iImage != -1, "ImageList_Add failed\n");
 
     hr = IImageList_GetItemFlags(imgl, 1000, &flags);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IImageList_GetItemFlags(imgl, 1000, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
 
     hr = IImageList_GetItemFlags(imgl, iImage, &flags);
-    ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr);
-    ok(!flags, "Unexpected flags %#x.\n", flags);
+    ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr);
+    ok(!flags, "Unexpected flags %#lx.\n", flags);
 
     /* Add an alpha image */
     hbmAlphaImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_alpha);
@@ -1557,8 +1557,8 @@ static void test_ImageList_DrawIndirect(void)
     ok(iAlphaImage != -1, "ImageList_Add failed\n");
 
     hr = IImageList_GetItemFlags(imgl, iAlphaImage, &flags);
-    ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr);
-    ok(flags & ILIF_ALPHA, "Unexpected flags %#x.\n", flags);
+    ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr);
+    ok(flags & ILIF_ALPHA, "Unexpected flags %#lx.\n", flags);
 
     /* Add a transparent alpha image */
     hbmTransparentImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_transparent);
@@ -1568,8 +1568,8 @@ static void test_ImageList_DrawIndirect(void)
     ok(iTransparentImage != -1, "ImageList_Add failed\n");
 
     hr = IImageList_GetItemFlags(imgl, iTransparentImage, &flags);
-    ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr);
-    ok(flags & ILIF_ALPHA, "Unexpected flags %#x.\n", flags);
+    ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr);
+    ok(flags & ILIF_ALPHA, "Unexpected flags %#lx.\n", flags);
 
     /* 32-bit Tests */
     bitmapInfo.bmiHeader.biBitCount = 32;
@@ -1682,31 +1682,31 @@ static void test_iimagelist(void)
     /* test reference counting on destruction */
     imgl = (IImageList*)createImageList(32, 32);
     ret = IImageList_AddRef(imgl);
-    ok(ret == 2, "Expected 2, got %d\n", ret);
+    ok(ret == 2, "Expected 2, got %ld\n", ret);
     ret = pImageList_Destroy((HIMAGELIST)imgl);
-    ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
+    ok(ret == TRUE, "Expected TRUE, got %ld\n", ret);
     ret = pImageList_Destroy((HIMAGELIST)imgl);
-    ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
+    ok(ret == TRUE, "Expected TRUE, got %ld\n", ret);
     ret = pImageList_Destroy((HIMAGELIST)imgl);
-    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(ret == FALSE, "Expected FALSE, got %ld\n", ret);
 
     imgl = (IImageList*)createImageList(32, 32);
     ret = IImageList_AddRef(imgl);
-    ok(ret == 2, "Expected 2, got %d\n", ret);
+    ok(ret == 2, "Expected 2, got %ld\n", ret);
     ret = pImageList_Destroy((HIMAGELIST)imgl);
-    ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
+    ok(ret == TRUE, "Expected TRUE, got %ld\n", ret);
     ret = IImageList_Release(imgl);
-    ok(ret == 0, "Expected 0, got %d\n", ret);
+    ok(ret == 0, "Expected 0, got %ld\n", ret);
     ret = pImageList_Destroy((HIMAGELIST)imgl);
-    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+    ok(ret == FALSE, "Expected FALSE, got %ld\n", ret);
 
     /* ref counting, HIMAGELIST_QueryInterface adds a reference */
     imgl = (IImageList*)createImageList(32, 32);
     hr = pHIMAGELIST_QueryInterface((HIMAGELIST)imgl, &IID_IImageList, (void**)&imgl2);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(imgl2 == imgl, "got different pointer\n");
     ret = IImageList_Release(imgl);
-    ok(ret == 1, "got %u\n", ret);
+    ok(ret == 1, "got %lu\n", ret);
     IImageList_Release(imgl);
 
     if (!pImageList_CoCreateInstance)
@@ -1716,7 +1716,7 @@ static void test_iimagelist(void)
     }
 
     hr = pImageList_CoCreateInstance(&CLSID_ImageList, NULL, &IID_IImageList, (void **) &imgl);
-    ok(SUCCEEDED(hr), "ImageList_CoCreateInstance failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "ImageList_CoCreateInstance failed, hr=%lx\n", hr);
 
     if (hr == S_OK)
         IImageList_Release(imgl);
@@ -1727,7 +1727,7 @@ static void test_iimagelist(void)
         return;
 
     hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl);
-    ok(SUCCEEDED(hr), "HIMAGELIST_QueryInterface failed, hr=%x\n", hr);
+    ok(SUCCEEDED(hr), "HIMAGELIST_QueryInterface failed, hr=%lx\n", hr);
 
     if (hr == S_OK)
         IImageList_Release(imgl);
@@ -1741,7 +1741,7 @@ static void test_iimagelist(void)
         win_skip("IImageList2 is not supported.\n");
         return;
     }
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     IImageList2_Release(imagelist);
 }
 
@@ -1773,7 +1773,7 @@ static void test_IImageList_Add_Remove(void)
 
     /* remove when nothing exists */
     hr = IImageList_Remove(imgl, 0);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     /* removing everything from an empty imagelist should succeed */
     hr = IImageList_Remove(imgl, -1);
@@ -1788,7 +1788,7 @@ static void test_IImageList_Add_Remove(void)
     ok( IImageList_ReplaceIcon(imgl, -1, hicon3, &ret) == S_OK && (ret == 2),"failed to add icon3\n");
 
     /* remove an index out of range */
-    ok( IImageList_Remove(imgl, 4711) == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok( IImageList_Remove(imgl, 4711) == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     /* remove three */
     ok( IImageList_Remove(imgl,0) == S_OK, "can't remove 0\n");
@@ -1796,7 +1796,7 @@ static void test_IImageList_Add_Remove(void)
     ok( IImageList_Remove(imgl,0) == S_OK, "can't remove 0\n");
 
     /* remove one extra */
-    ok( IImageList_Remove(imgl, 0) == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok( IImageList_Remove(imgl, 0) == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     IImageList_Release(imgl);
     ok(DestroyIcon(hicon1),"icon 1 wasn't deleted\n");
@@ -1819,17 +1819,17 @@ static void test_IImageList_Get_SetImageCount(void)
 
     /* check SetImageCount/GetImageCount */
     hr = IImageList_SetImageCount(imgl, 3);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ret = 0;
     hr = IImageList_GetImageCount(imgl, &ret);
     ok(hr == S_OK && ret == 3, "invalid image count after increase\n");
     hr = IImageList_SetImageCount(imgl, 1);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ret = 0;
     hr = IImageList_GetImageCount(imgl, &ret);
     ok(hr == S_OK && ret == 1, "invalid image count after decrease to 1\n");
     hr = IImageList_SetImageCount(imgl, 0);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ret = -1;
     hr = IImageList_GetImageCount(imgl, &ret);
     ok(hr == S_OK && ret == 0, "invalid image count after decrease to 0\n");
@@ -1887,7 +1887,7 @@ if (0)
 
     memset(&imldp, 0, sizeof (imldp));
     hr = IImageList_Draw(imgl, &imldp);
-    ok( hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok( hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     imldp.cbSize = IMAGELISTDRAWPARAMS_V3_SIZE;
     imldp.hdcDst = hdc;
@@ -2334,14 +2334,14 @@ static void test_loadimage(void)
                                  IMAGE_BITMAP, LR_CREATEDIBSECTION );
     ok( list != NULL, "got %p\n", list );
     flags = pImageList_GetFlags( list );
-    ok( flags == (ILC_COLOR4 | ILC_MASK), "got %08x\n", flags );
+    ok( flags == (ILC_COLOR4 | ILC_MASK), "got %08lx\n", flags );
     pImageList_Destroy( list );
 
     list = pImageList_LoadImageW( hinst, MAKEINTRESOURCEW(IDB_BITMAP_128x15), 16, 1, CLR_NONE,
                                  IMAGE_BITMAP, LR_CREATEDIBSECTION );
     ok( list != NULL, "got %p\n", list );
     flags = pImageList_GetFlags( list );
-    ok( flags == ILC_COLOR4, "got %08x\n", flags );
+    ok( flags == ILC_COLOR4, "got %08lx\n", flags );
     pImageList_Destroy( list );
 }
 
@@ -2470,9 +2470,9 @@ if (0)
 }
 
     hr = IImageList_Clone(imgl, &IID_IImageList, (void**)&imgl2);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ref = IImageList_Release(imgl2);
-    ok(ref == 0, "got %u\n", ref);
+    ok(ref == 0, "got %lu\n", ref);
 
     IImageList_Release(imgl);
 }
@@ -2494,7 +2494,7 @@ if (0)
 }
 
     hr = IImageList_GetBkColor(imgl, &color);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     IImageList_Release(imgl);
 }
@@ -2516,15 +2516,15 @@ if (0)
 }
 
     hr = IImageList_SetBkColor(imgl, CLR_NONE, &color);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     hr = IImageList_SetBkColor(imgl, CLR_NONE, &color);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
 
     color = 0xdeadbeef;
     hr = IImageList_GetBkColor(imgl, &color);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
-    ok(color == CLR_NONE, "got %x\n", color);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
+    ok(color == CLR_NONE, "got %lx\n", color);
 
     IImageList_Release(imgl);
 }
@@ -2547,7 +2547,7 @@ if (0)
 
     count = -1;
     hr = IImageList_GetImageCount(imgl, &count);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(hr == S_OK, "got 0x%08lx\n", hr);
     ok(count == 0, "got %d\n", count);
 
     IImageList_Release(imgl);
@@ -2564,13 +2564,13 @@ static void test_IImageList_GetIconSize(void)
     imgl = (IImageList*)himl;
 
     hr = IImageList_GetIconSize(imgl, NULL, NULL);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     hr = IImageList_GetIconSize(imgl, &cx, NULL);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     hr = IImageList_GetIconSize(imgl, NULL, &cy);
-    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
 
     IImageList_Release(imgl);
 }
@@ -2585,13 +2585,13 @@ static void test_ImageList_WriteEx(void)
     ok(himl != 0, "Failed to create an imagelist.\n");
 
     hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 
     hr = pImageList_WriteEx(himl, ILP_NORMAL, stream);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 
     hr = pImageList_WriteEx(himl, ILP_DOWNLEVEL, stream);
-    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 
     IStream_Release(stream);
     pImageList_Destroy(himl);
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index d5c782159ce..cb311b1fc77 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -195,7 +195,7 @@ static void keypress(HWND handle, WPARAM keycode, BYTE scancode, BOOL extended)
 }
 
 #define listbox_field_ok(t, s, f, got) \
-  ok (t.s.f==got.f, "style %#x, step " #s ", field " #f \
+  ok (t.s.f==got.f, "style %#lx, step " #s ", field " #f \
       ": expected %d, got %d\n", style, t.s.f, got.f)
 
 #define listbox_todo_field_ok(t, s, f, got) \
@@ -307,20 +307,20 @@ static void test_item_height(void)
     ok (SendMessageA(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n");
 
     itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0);
-    ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %d\n", itemHeight, tm.tmHeight);
+    ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %ld\n", itemHeight, tm.tmHeight);
 
     DestroyWindow (hLB);
 
     hLB = CreateWindowA(WC_LISTBOXA, "TestList", LBS_OWNERDRAWVARIABLE,  0, 0, 100, 100, NULL, NULL, NULL, 0);
 
     itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0);
-    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n",
+    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n",
         itemHeight, tm.tmHeight);
     itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 5, 0);
-    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n",
+    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n",
         itemHeight, tm.tmHeight);
     itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, -5, 0);
-    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n",
+    ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n",
         itemHeight, tm.tmHeight);
 
     DestroyWindow (hLB);
@@ -367,7 +367,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
             m.lParam = mis->itemData ? hash_Ly((const char *)mis->itemData) : 0;
         add_message(sequences, PARENT_SEQ_INDEX, &m);
 
-        ok(wParam == mis->CtlID, "got wParam=%08lx, expected %08x\n", wParam, mis->CtlID);
+        ok(wParam == mis->CtlID, "got wParam=%08Ix, expected %08x\n", wParam, mis->CtlID);
         ok(mis->CtlType == ODT_LISTBOX, "mi->CtlType = %u\n", mis->CtlType);
         ok(mis->CtlID == 1, "mi->CtlID = %u\n", mis->CtlID);
         ok(mis->itemHeight, "mi->itemHeight = 0\n");
@@ -380,7 +380,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
         HWND ctrl = GetDlgItem(hwnd, cis->CtlID);
         BOOL is_unicode_data = TRUE;
 
-        ok(wParam == cis->CtlID, "expected %#x, got %#lx\n", cis->CtlID, wParam);
+        ok(wParam == cis->CtlID, "expected %#x, got %#Ix\n", cis->CtlID, wParam);
         ok(cis->hwndItem == ctrl, "expected %p, got %p\n", ctrl, cis->hwndItem);
         ok((int)cis->itemID1 >= 0, "expected >= 0, got %d\n", cis->itemID1);
         ok((int)cis->itemID2 == -1, "expected -1, got %d\n", cis->itemID2);
@@ -406,7 +406,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
         RECT rc_item, rc_client, rc_clip;
         DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
 
-        ok(wParam == dis->CtlID, "got wParam=%08lx instead of %08x\n", wParam, dis->CtlID);
+        ok(wParam == dis->CtlID, "got wParam=%08Ix instead of %08x\n", wParam, dis->CtlID);
         ok(dis->CtlType == ODT_LISTBOX, "wrong CtlType %04x\n", dis->CtlType);
 
         GetClientRect(dis->hwndItem, &rc_client);
@@ -508,14 +508,14 @@ static void test_ownerdraw(void)
 
         SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
         ok(!IsRectEmpty(&rc), "empty item rect\n");
-        ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top);
+        ok(rc.top < 0, "rc.top is not negative (%ld)\n", rc.top);
 
         DestroyWindow(hLB);
 
         /* Both FIXED and VARIABLE, FIXED should override VARIABLE. */
         hLB = CreateWindowA(WC_LISTBOXA, "TestList", LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE | styles[i],
             0, 0, 100, 100, NULL, NULL, NULL, 0);
-        ok(hLB != NULL, "last error 0x%08x\n", GetLastError());
+        ok(hLB != NULL, "last error 0x%08lx\n", GetLastError());
 
         ok(GetWindowLongA(hLB, GWL_STYLE) & LBS_OWNERDRAWVARIABLE, "Unexpected window style.\n");
 
@@ -915,70 +915,70 @@ static void test_changing_selection_styles(void)
             for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++)
             {
                 ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)"x");
-                ok(ret == k, "%u: Unexpected return value %d, expected %d.\n", j, ret, k);
+                ok(ret == k, "%u: Unexpected return value %ld, expected %d.\n", j, ret, k);
             }
             ret = SendMessageA(listbox, LB_GETCOUNT, 0, 0);
-            ok(ret == ARRAY_SIZE(selexpect_multi), "%u: Unexpected count %d.\n", j, ret);
+            ok(ret == ARRAY_SIZE(selexpect_multi), "%u: Unexpected count %ld.\n", j, ret);
 
             /* Select items with different methods */
             ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0);
-            ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == setcursel_expect, "%u: Unexpected return value %ld.\n", j, ret);
             ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 0));
-            ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
             ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 2));
-            ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
 
             /* Verify that the proper items are selected */
             for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++)
             {
                 ret = SendMessageA(listbox, LB_GETSEL, k, 0);
-                ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n",
+                ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n",
                     j, ret, selexpect[k]);
             }
 
             /* Now change the selection style */
             style = GetWindowLongA(listbox, GWL_STYLE);
             ok((style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == selstyles[j],
-                "%u: unexpected window styles %#x.\n", j, style);
+                "%u: unexpected window styles %#lx.\n", j, style);
             if (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))
                 style &= ~selstyles[j];
             else
                 style |= LBS_MULTIPLESEL | LBS_EXTENDEDSEL;
             SetWindowLongA(listbox, GWL_STYLE, style);
             style = GetWindowLongA(listbox, GWL_STYLE);
-            ok(!(style & selstyles[j]), "%u: unexpected window styles %#x.\n", j, style);
+            ok(!(style & selstyles[j]), "%u: unexpected window styles %#lx.\n", j, style);
 
             /* Verify that the same items are selected */
             ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0);
-            ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n",
+            ok(ret == getselcount_expect, "%u: expected %ld from LB_GETSELCOUNT, got %ld\n",
                 j, getselcount_expect, ret);
 
             for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++)
             {
                 ret = SendMessageA(listbox, LB_GETSEL, k, 0);
-                ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n",
+                ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n",
                     j, ret, selexpect[k]);
             }
 
             /* Lastly see if we can still change the selection as before with old style */
             if (setcursel_expect != LB_ERR) setcursel_expect = 0;
             ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0);
-            ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == setcursel_expect, "%u: Unexpected return value %ld.\n", j, ret);
             ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 1));
-            ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
             ret = SendMessageA(listbox, LB_SELITEMRANGE, FALSE, MAKELPARAM(2, 2));
-            ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret);
+            ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
 
             /* And verify the selections */
             selexpect = (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) ? selexpect_multi2 : selexpect_single2;
             ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0);
-            ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n",
+            ok(ret == getselcount_expect, "%u: expected %ld from LB_GETSELCOUNT, got %ld\n",
                 j, getselcount_expect, ret);
 
             for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++)
             {
                 ret = SendMessageA(listbox, LB_GETSEL, k, 0);
-                ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n",
+                ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n",
                     j, ret, selexpect[k]);
             }
 
@@ -1001,13 +1001,13 @@ static void test_itemfrompoint(void)
     RECT rc;
 
     r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
-    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r );
+    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
 
     r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 ));
-    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r );
+    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
 
     r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 ));
-    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r );
+    ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
 
     id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi");
     ok( id == 0, "item id wrong\n");
@@ -1015,16 +1015,16 @@ static void test_itemfrompoint(void)
     ok( id == 1, "item id wrong\n");
 
     r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 ));
-    ok( r == 0x1, "ret %x\n", r );
+    ok( r == 0x1, "ret %lx\n", r );
 
     r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 ));
-    ok( r == MAKELPARAM(1, 1), "Unexpected ret value %#x.\n", r );
+    ok( r == MAKELPARAM(1, 1), "Unexpected ret value %#lx.\n", r );
 
     /* Resize control so that below assertions about sizes are valid */
     r = SendMessageA( hList, LB_GETITEMRECT, 0, (LPARAM)&rc);
-    ok( r == 1, "ret %x\n", r);
+    ok( r == 1, "ret %lx\n", r);
     r = MoveWindow(hList, 1, 1, 600, (rc.bottom - rc.top + 1) * 9 / 2, TRUE);
-    ok( r != 0, "ret %x\n", r);
+    ok( r != 0, "ret %lx\n", r);
 
     id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi2");
     ok( id == 2, "item id wrong\n");
@@ -1044,27 +1044,27 @@ static void test_itemfrompoint(void)
 
     SendMessageA( hList, LB_SETTOPINDEX, 1, 0);
     r = SendMessageA( hList, LB_GETTOPINDEX, 0, 0);
-    ok( r == 1, "top %d\n", r);
+    ok( r == 1, "top %ld\n", r);
 
     r = SendMessageA( hList, LB_GETITEMRECT, 5, (LPARAM)&rc);
-    ok( r == 1, "ret %x\n", r);
+    ok( r == 1, "ret %lx\n", r);
     r = SendMessageA( hList, LB_GETITEMRECT, 6, (LPARAM)&rc);
-    ok( r == 0, "ret %x\n", r);
+    ok( r == 0, "ret %lx\n", r);
 
     r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) );
-    ok( r == 1, "ret %x\n", r);
+    ok( r == 1, "ret %lx\n", r);
 
     r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) );
-    ok( r == 0x10001, "ret %x\n", r );
+    ok( r == 0x10001, "ret %lx\n", r );
 
     r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) );
-    ok( r == 0x10001, "ret %x\n", r );
+    ok( r == 0x10001, "ret %lx\n", r );
 
     r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) );
-    ok( r == 0x10005, "item %x\n", r );
+    ok( r == 0x10005, "item %lx\n", r );
 
     r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) );
-    ok( r == 0x10005, "item %x\n", r );
+    ok( r == 0x10005, "item %lx\n", r );
 
     DestroyWindow( hList );
 }
@@ -1117,7 +1117,7 @@ static void test_listbox_LB_DIR(void)
     ok(ret, "Failed to create test directory.\n");
 
     file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );
-    ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %d\n", GetLastError());
+    ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %ld\n", GetLastError());
     CloseHandle( file );
 
     /* NOTE: for this test to succeed, there must be no subdirectories
@@ -1141,7 +1141,7 @@ static void test_listbox_LB_DIR(void)
         strcpy(pathBuffer, wildcard);
         res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
     }
-    ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08x\n", GetLastError());
+    ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox */
     itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
@@ -1168,7 +1168,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, "w*.c");
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer);
-    ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08x\n", GetLastError());
+    ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08lx\n", GetLastError());
 
     /* Path specification does NOT converted to uppercase */
     ok (!strcmp(pathBuffer, "w*.c"),
@@ -1197,7 +1197,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox.
      * All files plus "[..]"
@@ -1225,7 +1225,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, "w*.c");
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer);
-    ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08x\n", GetLastError());
+    ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. Since the parent directory does not
      * fit w*.c, there should be exactly the same number of items as without DDL_DIRECTORY
@@ -1254,7 +1254,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
-    ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *)  failed - 0x%08x\n", GetLastError());
+    ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *)  failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be at least one element before, since the string "[-c-]" should
@@ -1299,7 +1299,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *)  failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *)  failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be at least one element before, since the string "[-c-]" should
@@ -1326,7 +1326,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, "w*.c");
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c)  failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c)  failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be at least one element before, since the string "[-c-]" should
@@ -1364,7 +1364,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be exactly the number of plain files, plus the number of mapped drives.
@@ -1402,7 +1402,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, "w*.c");
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be exactly the number of plain files, plus the number of mapped drives.
@@ -1436,7 +1436,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
-    ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %u\n",
+    ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %lu\n",
         GetLastError());
 
     itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
@@ -1479,7 +1479,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, wildcard);
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
-    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError());
+    ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08lx\n", GetLastError());
 
     /* There should be no plain files on the listbox */
     itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
@@ -1514,7 +1514,7 @@ static void test_listbox_LB_DIR(void)
     strcpy(pathBuffer, "w*.c");
     SendMessageA(hList, LB_RESETCONTENT, 0, 0);
     res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer);
-    ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError());
+    ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08lx\n", GetLastError());
 
     /* There should be no plain files on the listbox, and no [..], since it does not fit w*.c */
     itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0);
@@ -1615,7 +1615,7 @@ static void test_listbox_dlgdir(void)
     BOOL ret;
 
     file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );
-    ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %d\n", GetLastError());
+    ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %ld\n", GetLastError());
     CloseHandle( file );
 
     /* NOTE: for this test to succeed, there must be no subdirectories
@@ -1644,7 +1644,7 @@ static void test_listbox_dlgdir(void)
      */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0);
-    ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08x\n", res, GetLastError());
+    ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08lx\n", res, GetLastError());
 
     /* Path specification gets converted to uppercase */
     ok (!strcmp(pathBuffer, "W*.C"),
@@ -1681,7 +1681,7 @@ static void test_listbox_dlgdir(void)
     /* Test DDL_DIRECTORY */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY);
-    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08x\n", GetLastError());
+    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be exactly more elements than before, since the directories should
@@ -1725,7 +1725,7 @@ static void test_listbox_dlgdir(void)
     /* Test DDL_DRIVES. At least on WinXP-SP2, this implies DDL_EXCLUSIVE */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DRIVES);
-    ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08x\n", GetLastError());
+    ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be at least one element before, since the string "[-c-]" should
@@ -1765,7 +1765,7 @@ static void test_listbox_dlgdir(void)
     /* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES);
-    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError());
+    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
 
     /* There should be some content in the listbox. In particular, there should
      * be exactly the number of plain files, plus the number of mapped drives,
@@ -1808,7 +1808,7 @@ static void test_listbox_dlgdir(void)
     /* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_EXCLUSIVE);
-    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError());
+    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08lx\n", GetLastError());
 
     /* There should be exactly one element: "[..]" */
     itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
@@ -1834,7 +1834,7 @@ static void test_listbox_dlgdir(void)
     /* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */
     strcpy(pathBuffer, "w*.c");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE);
-    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError());
+    ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08lx\n", GetLastError());
 
     /* There should be no plain files on the listbox */
     itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0);
@@ -1866,14 +1866,14 @@ static void test_listbox_dlgdir(void)
     /* Fill with everything - drives, directory and all plain files. */
     strcpy(pathBuffer, "*");
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES);
-    ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError());
+    ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
 
     SendMessageA(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */
     memset(pathBuffer, 0, MAX_PATH);
     SetLastError(0xdeadbeef);
     res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
     ok (GetLastError() == 0xdeadbeef,
-        "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08x\n",
+        "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08lx\n",
         GetLastError());
     ok (res == 0, "DlgDirSelectEx() with no selection returned %d, expected 0\n", res);
     /* WinXP-SP2 leaves pathBuffer untouched, but Win98 fills it with garbage. */
@@ -1897,7 +1897,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -1911,7 +1911,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -1930,7 +1930,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 0, "DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -1966,7 +1966,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -1980,7 +1980,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -1999,7 +1999,7 @@ static void test_listbox_dlgdir(void)
             SetLastError(0xdeadbeef);
             res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX);
             ok (GetLastError() == 0xdeadbeef,
-               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n",
+               "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n",
                 i, GetLastError());
             ok(res == 0, "DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer, pathBuffer);
 
@@ -2029,7 +2029,7 @@ static void test_listbox_dlgdir(void)
     res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE);
     ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res);
     ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS,
-       "GetLastError should return 0x589, got 0x%X\n",GetLastError());
+       "GetLastError should return 0x589, got 0x%lX\n",GetLastError());
 
     DestroyWindow(hWnd);
 }
@@ -2054,9 +2054,9 @@ static void test_set_count( void )
     ok( IsRectEmpty( &r ), "got non-empty rect\n");
 
     ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 );
-    ok( ret == 0, "got %d\n", ret );
+    ok( ret == 0, "got %ld\n", ret );
     ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 );
-    ok( ret == 100, "got %d\n", ret );
+    ok( ret == 100, "got %ld\n", ret );
 
     GetUpdateRect( listbox, &r, TRUE );
     ok( !IsRectEmpty( &r ), "got empty rect\n");
@@ -2066,15 +2066,15 @@ static void test_set_count( void )
     ok( IsRectEmpty( &r ), "got non-empty rect\n");
 
     ret = SendMessageA( listbox, LB_SETCOUNT, 99, 0 );
-    ok( ret == 0, "got %d\n", ret );
+    ok( ret == 0, "got %ld\n", ret );
 
     GetUpdateRect( listbox, &r, TRUE );
     ok( !IsRectEmpty( &r ), "got empty rect\n");
 
     ret = SendMessageA( listbox, LB_SETCOUNT, -5, 0 );
-    ok( ret == 0, "got %d\n", ret );
+    ok( ret == 0, "got %ld\n", ret );
     ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 );
-    ok( ret == -5, "got %d\n", ret );
+    ok( ret == -5, "got %ld\n", ret );
 
     DestroyWindow( listbox );
 
@@ -2084,8 +2084,8 @@ static void test_set_count( void )
 
         SetLastError( 0xdeadbeef );
         ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 );
-        ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret );
-        ok( GetLastError() == 0xdeadbeef, "Unexpected error %d.\n", GetLastError() );
+        ok( ret == LB_ERR, "expected %d, got %ld\n", LB_ERR, ret );
+        ok( GetLastError() == 0xdeadbeef, "Unexpected error %ld.\n", GetLastError() );
 
         DestroyWindow( listbox );
     }
@@ -2108,7 +2108,7 @@ static void test_GetListBoxInfo(void)
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     ret = GetListBoxInfo(listbox);
-    ok(ret > 0, "got %d\n", ret);
+    ok(ret > 0, "got %ld\n", ret);
     ok_sequence(sequences, LB_SEQ_INDEX, getlistboxinfo_seq, "GetListBoxInfo()", FALSE);
 
     DestroyWindow(listbox);
@@ -2133,45 +2133,45 @@ static void test_init_storage( void )
                                 0, 0, 100, 100, parent, (HMENU)ID_LISTBOX, NULL, 0);
 
         items_size = SendMessageA(listbox, LB_INITSTORAGE, 100, 0);
-        ok(items_size >= 100, "expected at least 100, got %d\n", items_size);
+        ok(items_size >= 100, "expected at least 100, got %ld\n", items_size);
 
         ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0);
-        ok(ret == items_size, "expected %d, got %d\n", items_size, ret);
+        ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
 
         /* it doesn't grow since the space was already reserved */
         ret = SendMessageA(listbox, LB_INITSTORAGE, items_size, 0);
-        ok(ret == items_size, "expected %d, got %d\n", items_size, ret);
+        ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
 
         /* it doesn't shrink the reserved space */
         ret = SendMessageA(listbox, LB_INITSTORAGE, 42, 0);
-        ok(ret == items_size, "expected %d, got %d\n", items_size, ret);
+        ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
 
         /* now populate almost all of it so it's not reserved anymore */
         if (styles[i] & LBS_NODATA)
         {
             ret = SendMessageA(listbox, LB_SETCOUNT, items_size - 1, 0);
-            ok(ret == 0, "unexpected return value %d\n", ret);
+            ok(ret == 0, "unexpected return value %ld\n", ret);
         }
         else
         {
             for (j = 0; j < items_size - 1; j++)
             {
                 ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)"");
-                ok(ret == j, "expected %d, got %d\n", j, ret);
+                ok(ret == j, "expected %d, got %ld\n", j, ret);
             }
         }
 
         /* we still have one more reserved slot, so it doesn't grow yet */
         ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0);
-        ok(ret == items_size, "expected %d, got %d\n", items_size, ret);
+        ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
 
         /* fill the slot and check again, it should grow this time */
         ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)"");
-        ok(ret == items_size - 1, "expected %d, got %d\n", items_size - 1, ret);
+        ok(ret == items_size - 1, "expected %ld, got %ld\n", items_size - 1, ret);
         ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0);
-        ok(ret == items_size, "expected %d, got %d\n", items_size, ret);
+        ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
         ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0);
-        ok(ret > items_size, "expected it to grow past %d, got %d\n", items_size, ret);
+        ok(ret > items_size, "expected it to grow past %ld, got %ld\n", items_size, ret);
 
         DestroyWindow(listbox);
     }
@@ -2213,7 +2213,7 @@ static void test_extents(void)
     listbox = create_listbox(WS_CHILD | WS_VISIBLE, parent);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 0, "Got wrong initial horizontal extent: %u\n", res);
+    ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2228,7 +2228,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 64, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2243,7 +2243,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 184, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2259,7 +2259,7 @@ static void test_extents(void)
     listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL, parent);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 0, "Got wrong initial horizontal extent: %u\n", res);
+    ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2274,7 +2274,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 64, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2289,7 +2289,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 184, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2303,7 +2303,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 0, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 0, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2320,7 +2320,7 @@ static void test_extents(void)
     listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL | LBS_DISABLENOSCROLL, parent);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 0, "Got wrong initial horizontal extent: %u\n", res);
+    ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2335,7 +2335,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 64, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2350,7 +2350,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 184, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2364,7 +2364,7 @@ static void test_extents(void)
     SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0);
 
     res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0);
-    ok(res == 0, "Got wrong horizontal extent: %u\n", res);
+    ok(res == 0, "Got wrong horizontal extent: %lu\n", res);
 
     sinfo.cbSize = sizeof(sinfo);
     sinfo.fMask = SIF_RANGE;
@@ -2484,14 +2484,14 @@ static void test_WM_MEASUREITEM(void)
     listbox = create_listbox(WS_CHILD | LBS_OWNERDRAWVARIABLE, parent);
 
     data = SendMessageA(listbox, LB_GETITEMDATA, 0, 0);
-    ok(data == (LRESULT)strings[0], "data = %08lx, expected %p\n", data, strings[0]);
+    ok(data == (LRESULT)strings[0], "data = %08Ix, expected %p\n", data, strings[0]);
     DestroyWindow(parent);
 
     parent = create_parent();
     listbox = create_listbox(WS_CHILD | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS, parent);
 
     data = SendMessageA(listbox, LB_GETITEMDATA, 0, 0);
-    ok(!data, "data = %08lx\n", data);
+    ok(!data, "data = %08Ix\n", data);
 
     /* LBS_HASSTRINGS */
     parent = create_parent();
@@ -2502,11 +2502,11 @@ static void test_WM_MEASUREITEM(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
-    ok(ret == 0, "expected 0, got %ld\n", ret);
+    ok(ret == 0, "expected 0, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
-    ok(ret == 1, "expected 1, got %ld\n", ret);
+    ok(ret == 1, "expected 1, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
-    ok(ret == 2, "expected 2, got %ld\n", ret);
+    ok(ret == 2, "expected 2, got %Id\n", ret);
 
     ok_sequence(sequences, PARENT_SEQ_INDEX, lb_addstring_ownerdraw_parent_seq,
         "LB_ADDSTRING (LBS_HASSTRINGS, ownerdraw)", FALSE);
@@ -2520,11 +2520,11 @@ static void test_WM_MEASUREITEM(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
-    ok(ret == 0, "expected 0, got %ld\n", ret);
+    ok(ret == 0, "expected 0, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
-    ok(ret == 1, "expected 1, got %ld\n", ret);
+    ok(ret == 1, "expected 1, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
-    ok(ret == 2, "expected 2, got %ld\n", ret);
+    ok(ret == 2, "expected 2, got %Id\n", ret);
 
     ok_sequence(sequences, PARENT_SEQ_INDEX, lb_addstring_sort_parent_seq, "LB_ADDSTRING (LBS_SORT)", FALSE);
     DestroyWindow(listbox);
@@ -2537,11 +2537,11 @@ static void test_WM_MEASUREITEM(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
-    ok(ret == 0, "expected 0, got %ld\n", ret);
+    ok(ret == 0, "expected 0, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
-    ok(ret == 1, "expected 1, got %ld\n", ret);
+    ok(ret == 1, "expected 1, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
-    ok(ret == 2, "expected 2, got %ld\n", ret);
+    ok(ret == 2, "expected 2, got %Id\n", ret);
 
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "LB_ADDSTRING (LBS_HASSTRINGS)", FALSE);
     DestroyWindow(listbox);
@@ -2554,11 +2554,11 @@ static void test_WM_MEASUREITEM(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
-    ok(ret == 0, "expected 0, got %ld\n", ret);
+    ok(ret == 0, "expected 0, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
-    ok(ret == 0, "expected 0, got %ld\n", ret);
+    ok(ret == 0, "expected 0, got %Id\n", ret);
     ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
-    ok(ret == 1, "expected 1, got %ld\n", ret);
+    ok(ret == 1, "expected 1, got %Id\n", ret);
 
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "LB_ADDSTRING (LBS_HASSTRINGS, LBS_SORT)", FALSE);
     DestroyWindow(listbox);
@@ -2667,7 +2667,7 @@ static void test_LBS_NODATA(void)
         ok(listbox != NULL, "Failed to create a listbox.\n");
 
         style = GetWindowLongA(listbox, GWL_STYLE);
-        ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style);
+        ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#lx.\n", i, style);
         ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0);
         ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret);
         DestroyWindow(listbox);
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index e922d14d850..0b5b37f69fd 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -49,14 +49,14 @@ enum seq_index {
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define expect2(expected1, expected2, got1, got2) expect2_(__LINE__, expected1, expected2, got1, got2)
 static inline void expect2_(unsigned line, DWORD expected1, DWORD got1, DWORD expected2, DWORD got2)
 {
     ok_(__FILE__, line)(expected1 == got1 && expected2 == got2,
-                        "expected (%d,%d), got (%d,%d)\n",
+                        "expected (%ld,%ld), got (%ld,%ld)\n",
                         expected1, expected2, got1, got2);
 }
 
@@ -702,7 +702,7 @@ static HWND create_listview_control(DWORD style)
                            WS_CHILD | WS_BORDER | WS_VISIBLE | style,
                            0, 0, rect.right, rect.bottom,
                            hwndparent, NULL, GetModuleHandleA(NULL), NULL);
-    ok(hwnd != NULL, "gle=%d\n", GetLastError());
+    ok(hwnd != NULL, "gle=%ld\n", GetLastError());
 
     if (!hwnd) return NULL;
 
@@ -725,7 +725,7 @@ static HWND create_listview_controlW(DWORD style, HWND parent)
                            WS_CHILD | WS_BORDER | WS_VISIBLE | style,
                            0, 0, rect.right, rect.bottom,
                            parent, NULL, GetModuleHandleW(NULL), NULL);
-    ok(hwnd != NULL, "gle=%d\n", GetLastError());
+    ok(hwnd != NULL, "gle=%ld\n", GetLastError());
 
     if (!hwnd) return NULL;
 
@@ -1094,7 +1094,7 @@ static void test_checkboxes(void)
 
     /* Set the style again and check that doesn't change an item's state */
     r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
-    ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r);
+    ok(r == LVS_EX_CHECKBOXES, "ret %lx\n", r);
 
     item.iItem = 3;
     item.mask = LVIF_STATE;
@@ -1105,7 +1105,7 @@ static void test_checkboxes(void)
 
     /* Unsetting the checkbox extended style doesn't change an item's state */
     r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, 0);
-    ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r);
+    ok(r == LVS_EX_CHECKBOXES, "ret %lx\n", r);
 
     item.iItem = 3;
     item.mask = LVIF_STATE;
@@ -1241,7 +1241,7 @@ static void test_items(void)
     expect(1, r);
     ok(item.state & LVIS_SELECTED, "Expected LVIS_SELECTED\n");
     r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0);
-    ok(r, "got %d\n", r);
+    ok(r, "got %ld\n", r);
 
     /* LVIS_SELECTED with zero stateMask */
     /* set */
@@ -1264,7 +1264,7 @@ static void test_items(void)
     expect(1, r);
     ok(item.state & LVIS_FOCUSED, "Expected LVIS_FOCUSED\n");
     r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0);
-    ok(r, "got %d\n", r);
+    ok(r, "got %ld\n", r);
 
     /* LVIS_CUT with LVIS_FOCUSED stateMask */
     /* set */
@@ -1287,7 +1287,7 @@ static void test_items(void)
     expect(1, r);
     ok(item.state & LVIS_CUT, "Expected LVIS_CUT\n");
     r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0);
-    ok(r, "got %d\n", r);
+    ok(r, "got %ld\n", r);
 
     /* Insert an item with just a param */
     memset (&item, 0xcc, sizeof (item));
@@ -1305,7 +1305,7 @@ static void test_items(void)
     item.iSubItem = 0;
     r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item);
     expect(1, r);
-    ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest);
+    ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
 
     /* Set up a subitem */
     memset (&item, 0xcc, sizeof (item));
@@ -1350,7 +1350,7 @@ static void test_items(void)
     item.iSubItem = 1;
     item.pszText = text;
     r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item);
-    ok(r == 1 || broken(r == 0) /* NT4 */, "ret %d\n", r);
+    ok(r == 1 || broken(r == 0) /* NT4 */, "ret %ld\n", r);
 
     if (r == 1)
     {
@@ -1372,7 +1372,7 @@ static void test_items(void)
     item.iSubItem = 1;
     r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item);
     expect(1, r);
-    ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest);
+    ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
 
     /* Set up param on first subitem: no effect */
     memset (&item, 0xcc, sizeof (item));
@@ -1390,7 +1390,7 @@ static void test_items(void)
     item.iSubItem = 1;
     r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item);
     expect(1, r);
-    ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest);
+    ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
 
     /**** Some tests of state highlighting ****/
     memset (&item, 0xcc, sizeof (item));
@@ -1473,7 +1473,7 @@ static void test_columns(void)
     ok(header == NULL, "got %p\n", header);
 
     rc = SendMessageA(hwnd, LVM_GETCOLUMNORDERARRAY, 2, (LPARAM)&order);
-    ok(rc == 0, "got %d\n", rc);
+    ok(rc == 0, "got %ld\n", rc);
 
     header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0);
     ok(header == NULL, "got %p\n", header);
@@ -1485,20 +1485,20 @@ static void test_columns(void)
     ok(hwnd != NULL, "failed to create listview window\n");
 
     rc = SendMessageA(hwnd, LVM_DELETECOLUMN, -1, 0);
-    ok(!rc, "got %d\n", rc);
+    ok(!rc, "got %ld\n", rc);
 
     rc = SendMessageA(hwnd, LVM_DELETECOLUMN, 0, 0);
-    ok(!rc, "got %d\n", rc);
+    ok(!rc, "got %ld\n", rc);
 
     /* Add a column with no mask */
     memset(&column, 0xcc, sizeof(column));
     column.mask = 0;
     rc = SendMessageA(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&column);
-    ok(rc == 0, "Inserting column with no mask failed with %d\n", rc);
+    ok(rc == 0, "Inserting column with no mask failed with %ld\n", rc);
 
     /* Check its width */
     rc = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
-    ok(rc == 10, "Inserting column with no mask failed to set width to 10 with %d\n", rc);
+    ok(rc == 10, "Inserting column with no mask failed to set width to 10 with %ld\n", rc);
 
     DestroyWindow(hwnd);
 
@@ -1774,7 +1774,7 @@ static void test_create(BOOL is_version_6)
 
     SetRect(&rect, LVIR_BOUNDS, 1, -10, -10);
     r = SendMessageA(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect);
-    ok(r == 1, "Unexpected ret value %d.\n", r);
+    ok(r == 1, "Unexpected ret value %ld.\n", r);
     /* right value contains garbage, probably because header columns are not set up */
     ok(rect.bottom >= 0, "Unexpected rectangle.\n");
 
@@ -1911,32 +1911,32 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
             case CDDS_ITEMPREPAINT:
                 clr = GetBkColor(nmlvcd->nmcd.hdc);
                 todo_wine_if(nmlvcd->iSubItem)
-                    ok(clr == c0ffee, "Unexpected background color %#x.\n", clr);
+                    ok(clr == c0ffee, "Unexpected background color %#lx.\n", clr);
                 nmlvcd->clrTextBk = CLR_DEFAULT;
                 nmlvcd->clrText = RGB(0, 255, 0);
                 return CDRF_NOTIFYSUBITEMDRAW|CDRF_NOTIFYPOSTPAINT;
             case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
                 clr = GetBkColor(nmlvcd->nmcd.hdc);
-                ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background %#x.\n", nmlvcd->clrTextBk);
-                ok(nmlvcd->clrText == RGB(0, 255, 0), "Unexpected text color %#x.\n", nmlvcd->clrText);
+                ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background %#lx.\n", nmlvcd->clrTextBk);
+                ok(nmlvcd->clrText == RGB(0, 255, 0), "Unexpected text color %#lx.\n", nmlvcd->clrText);
                 if (showsel_always && is_selected && nmlvcd->iSubItem)
-                    ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#x.\n", clr);
+                    ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#lx.\n", clr);
                 else
                 todo_wine_if(nmlvcd->iSubItem)
-                    ok(clr == c0ffee, "clr=%.8x\n", clr);
+                    ok(clr == c0ffee, "clr=%.8lx\n", clr);
                 return CDRF_NOTIFYPOSTPAINT;
             case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
                 clr = GetBkColor(nmlvcd->nmcd.hdc);
                 if (showsel_always && is_selected)
-                    ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#x.\n", clr);
+                    ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#lx.\n", clr);
                 else
                 {
                 todo_wine
-                    ok(clr == c0ffee, "Unexpected background color %#x.\n", clr);
+                    ok(clr == c0ffee, "Unexpected background color %#lx.\n", clr);
                 }
 
-                ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background color %#x.\n", nmlvcd->clrTextBk);
-                ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
+                ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background color %#lx.\n", nmlvcd->clrTextBk);
+                ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%lx\n", nmlvcd->clrText);
                 return CDRF_DODEFAULT;
             }
             return CDRF_DODEFAULT;
@@ -2034,7 +2034,7 @@ static void test_icon_spacing(void)
     r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(20, 30));
     ok(r == MAKELONG(w, h) ||
        broken(r == MAKELONG(w, w)), /* win98 */
-       "Expected %d, got %d\n", MAKELONG(w, h), r);
+       "Expected %ld, got %d\n", MAKELONG(w, h), r);
 
     r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(25, 35));
     expect(MAKELONG(20,30), r);
@@ -2421,7 +2421,7 @@ static void test_multiselect(void)
         ok(r, "got %d\n", r);
 
 	selected_count = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
-	ok(selected_count == 1, "expected 1, got %d\n", selected_count);
+	ok(selected_count == 1, "expected 1, got %ld\n", selected_count);
 
 	/* Set SHIFT key pressed */
         GetKeyboardState(kstate);
@@ -2438,7 +2438,7 @@ static void test_multiselect(void)
 	selected_count = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
 
 	ok((task.result == -1 ? item_count : task.result) == selected_count,
-            "Failed multiple selection %s. There should be %d selected items (is %d)\n",
+            "Failed multiple selection %s. There should be %ld selected items (is %ld)\n",
             task.descr, item_count, selected_count);
 
 	/* Set SHIFT key released */
@@ -2804,7 +2804,7 @@ static void test_subitem_rect(void)
     expect(250, rect.right);
 
     r = SendMessageA(hwnd, LVM_SCROLL, 10, 0);
-    ok(r, "got %d\n", r);
+    ok(r, "got %ld\n", r);
 
     SetRect(&rect, LVIR_BOUNDS, 1, 0, 0);
     r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect);
@@ -3747,7 +3747,7 @@ static void test_hittest(void)
     r = SendMessageA(hwnd, LVM_GETITEMSPACING, TRUE, 0);
     vert = HIWORD(r);
     ok(bounds.bottom - bounds.top == vert,
-        "Vertical spacing inconsistent (%d != %d)\n", bounds.bottom - bounds.top, vert);
+        "Vertical spacing inconsistent (%ld != %d)\n", bounds.bottom - bounds.top, vert);
     r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pos);
     expect(TRUE, r);
 
@@ -3907,7 +3907,7 @@ static void test_getviewrect(void)
     item.iItem = 0;
     item.iSubItem = 0;
     r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item);
-    ok(!r, "got %d\n", r);
+    ok(!r, "got %ld\n", r);
 
     r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0));
     expect(TRUE, r);
@@ -3931,8 +3931,8 @@ static void test_getviewrect(void)
     expect(0, rect.left);
     expect(0, rect.top);
     /* precise value differs for 2k, XP and Vista */
-    ok(rect.bottom > 0, "Expected positive bottom value, got %d\n", rect.bottom);
-    ok(rect.right  > 0, "Expected positive right value, got %d\n", rect.right);
+    ok(rect.bottom > 0, "Expected positive bottom value, got %ld\n", rect.bottom);
+    ok(rect.right  > 0, "Expected positive right value, got %ld\n", rect.right);
 
     DestroyWindow(hwnd);
 }
@@ -3970,7 +3970,7 @@ static void test_getitemposition(void)
 
     SetRectEmpty(&rect);
     r = SendMessageA(header, HDM_GETITEMRECT, 0, (LPARAM)&rect);
-    ok(r, "got %d\n", r);
+    ok(r, "got %ld\n", r);
     /* some padding? */
     expect(2, pt.x);
     /* offset by header height */
@@ -4005,7 +4005,7 @@ static void test_getitemrect(void)
     expect(0, rect.top);
     /* estimate it as width / height ratio */
     todo_wine
-    ok((rect.right / rect.bottom) >= 5, "got right %d, bottom %d\n", rect.right, rect.bottom);
+    ok((rect.right / rect.bottom) >= 5, "got right %ld, bottom %ld\n", rect.right, rect.bottom);
     DestroyWindow(hwnd);
 
     hwnd = create_listview_control(LVS_REPORT);
@@ -4451,7 +4451,7 @@ static void test_notifyformat(void)
     r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 1, 0);
     expect(0, r);
     r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0);
-    ok(r == 1, "Unexpected return value %d.\n", r);
+    ok(r == 1, "Unexpected return value %ld.\n", r);
     r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 0, 0);
     expect(1, r);
     r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0);
@@ -4468,7 +4468,7 @@ static void test_notifyformat(void)
     r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0);
     expect(0, r);
     r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0);
-    ok( r == 1, "Expected 1, got %d\n", r );
+    ok( r == 1, "Expected 1, got %ld\n", r );
     r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY);
     ok(r != 0, "Expected valid format\n");
 
@@ -4478,7 +4478,7 @@ static void test_notifyformat(void)
     r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0);
     expect(1, r);
     r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0);
-    ok( r == 1, "Expected 1, got %d\n", r );
+    ok( r == 1, "Expected 1, got %ld\n", r );
 
     notifyFormat = NFR_ANSI;
     r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY);
@@ -4486,7 +4486,7 @@ static void test_notifyformat(void)
     r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0);
     expect(0, r);
     r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0);
-    ok( r == 1, "Expected 1, got %d\n", r );
+    ok( r == 1, "Expected 1, got %ld\n", r );
 
     DestroyWindow(hwnd);
 
@@ -5055,7 +5055,7 @@ static void test_approximate_viewrect(void)
     expect(0, ret);
 
     ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(75, 75));
-    ok(ret != 0, "Unexpected return value %#x.\n", ret);
+    ok(ret != 0, "Unexpected return value %#lx.\n", ret);
 
     ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100));
     expect(MAKELONG(77,827), ret);
@@ -5133,7 +5133,7 @@ static void test_approximate_viewrect(void)
     col.pszText = column_header;
     col.cx = column_width;
     ret = SendMessageA(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&col);
-    ok(ret == 0, "Unexpected return value %d.\n", ret);
+    ok(ret == 0, "Unexpected return value %ld.\n", ret);
 
     /* Empty control with column */
     ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 0, 0);
@@ -5170,7 +5170,7 @@ todo_wine {
         itema.iSubItem = 0;
         itema.pszText = test;
         ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema);
-        ok(ret == 0, "Unexpected return value %d.\n", ret);
+        ok(ret == 0, "Unexpected return value %ld.\n", ret);
 
         ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 0, 0);
         ok(LOWORD(ret) >= column_width, "Unexpected width %d.\n", LOWORD(ret));
@@ -5181,8 +5181,8 @@ todo_wine {
         item_width = LOWORD(ret);
 
         ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 1, 0);
-        ok(LOWORD(ret) == item_width, "Unexpected width %d, item %d\n", LOWORD(ret), item_count - 1);
-        ok(HIWORD(ret) > header_height, "Unexpected height %d. item %d.\n", HIWORD(ret),  item_count - 1);
+        ok(LOWORD(ret) == item_width, "Unexpected width %d, item %ld\n", LOWORD(ret), item_count - 1);
+        ok(HIWORD(ret) > header_height, "Unexpected height %d. item %ld.\n", HIWORD(ret),  item_count - 1);
 
         item_height = HIWORD(ret) - header_height;
 
@@ -5542,7 +5542,7 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMCHANGINGW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_ITEMCHANGINGA;
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
                 "header notify, parent", TRUE);
@@ -5551,7 +5551,7 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMCHANGEDW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_ITEMCHANGEDA;
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
                 "header notify, parent", TRUE);
@@ -5562,35 +5562,35 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMCLICKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_click_seq,
                 "header notify, parent", FALSE);
     ok(nmhdr.hdr.code == HDN_ITEMCLICKA, "Expected ANSI notification code\n");
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMDBLCLICKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     ok(nmhdr.hdr.code == HDN_ITEMDBLCLICKW, "Expected Unicode notification code\n");
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_DIVIDERDBLCLICKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_divider_dclick_seq,
                 "header notify, parent", TRUE);
     ok(nmhdr.hdr.code == HDN_DIVIDERDBLCLICKA, "Expected ANSI notification code\n");
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_BEGINTRACKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     ok(nmhdr.hdr.code == HDN_BEGINTRACKW, "Expected Unicode notification code\n");
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ENDTRACKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_ENDTRACKA;
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
                 "header notify, parent", FALSE);
@@ -5598,7 +5598,7 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_TRACKW;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_TRACKA;
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
                 "header notify, parent", FALSE);
@@ -5606,20 +5606,20 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_BEGINDRAG;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 1, "got %d\n", ret);
+    ok(ret == 1, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ENDDRAG;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_ENDDRAG;
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
                 "header notify, parent", FALSE);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_FILTERCHANGE;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     parent_header_notify_seq[0].id = HDN_FILTERCHANGE;
     parent_header_notify_seq[0].flags |= optional; /* NT4 does not send this message */
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
@@ -5628,25 +5628,25 @@ static void test_header_notification2(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_BEGINFILTEREDIT;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ENDFILTEREDIT;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMSTATEICONCLICK;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     nmhdr.hdr.code = HDN_ITEMKEYDOWN;
     ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
                 "header notify, parent", FALSE);
 
@@ -5699,7 +5699,7 @@ static void test_dispinfo(void)
     item.pszText = (char*)buff;
     item.cchTextMax = ARRAY_SIZE(buff);
     ret = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item);
-    ok(ret == sizeof(testA)-1, "got %d, expected 4\n", ret);
+    ok(ret == sizeof(testA)-1, "got %ld, expected 4\n", ret);
     g_disp_A_to_W = FALSE;
 
     ok(memcmp(item.pszText, testA, sizeof(testA)) == 0,
@@ -6221,7 +6221,7 @@ static void test_oneclickactivate(void)
     track.dwFlags = TME_QUERY;
     p_TrackMouseEvent(&track);
     ok(track.hwndTrack == hwnd, "hwndTrack != hwnd\n");
-    ok(track.dwFlags == TME_LEAVE, "dwFlags = %x\n", track.dwFlags);
+    ok(track.dwFlags == TME_LEAVE, "dwFlags = %lx\n", track.dwFlags);
 
     r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
     expect(0, r);
@@ -6250,7 +6250,7 @@ static void test_callback_mask(void)
     ok(ret, "got %d\n", ret);
 
     mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0);
-    ok(mask == ~0u, "got 0x%08x\n", mask);
+    ok(mask == ~0u, "got 0x%08lx\n", mask);
 
     /* Ask for state, invalid subitem. */
     insert_item(hwnd, 0);
@@ -6296,13 +6296,13 @@ static void test_callback_mask(void)
     hwnd = create_listview_control(LVS_REPORT | LVS_OWNERDATA);
 
     mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0);
-    ok(mask == 0, "Unexpected callback mask %#x.\n", mask);
+    ok(mask == 0, "Unexpected callback mask %#lx.\n", mask);
 
     ret = SendMessageA(hwnd, LVM_SETCALLBACKMASK, LVIS_FOCUSED, 0);
     ok(ret, "Failed to set callback mask, %d\n", ret);
 
     mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0);
-    ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#x.\n", mask);
+    ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#lx.\n", mask);
 
     ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0);
     ok(ret, "Failed to set item count.\n");
@@ -6465,7 +6465,7 @@ static void test_state_image(void)
         ok(r, "Failed to get item state.\n");
         ok(item.state == (INDEXTOSTATEIMAGEMASK(1) | LVIS_SELECTED | LVIS_FOCUSED),
             "Unexpected item state %#x.\n", item.state);
-        ok(item.lParam == 123456, "Unexpected lParam %ld.\n", item.lParam);
+        ok(item.lParam == 123456, "Unexpected lParam %Id.\n", item.lParam);
 
         item.mask = 0;
         item.stateMask = ~0u;
@@ -6485,7 +6485,7 @@ static void test_state_image(void)
         r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item);
         ok(r, "Failed to get subitem state.\n");
         ok(item.state == 0, "Unexpected state %#x.\n", item.state);
-        ok(item.lParam == 123456, "Unexpected lParam %ld.\n", item.lParam);
+        ok(item.lParam == 123456, "Unexpected lParam %Id.\n", item.lParam);
 
         item.mask = LVIF_STATE;
         item.stateMask = LVIS_FOCUSED;
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index 2fe6ad68426..75e2aa1862b 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -219,7 +219,7 @@ static void test_Alloc(void)
     size = pGetSize(p);
     ok(size == 1 ||
        broken(size == min), /* win9x */
-       "Expected 1, got %d\n", size);
+       "Expected 1, got %ld\n", size);
 
     /* reallocate the block */
     p = pReAlloc(p, 2);
@@ -229,7 +229,7 @@ static void test_Alloc(void)
     size = pGetSize(p);
     ok(size == 2 ||
        broken(size == min), /* win9x */
-       "Expected 2, got %d\n", size);
+       "Expected 2, got %ld\n", size);
 
     /* free the block */
     res = pFree(p);
@@ -279,7 +279,7 @@ static void test_LoadIconWithScaleDown(void)
     GetTempFileNameW(tmp_path, L"ICO", 0, icon_path);
     handle = CreateFileW(icon_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
                          FILE_ATTRIBUTE_NORMAL, NULL);
-    ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n", GetLastError());
+    ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %lu\n", GetLastError());
     res = WriteFile(handle, testicon_data, sizeof(testicon_data), &written, NULL);
     ok(res && written == sizeof(testicon_data), "Failed to write icon file\n");
     CloseHandle(handle);
@@ -296,43 +296,43 @@ static void test_LoadIconWithScaleDown(void)
     /* invalid arguments */
     icon = (HICON)0x1234;
     hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, 0x100, &icon);
-    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
     ok(icon == NULL, "Expected NULL, got %p\n", icon);
 
     icon = (HICON)0x1234;
     hr = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon);
-    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
     ok(icon == NULL, "Expected NULL, got %p\n", icon);
 
     icon = (HICON)0x1234;
     hr = pLoadIconWithScaleDown(NULL, NULL, 32, 32, &icon);
-    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
+    ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
     ok(icon == NULL, "Expected NULL, got %p\n", icon);
 
     /* non-existing filename */
     hr = pLoadIconMetric(NULL, L"nonexisting.ico", LIM_LARGE, &icon);
     ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* Win7 */,
-       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
+       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
 
     hr = pLoadIconWithScaleDown(NULL, L"nonexisting.ico", 32, 32, &icon);
     todo_wine
     ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
-       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
+       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
 
     /* non-existing resource name */
     hr = pLoadIconMetric(hinst, L"Nonexisting", LIM_LARGE, &icon);
     ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
-       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
+       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
 
     hr = pLoadIconWithScaleDown(hinst, L"Noneexisting", 32, 32, &icon);
     ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
-       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
+       "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
 
     /* load icon using predefined identifier */
     hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_SMALL, &icon);
-    ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+    ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
     res = GetIconInfo(icon, &info);
-    ok(res, "Failed to get icon info, error %u\n", GetLastError());
+    ok(res, "Failed to get icon info, error %lu\n", GetLastError());
     bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
     ok(bytes > 0, "Failed to get bitmap info for icon\n");
     ok(bmp.bmWidth  == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth);
@@ -340,9 +340,9 @@ static void test_LoadIconWithScaleDown(void)
     DestroyIcon(icon);
 
     hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_LARGE, &icon);
-    ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+    ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
     res = GetIconInfo(icon, &info);
-    ok(res, "Failed to get icon info, error %u\n", GetLastError());
+    ok(res, "Failed to get icon info, error %lu\n", GetLastError());
     bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
     ok(bytes > 0, "Failed to get bitmap info for icon\n");
     ok(bmp.bmWidth  == GetSystemMetrics(SM_CXICON), "Wrong icon width %d\n", bmp.bmWidth);
@@ -350,9 +350,9 @@ static void test_LoadIconWithScaleDown(void)
     DestroyIcon(icon);
 
     hr = pLoadIconWithScaleDown(NULL, (LPWSTR)IDI_APPLICATION, 42, 42, &icon);
-    ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+    ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
     res = GetIconInfo(icon, &info);
-    ok(res, "Failed to get icon info, error %u\n", GetLastError());
+    ok(res, "Failed to get icon info, error %lu\n", GetLastError());
     bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
     ok(bytes > 0, "Failed to get bitmap info for icon\n");
     ok(bmp.bmWidth  == 42, "Wrong icon width %d\n", bmp.bmWidth);
@@ -361,9 +361,9 @@ static void test_LoadIconWithScaleDown(void)
 
     /* load icon from file */
     hr = pLoadIconMetric(NULL, icon_path, LIM_SMALL, &icon);
-    ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+    ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
     res = GetIconInfo(icon, &info);
-    ok(res, "Failed to get icon info, error %u\n", GetLastError());
+    ok(res, "Failed to get icon info, error %lu\n", GetLastError());
     bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
     ok(bytes > 0, "Failed to get bitmap info for icon\n");
     ok(bmp.bmWidth  == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth);
@@ -371,9 +371,9 @@ static void test_LoadIconWithScaleDown(void)
     DestroyIcon(icon);
 
     hr = pLoadIconWithScaleDown(NULL, icon_path, 42, 42, &icon);
-    ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
+    ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
     res = GetIconInfo(icon, &info);
-    ok(res, "Failed to get icon info, error %u\n", GetLastError());
+    ok(res, "Failed to get icon info, error %lu\n", GetLastError());
     bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
     ok(bytes > 0, "Failed to get bitmap info for icon\n");
     ok(bmp.bmWidth  == 42, "Wrong icon width %d\n", bmp.bmWidth);
@@ -522,7 +522,7 @@ static HWND create_control(const char *class, DWORD style, HWND parent, DWORD_PT
     if (parent)
         style |= WS_CHILD;
     hwnd = CreateWindowExA(0, class, "test", style, 0, 0, 50, 20, parent, 0, 0, NULL);
-    ok(!!hwnd, "Failed to create %s style %#x parent %p\n", class, style, parent);
+    ok(!!hwnd, "Failed to create %s style %#lx parent %p\n", class, style, parent);
     pSetWindowSubclass(hwnd, test_wm_themechanged_proc, 0, data);
     return hwnd;
 }
@@ -637,13 +637,13 @@ static void test_WM_SYSCOLORCHANGE(void)
 
     parent = CreateWindowExA(0, WC_STATICA, "parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100,
                              200, 200, 0, 0, 0, NULL);
-    ok(!!parent, "CreateWindowExA failed, error %d\n", GetLastError());
+    ok(!!parent, "CreateWindowExA failed, error %ld\n", GetLastError());
 
     temp.tmplate.style = WS_CHILD | WS_VISIBLE;
     temp.tmplate.cx = 50;
     temp.tmplate.cy = 50;
     dialog = CreateDialogIndirectParamA(NULL, &temp.tmplate, parent, wm_syscolorchange_dlg_proc, 0);
-    ok(!!dialog, "CreateDialogIndirectParamA failed, error %d\n", GetLastError());
+    ok(!!dialog, "CreateDialogIndirectParamA failed, error %ld\n", GetLastError());
     flush_events();
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
@@ -917,15 +917,15 @@ static void test_themed_background(void)
 
     parent = CreateWindowA(cls.lpszClassName, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100,
                            0, 0, 0, 0);
-    ok(parent != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
+    ok(parent != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
 
     for (i = 0; i < ARRAY_SIZE(tests); ++i)
     {
-        winetest_push_context("%s %#x", tests[i].class_name, tests[i].style);
+        winetest_push_context("%s %#lx", tests[i].class_name, tests[i].style);
 
         child = CreateWindowA(tests[i].class_name, "    ", WS_CHILD | WS_VISIBLE | tests[i].style,
                               0, 0, 50, 50, parent, 0, 0, 0);
-        ok(child != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
+        ok(child != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
         flush_events();
         flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
@@ -953,17 +953,17 @@ static void test_themed_background(void)
                 color = GetPixel(hdc, 40, 40);
                 /* BS_PUSHBOX is unimplemented on Wine */
                 todo_wine_if(i == 11)
-                ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
+                ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color);
             }
             else if (tests[i].seq == groupbox_seq)
             {
                 /* DrawThemeParentBackground() is used to fill content background */
                 color = GetPixel(hdc, 40, 40);
-                ok(color == 0xff, "Expected color %#x, got %#x.\n", 0xff, color);
+                ok(color == 0xff, "Expected color %#x, got %#lx.\n", 0xff, color);
 
                 /* WM_CTLCOLORSTATIC is used to fill text background */
                 color = GetPixel(hdc, 10, 10);
-                ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
+                ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color);
             }
 
             ReleaseDC(child, hdc);
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 64242959d0c..1a82a0b0fa8 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -35,15 +35,15 @@
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define expect_hex(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_hex_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %x, got %x\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %lx, got %lx\n", expected, got);
 }
-#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got);
+#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %ld, got %ld\n", expected, got);
 
 #define NUM_MSG_SEQUENCES   2
 #define PARENT_SEQ_INDEX    0
@@ -285,7 +285,7 @@ static void test_monthcal(void)
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
     ok(limits == 0 ||
        broken(limits == GDTR_MIN), /* comctl32 <= 4.70 */
-       "No limits should be set (%d)\n", limits);
+       "No limits should be set (%ld)\n", limits);
     if (limits == GDTR_MIN)
     {
         win_skip("comctl32 <= 4.70 is broken\n");
@@ -318,7 +318,7 @@ static void test_monthcal(void)
     expect(0, st[1].wMilliseconds);
 
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, 0);
-    ok(limits == 0, "got %u\n", limits);
+    ok(limits == 0, "got %lu\n", limits);
 
     GetSystemTime(&st[0]);
     st[1] = st[0];
@@ -468,7 +468,7 @@ static void test_monthcal(void)
 
     /* 0 limit flags */
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
-    ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
+    ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);
 
     GetSystemTime(st);
     st[1] = st[0];
@@ -477,7 +477,7 @@ static void test_monthcal(void)
     ok(r, "got %d\n", r);
 
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
-    ok(limits == 0, "got 0x%08x\n", limits);
+    ok(limits == 0, "got 0x%08lx\n", limits);
     ok(st[0].wYear == 0 && st[1].wYear == 0, "got %u, %u\n", st[0].wYear, st[1].wYear);
 
     /* flags are 0, set min limit */
@@ -489,7 +489,7 @@ static void test_monthcal(void)
     ok(r, "got %d\n", r);
 
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
-    ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
+    ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);
     ok(st1[1].wYear == 0, "got %u\n", st1[1].wYear);
 
     /* now set max limit, check flags */
@@ -497,7 +497,7 @@ static void test_monthcal(void)
     ok(r, "got %d\n", r);
 
     limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
-    ok(limits == GDTR_MAX, "got 0x%08x\n", limits);
+    ok(limits == GDTR_MAX, "got 0x%08lx\n", limits);
     ok(st1[0].wYear == 0, "got %u\n", st1[0].wYear);
 
     DestroyWindow(hwnd);
@@ -652,7 +652,7 @@ static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
          message == WM_STYLECHANGED) && lParam)
     {
         STYLESTRUCT *style = (STYLESTRUCT*)lParam;
-        trace("\told style: 0x%08x, new style: 0x%08x\n", style->styleOld, style->styleNew);
+        trace("\told style: 0x%08lx, new style: 0x%08lx\n", style->styleOld, style->styleNew);
     }
 
     defwndproc_counter++;
@@ -927,7 +927,7 @@ static void test_firstDay(void)
     SetLastError(0xdeadbeef);
     ret = GetLocaleInfoA(lcid, LOCALE_ICALENDARTYPE, caltype, 3);
     if (ret == 0) {
-        skip("Must know local calendar type (%x)\n", GetLastError());
+        skip("Must know local calendar type (%lx)\n", GetLastError());
         return;
     } else if (atoi(caltype) != CAL_GREGORIAN) {
         skip("MonthCalendar Control only supports Gregorian calendar (type: %s)\n", caltype);
@@ -1236,7 +1236,7 @@ if (0)
                     break;
 
                 todo_wine_if(title_hits[title_index].todo)
-                    ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %d\n",
+                    ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %ld\n",
                                                           title_hits[title_index].ht, res, x);
             }
             old_res = res;
@@ -1841,7 +1841,7 @@ static void test_hittest_v6(void)
     expect(0, mchit.rc.left);
     expect(0, mchit.rc.top);
     expect_d(r.right, mchit.rc.right);
-    ok(mchit.rc.bottom > 0, "got %d\n", mchit.rc.bottom);
+    ok(mchit.rc.bottom > 0, "got %ld\n", mchit.rc.bottom);
 
     /* between two calendars */
     MoveWindow(hwnd, 0, 0, r.right * 5/2, r.bottom, FALSE);
@@ -1907,7 +1907,7 @@ static void test_MCM_SIZERECTTOMIN(void)
     }
 
     ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, 0);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
 
     SetRectEmpty(&r);
     ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r);
@@ -1917,18 +1917,18 @@ static void test_MCM_SIZERECTTOMIN(void)
         DestroyWindow(hwnd);
         return;
     }
-    ok(ret == 1, "got %d\n", ret);
-    ok(r.left == 0 && r.right > 0, "got %d, %d\n", r.left, r.right);
+    ok(ret == 1, "got %ld\n", ret);
+    ok(r.left == 0 && r.right > 0, "got %ld, %ld\n", r.left, r.right);
 
     r = r2;
     ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r);
-    ok(ret == 1, "got %d\n", ret);
+    ok(ret == 1, "got %ld\n", ret);
 
     r2.right = (r2.right - r2.left) * 3;
     r2.bottom = (r2.bottom - r2.top) * 3;
     r2.left = r2.top = 0;
     ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r2);
-    ok(ret == 1, "got %d\n", ret);
+    ok(ret == 1, "got %ld\n", ret);
 
     DestroyWindow(hwnd);
 }
@@ -1984,7 +1984,7 @@ static void test_daystate(void)
     /* try to switch on */
     SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | MCS_DAYSTATE);
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok((style & MCS_DAYSTATE) == 0, "got 0x%08x\n", style);
+    ok((style & MCS_DAYSTATE) == 0, "got 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 
@@ -2006,7 +2006,7 @@ static void test_daystate(void)
     /* try to switch off */
     SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~MCS_DAYSTATE);
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08x\n", style);
+    ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 }
diff --git a/dlls/comctl32/tests/mru.c b/dlls/comctl32/tests/mru.c
index 6a9a04d9663..472fb99bac3 100644
--- a/dlls/comctl32/tests/mru.c
+++ b/dlls/comctl32/tests/mru.c
@@ -200,7 +200,7 @@ static void check_reg_entries(const char *mrulist, const char**items)
     buff[0] = '\0';
     ret = RegQueryValueExA(hKey, "MRUList", NULL, &type, (LPBYTE)buff, &size);
 
-    ok(!ret && buff[0], "Checking MRU: got %d from RegQueryValueExW\n", ret);
+    ok(!ret && buff[0], "Checking MRU: got %ld from RegQueryValueExW\n", ret);
     if(ret || !buff[0]) return;
 
     ok(strcmp(buff, mrulist) == 0, "Checking MRU: Expected list %s, got %s\n",
@@ -217,7 +217,7 @@ static void check_reg_entries(const char *mrulist, const char**items)
         buff[0] = '\0';
         ret = RegQueryValueExA(hKey, name, NULL, &type, (LPBYTE)buff, &size);
         ok(!ret && buff[0],
-           "Checking MRU item %d ('%c'): got %d from RegQueryValueExW\n",
+           "Checking MRU item %d ('%c'): got %ld from RegQueryValueExW\n",
            i, mrulist[i], ret);
         if(ret || !buff[0]) return;
         ok(!strcmp(buff, items[mrulist[i]-'a']),
@@ -262,7 +262,7 @@ static void test_MRUListA(void)
     SetLastError(0);
     hMRU = pCreateMRUListA(&infoA);
     ok (!hMRU && !GetLastError(),
-        "CreateMRUListA(too small) expected NULL,0 got %p,%d\n",
+        "CreateMRUListA(too small) expected NULL,0 got %p,%ld\n",
         hMRU, GetLastError());
 
     /* size too big */
@@ -276,7 +276,7 @@ static void test_MRUListA(void)
     SetLastError(0);
     hMRU = pCreateMRUListA(&infoA);
     ok (!hMRU && !GetLastError(),
-        "CreateMRUListA(too big) expected NULL,0 got %p,%d\n",
+        "CreateMRUListA(too big) expected NULL,0 got %p,%ld\n",
         hMRU, GetLastError());
 
     /* NULL hKey */
@@ -290,7 +290,7 @@ static void test_MRUListA(void)
     SetLastError(0);
     hMRU = pCreateMRUListA(&infoA);
     ok (!hMRU && !GetLastError(),
-        "CreateMRUListA(NULL key) expected NULL,0 got %p,%d\n",
+        "CreateMRUListA(NULL key) expected NULL,0 got %p,%ld\n",
         hMRU, GetLastError());
 
     /* NULL subkey name */
@@ -304,7 +304,7 @@ static void test_MRUListA(void)
     SetLastError(0);
     hMRU = pCreateMRUListA(&infoA);
     ok (!hMRU && !GetLastError(),
-        "CreateMRUListA(NULL name) expected NULL,0 got %p,%d\n",
+        "CreateMRUListA(NULL name) expected NULL,0 got %p,%ld\n",
         hMRU, GetLastError());
 
     /* Create a string MRU */
@@ -321,7 +321,7 @@ static void test_MRUListA(void)
 
     hMRU = pCreateMRUListA(&infoA);
     ok(hMRU && !GetLastError(),
-       "CreateMRUListA(string) expected non-NULL,0 got %p,%d\n",
+       "CreateMRUListA(string) expected non-NULL,0 got %p,%ld\n",
        hMRU, GetLastError());
 
     if (hMRU)
@@ -336,35 +336,35 @@ static void test_MRUListA(void)
         SetLastError(0);
         iRet = pAddMRUStringA(NULL, checks[0]);
         ok(iRet == -1 && !GetLastError(),
-           "AddMRUStringA(NULL list) expected -1,0 got %d,%d\n",
+           "AddMRUStringA(NULL list) expected -1,0 got %d,%ld\n",
            iRet, GetLastError());
 
         /* Add (NULL string) */
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, NULL);
         todo_wine ok(iRet == 0 && !GetLastError(),
-           "AddMRUStringA(NULL str) expected 0,0 got %d,%d\n",
+           "AddMRUStringA(NULL str) expected 0,0 got %d,%ld\n",
            iRet, GetLastError());
 
         /* Add 3 strings. Check the registry is correct after each add */
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, checks[0]);
         ok(iRet == 0 && !GetLastError(),
-           "AddMRUStringA(1) expected 0,0 got %d,%d\n",
+           "AddMRUStringA(1) expected 0,0 got %d,%ld\n",
            iRet, GetLastError());
         check_reg_entries("a", checks);
 
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, checks[1]);
         ok(iRet == 1 && !GetLastError(),
-           "AddMRUStringA(2) expected 1,0 got %d,%d\n",
+           "AddMRUStringA(2) expected 1,0 got %d,%ld\n",
            iRet, GetLastError());
         check_reg_entries("ba", checks);
 
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, checks[2]);
         ok(iRet == 2 && !GetLastError(),
-           "AddMRUStringA(2) expected 2,0 got %d,%d\n",
+           "AddMRUStringA(2) expected 2,0 got %d,%ld\n",
            iRet, GetLastError());
         check_reg_entries("cba", checks);
 
@@ -374,7 +374,7 @@ static void test_MRUListA(void)
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, checks[1]);
         ok(iRet == 1 && !GetLastError(),
-           "AddMRUStringA(re-add 1) expected 1,0 got %d,%d\n",
+           "AddMRUStringA(re-add 1) expected 1,0 got %d,%ld\n",
            iRet, GetLastError());
         check_reg_entries("bca", checks);
 
@@ -382,7 +382,7 @@ static void test_MRUListA(void)
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, checks[3]);
         ok(iRet == 0 && !GetLastError(),
-           "AddMRUStringA(add new) expected 0,0 got %d,%d\n",
+           "AddMRUStringA(add new) expected 0,0 got %d,%ld\n",
            iRet, GetLastError());
         checks[0] = checks[3];
         check_reg_entries("abc", checks);
diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h
index 8ba2efddb0a..f6877d6a2b1 100644
--- a/dlls/comctl32/tests/msg.h
+++ b/dlls/comctl32/tests/msg.h
@@ -114,7 +114,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,
     trace_(file, line)("Failed sequence %s:\n", context );
     while (expected->message && actual->message)
     {
-        trace_(file, line)( "  %u: expected: %04x - actual: %04x wp %08lx lp %08lx\n",
+        trace_(file, line)( "  %u: expected: %04x - actual: %04x wp %08Ix lp %08Ix\n",
                             count, expected->message, actual->message, actual->wParam, actual->lParam );
 
 	if (expected->message == actual->message)
@@ -155,7 +155,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,
 
     while (actual->message)
     {
-        trace_(file, line)( "  %u: expected: nothing - actual: %04x wp %08lx lp %08lx\n",
+        trace_(file, line)( "  %u: expected: nothing - actual: %04x wp %08Ix lp %08Ix\n",
                             count, actual->message, actual->wParam, actual->lParam );
         actual++;
         count++;
@@ -190,14 +190,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
                         failcount++;
                         dump++;
                         ok_(file, line) (FALSE,
-                            "%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
+                            "%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
                             context, expected->message, expected->wParam, actual->wParam);
                     }
                 }
                 else
                 {
                     ok_(file, line) (expected->wParam == actual->wParam,
-                        "%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
+                        "%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
                         context, expected->message, expected->wParam, actual->wParam);
                     if (expected->wParam != actual->wParam) dump++;
                 }
@@ -212,14 +212,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
                         failcount++;
                         dump++;
                         ok_(file, line) (FALSE,
-                            "%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
+                            "%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
                             context, expected->message, expected->lParam, actual->lParam);
                     }
                 }
                 else
                 {
                     ok_(file, line) (expected->lParam == actual->lParam,
-                        "%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
+                        "%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
                         context, expected->message, expected->lParam, actual->lParam);
                     if (expected->lParam != actual->lParam) dump++;
                 }
@@ -234,14 +234,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
                         failcount++;
                         dump++;
                         ok_(file, line) (FALSE,
-                            "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
+                            "%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n",
                             context, expected->message, expected->stage, actual->stage);
                     }
                 }
                 else
                 {
                     ok_(file, line) (expected->stage == actual->stage,
-                        "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
+                        "%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n",
                         context, expected->message, expected->stage, actual->stage);
                     if (expected->stage != actual->stage) dump++;
                 }
diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 2ce964f8a27..e783dcc95e2 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -312,9 +312,9 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
                 DWORD style = GetWindowLongA(nmpgcs->hdr.hwndFrom, GWL_STYLE);
 
                 if (style & PGS_HORZ)
-                    ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
+                    ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#lx.\n", nmpgcs->dwFlag);
                 else
-                    ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
+                    ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#lx.\n", nmpgcs->dwFlag);
                 break;
             }
             default:
@@ -449,14 +449,14 @@ static void test_pager(void)
     ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", FALSE);
     GetWindowRect( pager, &rect );
     ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
-        "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
+        "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child2_wnd);
     ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE);
     GetWindowRect(pager, &rect);
     ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
-        "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
+        "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top);
     ok(!IsWindowVisible(child2_wnd), "Child window 2 is visible\n");
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -464,14 +464,14 @@ static void test_pager(void)
     ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE);
     GetWindowRect(pager, &rect);
     ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
-        "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
+        "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top);
 
     flush_sequences( sequences, NUM_MSG_SEQUENCES );
     SendMessageA( pager, PGM_SETPOS, 0, 10 );
     ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE);
     GetWindowRect( pager, &rect );
     ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
-        "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
+        "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );
 
     flush_sequences( sequences, NUM_MSG_SEQUENCES );
     SendMessageA( pager, PGM_SETPOS, 0, 10 );
@@ -546,7 +546,7 @@ static void test_wm_notifyformat(void)
     INT i;
 
     bret = register_notifyformat_class();
-    ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
+    ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());
 
     for (i = 0; i < ARRAY_SIZE(formats); i++)
     {
@@ -562,26 +562,26 @@ static void test_wm_notifyformat(void)
         /* Test parent */
         notify_query_received = FALSE;
         ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY);
-        ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
+        ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
         ok(notify_query_received, "Didn't receive notify\n");
 
         /* Send NF_QUERY directly to parent */
         notify_query_received = FALSE;
         ret = SendMessageW(parent, WM_NOTIFYFORMAT, (WPARAM)pager, NF_QUERY);
-        ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
+        ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
         ok(notify_query_received, "Didn't receive notify\n");
 
         /* Pager send notifications to its parent regardless of wParam */
         notify_query_received = FALSE;
         ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY);
-        ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
+        ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
         ok(notify_query_received, "Didn't receive notify\n");
 
         /* Pager always wants Unicode notifications from children */
         ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY);
-        ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
+        ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret);
         ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)child, NF_QUERY);
-        ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
+        ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret);
 
         DestroyWindow(parent);
     }
@@ -688,9 +688,9 @@ static LRESULT WINAPI test_notify_proc(HWND hwnd, UINT message, WPARAM wParam, L
         if (!notify_test_info.unicode) break;
         ok(!notify_test_info.received, "Extra notification received\n");
 
-        ok(wParam == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
+        ok(wParam == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam);
         ok(hdr->code == notify_test_info.ansi, "Expect 0x%08x, got 0x%08x\n", notify_test_info.ansi, hdr->code);
-        ok(hdr->idFrom == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
+        ok(hdr->idFrom == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam);
         ok(hdr->hwndFrom == notify_test_info.hwnd_from, "Expect %p, got %p\n", notify_test_info.hwnd_from, hdr->hwndFrom);
 
         if (hdr->code != notify_test_info.ansi)
@@ -1264,7 +1264,7 @@ static void test_wm_notify(void)
     INT i;
 
     bret = register_test_notify_class();
-    ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
+    ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());
 
     parent = CreateWindowA(class, "parent", WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), 0);
     ok(parent != NULL, "CreateWindow failed\n");
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c
index 91ea6eec2a9..b6716366498 100644
--- a/dlls/comctl32/tests/progress.c
+++ b/dlls/comctl32/tests/progress.c
@@ -222,22 +222,22 @@ static void test_setcolors(void)
     progress = create_progress(PBS_SMOOTH);
 
     clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0);
-    ok(clr == CLR_DEFAULT, "got %x\n", clr);
+    ok(clr == CLR_DEFAULT, "got %lx\n", clr);
 
     clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, RGB(0, 255, 0));
-    ok(clr == 0, "got %x\n", clr);
+    ok(clr == 0, "got %lx\n", clr);
 
     clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, CLR_DEFAULT);
-    ok(clr == RGB(0, 255, 0), "got %x\n", clr);
+    ok(clr == RGB(0, 255, 0), "got %lx\n", clr);
 
     clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, 0);
-    ok(clr == CLR_DEFAULT, "got %x\n", clr);
+    ok(clr == CLR_DEFAULT, "got %lx\n", clr);
 
     clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, RGB(255, 0, 0));
-    ok(clr == 0, "got %x\n", clr);
+    ok(clr == 0, "got %lx\n", clr);
 
     clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, CLR_DEFAULT);
-    ok(clr == RGB(255, 0, 0), "got %x\n", clr);
+    ok(clr == RGB(255, 0, 0), "got %lx\n", clr);
 
     DestroyWindow(progress);
 }
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index 0284311c81b..8b2c282c72e 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -89,7 +89,7 @@ static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
          * Arabic Windows 10 allocates 2 * size - 32,
          * all others allocate exactly 2 * size */
         ok(buffer_size >= 2 * size || broken(buffer_size == 2 * size - 32),
-                "Unexpected template buffer size %u, resource size %u\n",
+                "Unexpected template buffer size %lu, resource size %lu\n",
                 buffer_size, size);
         break;
       }
@@ -173,7 +173,7 @@ static void test_title(void)
     style = GetWindowLongA(hdlg, GWL_STYLE);
     ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|WS_SYSMENU|
                  DS_CONTEXTHELP|DS_MODALFRAME|DS_SETFONT|DS_3DLOOK),
-       "got unexpected style: %x\n", style);
+       "got unexpected style: %lx\n", style);
 
     DestroyWindow(hdlg);
 }
@@ -215,7 +215,7 @@ static void test_nopage(void)
         (HWND)SendMessageA(hdlg, PSM_GETCURRENTPAGEHWND, 0, 0);
     active_page = /* PropSheet_HwndToIndex(hdlg, hpage)); */
         (int)SendMessageA(hdlg, PSM_HWNDTOINDEX, (WPARAM)hpage, 0);
-    ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, active_page);
+    ok(hpage == NULL, "expected no current page, got %p, index=%ld\n", hpage, active_page);
     flush_events();
     RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW);
 
@@ -287,7 +287,7 @@ static void test_disableowner(void)
     psh.pfnCallback = disableowner_callback;
 
     p = pPropertySheetA(&psh);
-    ok(p == 0, "Expected 0, got %ld\n", p);
+    ok(p == 0, "Expected 0, got %Id\n", p);
     ok(IsWindowEnabled(parenthwnd) != 0, "parent window should be enabled\n");
     DestroyWindow(parenthwnd);
 }
@@ -402,26 +402,26 @@ static void test_wiznavigation(void)
     hdlg = (HWND)pPropertySheetA(&psh);
     ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
 
-    ok(active_page == 0, "Active page should be 0. Is: %d\n", active_page);
+    ok(active_page == 0, "Active page should be 0. Is: %ld\n", active_page);
 
     style = GetWindowLongA(hdlg, GWL_STYLE) & ~(DS_CONTEXTHELP|WS_SYSMENU);
     ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|
                  DS_MODALFRAME|DS_SETFONT|DS_3DLOOK),
-       "got unexpected style: %x\n", style);
+       "got unexpected style: %lx\n", style);
 
     control = GetFocus();
     controlID = GetWindowLongPtrA(control, GWLP_ID);
-    ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
+    ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);
 
     /* simulate pressing the Next button */
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
     if (!active_page) hwndtoindex_supported = FALSE;
     if (hwndtoindex_supported)
-        ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %d\n", active_page);
+        ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %ld\n", active_page);
 
     control = GetFocus();
     controlID = GetWindowLongPtrA(control, GWLP_ID);
-    ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %ld\n", IDC_PS_EDIT1, controlID);
+    ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %Id\n", IDC_PS_EDIT1, controlID);
 
     defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
     ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
@@ -432,20 +432,20 @@ static void test_wiznavigation(void)
     /* press next again */
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
     if (hwndtoindex_supported)
-        ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
+        ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page);
 
     control = GetFocus();
     controlID = GetWindowLongPtrA(control, GWLP_ID);
-    ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %ld\n", IDC_PS_RADIO1, controlID);
+    ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %Id\n", IDC_PS_RADIO1, controlID);
 
     /* back button */
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0);
     if (hwndtoindex_supported)
-        ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %d\n", active_page);
+        ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %ld\n", active_page);
 
     control = GetFocus();
     controlID = GetWindowLongPtrA(control, GWLP_ID);
-    ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %ld\n", IDC_PS_EDIT1, controlID);
+    ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %Id\n", IDC_PS_EDIT1, controlID);
 
     defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
     ok(defidres == MAKELRESULT(backID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", backID, LOWORD(defidres));
@@ -453,20 +453,20 @@ static void test_wiznavigation(void)
     /* press next twice */
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
     if (hwndtoindex_supported)
-        ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
+        ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page);
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0);
     if (hwndtoindex_supported)
-        ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %d\n", active_page);
+        ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %ld\n", active_page);
     else
         active_page = 3;
 
     control = GetFocus();
     controlID = GetWindowLongPtrA(control, GWLP_ID);
-    ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
+    ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);
 
     /* try to navigate away, but shouldn't be able to */
     SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0);
-    ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %d\n", active_page);
+    ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %ld\n", active_page);
 
     defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
     ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
@@ -892,34 +892,34 @@ if (0)
     tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 2, "got %d\n", r);
+    ok(r == 2, "got %ld\n", r);
 
     ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[2]);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     /* add property sheet page that can't be created */
     ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[3]);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 4, "got %d\n", r);
+    ok(r == 4, "got %ld\n", r);
 
     /* select page that can't be created */
     ret = SendMessageA(hdlg, PSM_SETCURSEL, 3, 1);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     /* test PSP_PREMATURE flag with incorrect property sheet page */
     ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[4]);
     ok(ret == FALSE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     pDestroyPropertySheetPage(hpsp[4]);
     DestroyWindow(hdlg);
@@ -986,34 +986,34 @@ if (0)
     tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 2, "got %d\n", r);
+    ok(r == 2, "got %ld\n", r);
 
     ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     /* add property sheet page that can't be created */
     ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 4, "got %d\n", r);
+    ok(r == 4, "got %ld\n", r);
 
     /* select page that can't be created */
     ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
     ok(ret == TRUE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     /* test PSP_PREMATURE flag with incorrect property sheet page */
     ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
     ok(ret == FALSE, "got %d\n", ret);
 
     r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
-    ok(r == 3, "got %d\n", r);
+    ok(r == 3, "got %ld\n", r);
 
     pDestroyPropertySheetPage(hpsp[4]);
     DestroyWindow(hdlg);
@@ -1037,7 +1037,7 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps
 
     ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
 
-    ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
+    ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n",
             psp->lParam, psp);
     ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
     ok(!lstrcmpA(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");
@@ -1045,11 +1045,11 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps
     switch (msg)
     {
     case PSPCB_ADDREF:
-        ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
+        ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize);
         cpage->addref_called++;
         break;
     case PSPCB_RELEASE:
-        ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
+        ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize);
         cpage->release_called++;
         break;
     default:
@@ -1065,7 +1065,7 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps
     PROPSHEETPAGEW *psp_orig = &cpage->u.pageW;
 
     ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
-    ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
+    ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n",
             psp->lParam, psp);
     ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
     ok(!lstrcmpW(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");
@@ -1073,11 +1073,11 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps
     switch (msg)
     {
     case PSPCB_ADDREF:
-        ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
+        ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize);
         cpage->addref_called++;
         break;
     case PSPCB_RELEASE:
-        ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
+        ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize);
         cpage->release_called++;
         break;
     default:
@@ -1107,10 +1107,10 @@ static void test_CreatePropertySheetPage(void)
         hpsp = pCreatePropertySheetPageA(&page.u.pageA);
 
         if (page.u.pageA.dwSize < PROPSHEETPAGEA_V1_SIZE)
-            ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageA.dwSize);
+            ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageA.dwSize);
         else
         {
-            ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageA.dwSize);
+            ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageA.dwSize);
             ok(page.addref_called == (page.u.pageA.dwSize > PROPSHEETPAGEA_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
         }
 
@@ -1136,10 +1136,10 @@ static void test_CreatePropertySheetPage(void)
         hpsp = pCreatePropertySheetPageW(&page.u.pageW);
 
         if (page.u.pageW.dwSize < PROPSHEETPAGEW_V1_SIZE)
-            ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageW.dwSize);
+            ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageW.dwSize);
         else
         {
-            ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageW.dwSize);
+            ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageW.dwSize);
             ok(page.addref_called == (page.u.pageW.dwSize > PROPSHEETPAGEW_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
         }
 
@@ -1176,7 +1176,7 @@ static void test_bad_control_class(void)
     U3(psh).phpage = &hpsp;
 
     ret = pPropertySheetA(&psh);
-    ok(ret == 0, "got %ld\n", ret);
+    ok(ret == 0, "got %Id\n", ret);
 
     /* Need to recreate hpsp otherwise the test fails under Windows */
     hpsp = pCreatePropertySheetPageA(&psp);
@@ -1185,9 +1185,9 @@ static void test_bad_control_class(void)
 
     psh.dwFlags = PSH_MODELESS;
     ret = pPropertySheetA(&psh);
-    ok(ret != 0, "got %ld\n", ret);
+    ok(ret != 0, "got %Id\n", ret);
 
-    ok(IsWindow((HWND)ret), "bad window handle %#lx\n", ret);
+    ok(IsWindow((HWND)ret), "bad window handle %#Ix\n", ret);
     DestroyWindow((HWND)ret);
 }
 
@@ -1236,7 +1236,7 @@ static void test_page_dialog_texture(void)
 
     /* Test that page dialog procedure is unchanged */
     dlgproc = GetWindowLongPtrA(sheethwnd, DWLP_DLGPROC);
-    ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#lx.\n", dlgproc);
+    ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#Ix.\n", dlgproc);
 
     /* Test that theme dialog texture is enabled for comctl32 v6, even when theming is off */
     ret = pIsThemeDialogTextureEnabled(sheethwnd);
@@ -1244,7 +1244,7 @@ static void test_page_dialog_texture(void)
     ok(ret == is_v6, "Wrong theme dialog texture status.\n");
 
     hwnd = CreateWindowA(WC_EDITA, "child", WS_POPUP | WS_VISIBLE, 1, 2, 50, 50, 0, 0, 0, NULL);
-    ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
+    ok(hwnd != NULL, "CreateWindowA failed, error %ld.\n", GetLastError());
     hdc = GetDC(hwnd);
 
     hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 8f51a1f9175..c15b22aeca1 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -930,8 +930,8 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle,
     rb.cch = MAX_PATH;
     ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFOA failed from line %d\n", line);
     expect_eq(line, rb.fStyle, fStyle, int, "%x");
-    expect_eq(line, rb.clrFore, clrFore, COLORREF, "%x");
-    expect_eq(line, rb.clrBack, clrBack, COLORREF, "%x");
+    expect_eq(line, rb.clrFore, clrFore, COLORREF, "%lx");
+    expect_eq(line, rb.clrBack, clrBack, COLORREF, "%lx");
     expect_eq(line, strcmp(rb.lpText, lpText), 0, int, "%d");
     expect_eq(line, rb.iImage, iImage, int, "%x");
     expect_eq(line, rb.hwndChild, hwndChild, HWND, "%p");
@@ -945,7 +945,7 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle,
     expect_eq(line, rb.cyMaxChild, cyMaxChild, int, "%x");
     expect_eq(line, rb.cyIntegral, cyIntegral, int, "%x");
     expect_eq(line, rb.cxIdeal, cxIdeal, int, "%d");
-    expect_eq(line, rb.lParam, lParam, LPARAM, "%ld");
+    expect_eq(line, rb.lParam, lParam, LPARAM, "%Id");
     ok(rb.cxHeader == cxHeader || rb.cxHeader == cxHeader + 1 || broken(rb.cxHeader == cxHeader_broken),
         "expected %d for %d from line %d\n", cxHeader, rb.cxHeader, line);
 }
@@ -1029,9 +1029,9 @@ static void test_colors(void)
 
     /* test default colors */
     clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0);
-    compare(clr, (COLORREF)CLR_NONE, "%x");
+    compare(clr, CLR_NONE, "%lx");
     clr = SendMessageA(hRebar, RB_GETBKCOLOR, 0, 0);
-    compare(clr, (COLORREF)CLR_NONE, "%x");
+    compare(clr, CLR_NONE, "%lx");
 
     scheme.dwSize = sizeof(scheme);
     scheme.clrBtnHighlight = 0;
@@ -1039,8 +1039,8 @@ static void test_colors(void)
     ret = SendMessageA(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme);
     if (ret)
     {
-        compare(scheme.clrBtnHighlight, (COLORREF)CLR_DEFAULT, "%x");
-        compare(scheme.clrBtnShadow, (COLORREF)CLR_DEFAULT, "%x");
+        compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%lx");
+        compare(scheme.clrBtnShadow, CLR_DEFAULT, "%lx");
     }
     else
         skip("RB_GETCOLORSCHEME not supported\n");
@@ -1052,14 +1052,14 @@ static void test_colors(void)
     bi.clrFore = bi.clrBack = 0xc0ffe;
     ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
     ok(ret, "RB_GETBANDINFOA failed\n");
-    compare(bi.clrFore, RGB(0, 0, 0), "%x");
-    compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%x");
+    compare(bi.clrFore, RGB(0, 0, 0), "%lx");
+    compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%lx");
 
     SendMessageA(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0));
     bi.clrFore = bi.clrBack = 0xc0ffe;
     ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
     ok(ret, "RB_GETBANDINFOA failed\n");
-    compare(bi.clrFore, RGB(0, 0, 0), "%x");
+    compare(bi.clrFore, RGB(0, 0, 0), "%lx");
 
     DestroyWindow(hRebar);
 }
diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c
index 0038cadd7d2..b8f43142d6b 100644
--- a/dlls/comctl32/tests/static.c
+++ b/dlls/comctl32/tests/static.c
@@ -283,10 +283,10 @@ static void test_STM_SETIMAGE(void)
 
     for (type = SS_LEFT; type < SS_ETCHEDFRAME; type++)
     {
-        winetest_push_context("%u", type);
+        winetest_push_context("%lu", type);
 
         hwnd = create_static(type);
-        ok(hwnd != 0, "failed to create static type %#x\n", type);
+        ok(hwnd != 0, "failed to create static type %#lx\n", type);
 
         /* set icon */
         g_nReceivedColorStatic = 0;
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index 64313218e31..1851507481f 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -25,7 +25,12 @@
 
 #define SUBCLASS_NAME "MyStatusBar"
 
-#define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got)
+#define expect(expected,got) expect_(__LINE__, expected, got)
+static inline void expect_(unsigned line, DWORD expected, DWORD got)
+{
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
+}
+
 #define expect_rect(_left,_top,_right,_bottom,got) do { \
         RECT exp = {abs(got.left - _left), abs(got.top - _top), \
                     abs(got.right - _right), abs(got.bottom - _bottom)}; \
@@ -145,7 +150,7 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEXA *enumlf, NEWTEXTME
         y = tm.tmHeight + (tm.tmInternalLeading ? tm.tmInternalLeading : 2) + 4;
 
         ok( (rcCtrl.bottom == max(y, g_ysize)) || (rcCtrl.bottom == max(y, g_dpisize)),
-            "got %d (expected %d or %d) for %s #%d\n",
+            "got %ld (expected %d or %d) for %s #%d\n",
             rcCtrl.bottom, max(y, g_ysize), max(y, g_dpisize), facename, sizes[i]);
 
         SelectObject(hdc, hOldFont);
@@ -370,11 +375,11 @@ static void test_status_control(void)
     crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0));
     ok(crColor == CLR_DEFAULT ||
        broken(crColor == RGB(0,0,0)), /* win95 */
-       "Expected 0x%.8lx, got 0x%.8x\n", CLR_DEFAULT, crColor);
+       "Expected 0x%.8lx, got 0x%.8lx\n", CLR_DEFAULT, crColor);
     crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT);
     ok(crColor == RGB(255,0,0) ||
        broken(crColor == RGB(0,0,0)), /* win95 */
-       "Expected 0x%.8x, got 0x%.8x\n", RGB(255,0,0), crColor);
+       "Expected 0x%.8lx, got 0x%.8lx\n", RGB(255,0,0), crColor);
 
     /* Add an icon to the status bar */
     hIcon = LoadIconA(NULL, (LPCSTR)IDI_QUESTION);
diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c
index b2b47319b16..439d61a83c8 100644
--- a/dlls/comctl32/tests/subclass.c
+++ b/dlls/comctl32/tests/subclass.c
@@ -155,7 +155,7 @@ static void ok_sequence(const struct message *expected, const char *context)
             "%s: the procnum %d was expected, but got procnum %d instead\n",
             context, expected->procnum, actual->procnum);
         ok(expected->wParam == actual->wParam,
-            "%s: in procnum %d expecting wParam 0x%lx got 0x%lx\n",
+            "%s: in procnum %d expecting wParam 0x%Ix got 0x%Ix\n",
             context, expected->procnum, expected->wParam, actual->wParam);
         expected++;
         actual++;
diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c
index 7f3e19fc670..d5192c26b5c 100644
--- a/dlls/comctl32/tests/syslink.c
+++ b/dlls/comctl32/tests/syslink.c
@@ -184,7 +184,7 @@ static void test_create_syslink(void)
     /* Create an invisible SysLink control */
     flush_sequences(sequences, NUM_MSG_SEQUENCE);
     hWndSysLink = create_syslink(WS_CHILD | WS_TABSTOP, hWndParent);
-    ok(hWndSysLink != NULL, "Expected non NULL value (le %u)\n", GetLastError());
+    ok(hWndSysLink != NULL, "Expected non NULL value (le %lu)\n", GetLastError());
     flush_events();
     ok_sequence(sequences, SYSLINK_SEQ_INDEX, empty_wnd_seq, "create SysLink", FALSE);
     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_syslink_wnd_seq, "create SysLink (parent)", TRUE);
@@ -210,7 +210,7 @@ static void test_LM_GETIDEALHEIGHT(void)
     ok(hwnd != NULL, "Failed to create SysLink window.\n");
 
     ret = SendMessageA(hwnd, LM_GETIDEALHEIGHT, 0, 0);
-    ok(ret > 0, "Unexpected ideal height, %d.\n", ret);
+    ok(ret > 0, "Unexpected ideal height, %ld.\n", ret);
 
     DestroyWindow(hwnd);
 }
@@ -226,13 +226,13 @@ static void test_LM_GETIDEALSIZE(void)
 
     memset(&sz, 0, sizeof(sz));
     ret = SendMessageA(hwnd, LM_GETIDEALSIZE, 0, (LPARAM)&sz);
-    ok(ret > 0, "Unexpected return value, %d.\n", ret);
+    ok(ret > 0, "Unexpected return value, %ld.\n", ret);
     if (sz.cy == 0)
         win_skip("LM_GETIDEALSIZE is not supported.\n");
     else
     {
-        ok(sz.cx > 5, "Unexpected ideal width, %d.\n", sz.cx);
-        ok(sz.cy == ret, "Unexpected ideal height, %d.\n", sz.cy);
+        ok(sz.cx > 5, "Unexpected ideal width, %ld.\n", sz.cx);
+        ok(sz.cy == ret, "Unexpected ideal height, %ld.\n", sz.cy);
     }
 
     DestroyWindow(hwnd);
diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c
index c5d57af114d..67dea94b55c 100644
--- a/dlls/comctl32/tests/tab.c
+++ b/dlls/comctl32/tests/tab.c
@@ -37,7 +37,7 @@
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define expect_str(expected, got)\
@@ -56,14 +56,14 @@ static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int lin
 
     SendMessageA(hwnd, TCM_GETITEMRECT, 0, (LPARAM)&r);
     if (width >= 0 && height < 0)
-        ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%d]\n",
+        ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%ld]\n",
             msg, width, r.right - r.left);
     else if (height >= 0 && width < 0)
-        ok_(__FILE__,line) (height == r.bottom - r.top,  "%s: Expected height [%d] got [%d]\n",
+        ok_(__FILE__,line) (height == r.bottom - r.top,  "%s: Expected height [%d] got [%ld]\n",
             msg, height, r.bottom - r.top);
     else
         ok_(__FILE__,line) ((width  == r.right  - r.left) && (height == r.bottom - r.top ),
-	    "%s: Expected [%d,%d] got [%d,%d]\n", msg, width, height,
+	    "%s: Expected [%d,%d] got [%ld,%ld]\n", msg, width, height,
             r.right - r.left, r.bottom - r.top);
 }
 
@@ -461,7 +461,7 @@ static void test_tab(INT nMinTabWidth)
     dpi = GetDeviceCaps(hdc, LOGPIXELSX);
     hOldFont = SelectObject(hdc, (HFONT)SendMessageA(hwTab, WM_GETFONT, 0, 0));
     GetTextExtentPoint32A(hdc, "Tab 1", strlen("Tab 1"), &size);
-    trace("Tab1 text size: size.cx=%d size.cy=%d\n", size.cx, size.cy);
+    trace("Tab1 text size: size.cx=%ld size.cy=%ld\n", size.cx, size.cy);
     SelectObject(hdc, hOldFont);
     ReleaseDC(hwTab, hdc);
 
@@ -532,7 +532,7 @@ static void test_tab(INT nMinTabWidth)
     exp = max(size.cx +TAB_PADDING_X*2, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth);
     SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab );
     ok( rTab.right  - rTab.left == exp || broken(rTab.right  - rTab.left == DEFAULT_MIN_TAB_WIDTH),
-        "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left );
+        "no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );
 
     for (i=0; i<8; i++)
     {
@@ -560,7 +560,7 @@ static void test_tab(INT nMinTabWidth)
     exp = (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth;
     SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab );
     ok( rTab.right  - rTab.left == exp || broken(rTab.right  - rTab.left == DEFAULT_MIN_TAB_WIDTH),
-        "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left );
+        "no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );
 
     for (i=0; i<8; i++)
     {
@@ -830,14 +830,14 @@ static void test_getset_item(void)
     ok(GetParent(hTab) == NULL, "got %p, expected null parent\n", GetParent(hTab));
 
     ret = SendMessageA(hTab, TCM_SETITEMEXTRA, sizeof(LPARAM)-1, 0);
-    ok(ret == TRUE, "got %d\n", ret);
+    ok(ret == TRUE, "got %ld\n", ret);
 
     /* set some item data */
     tcItem.lParam = ~0;
     tcItem.mask = TCIF_PARAM;
 
     ret = SendMessageA(hTab, TCM_INSERTITEMA, 0, (LPARAM)&tcItem);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
 
     /* all sizeof(LPARAM) returned anyway when using sizeof(LPARAM)-1 size */
     memset(&lparam, 0xaa, sizeof(lparam));
@@ -847,7 +847,7 @@ static void test_getset_item(void)
     expect(TRUE, ret);
     /* everything higher specified size is preserved */
     memset(&lparam, 0xff, sizeof(lparam)-1);
-    ok(tcItem.lParam == lparam, "Expected 0x%lx, got 0x%lx\n", lparam, tcItem.lParam);
+    ok(tcItem.lParam == lparam, "Expected 0x%Ix, got 0x%Ix\n", lparam, tcItem.lParam);
 
     DestroyWindow(hTab);
 
@@ -862,7 +862,7 @@ static void test_getset_item(void)
     tcItem.mask = TCIF_PARAM;
     ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem);
     expect(FALSE, ret);
-    ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
+    ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
 
     memset(&tcItem, 0xcc, sizeof(tcItem));
     tcItem.mask = TCIF_IMAGE;
@@ -899,13 +899,13 @@ static void test_getset_item(void)
     tcItem.mask = TCIF_PARAM;
     ret = SendMessageA(hTab, TCM_GETITEMA, -1, (LPARAM)&tcItem);
     expect(FALSE, ret);
-    ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
+    ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
 
     memset(&tcItem, 0xcc, sizeof(tcItem));
     tcItem.mask = TCIF_PARAM;
     ret = SendMessageA(hTab, TCM_GETITEMA, -2, (LPARAM)&tcItem);
     expect(FALSE, ret);
-    ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam);
+    ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
@@ -1227,10 +1227,10 @@ static void test_TCM_SETITEMEXTRA(void)
     }
 
     ret = SendMessageA(hTab, TCM_SETITEMEXTRA, -1, 0);
-    ok(ret == FALSE, "got %d\n", ret);
+    ok(ret == FALSE, "got %ld\n", ret);
 
     ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0);
-    ok(ret == TRUE, "got %d\n", ret);
+    ok(ret == TRUE, "got %ld\n", ret);
     DestroyWindow(hTab);
 
     /* it's not possible to change extra data size for control with tabs */
@@ -1238,7 +1238,7 @@ static void test_TCM_SETITEMEXTRA(void)
     ok(hTab != NULL, "Failed to create tab control\n");
 
     ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0);
-    ok(ret == FALSE, "got %d\n", ret);
+    ok(ret == FALSE, "got %ld\n", ret);
     DestroyWindow(hTab);
 }
 
@@ -1270,7 +1270,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
 
     itemdata = 0;
     memset(&itemdata, 0xde, 4);
-    ok(g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
+    ok(g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
 
     DestroyWindow(hTab);
 
@@ -1301,7 +1301,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
     RedrawWindow(hTab, NULL, 0, RDW_UPDATENOW);
 
     memset(&itemdata, 0xde, sizeof(ULONG_PTR));
-    ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
+    ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
 
     DestroyWindow(hTab);
 
@@ -1334,7 +1334,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
     memset(&itemdata, 0xde, 4);
     memset(&itemdata2, 0xde, sizeof(LPARAM)-1);
     ok(g_drawitem.itemData == itemdata || broken(g_drawitem.itemData == itemdata2) /* win98 */,
-        "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata);
+        "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
 
     DestroyWindow(hTab);
 }
@@ -1378,7 +1378,7 @@ static void test_create(void)
         hTab = CreateWindowA(WC_TABCONTROLA, "TestTab", ptr->style,
             10, 10, 300, 100, parent_wnd, NULL, NULL, 0);
         style = GetWindowLongA(hTab, GWL_STYLE);
-        ok(style == ptr->act_style, "expected style 0x%08x, got style 0x%08x\n", ptr->act_style, style);
+        ok(style == ptr->act_style, "expected style 0x%08lx, got style 0x%08lx\n", ptr->act_style, style);
 
         DestroyWindow(hTab);
         ptr++;
diff --git a/dlls/comctl32/tests/taskdialog.c b/dlls/comctl32/tests/taskdialog.c
index 9c0b8772a59..6a12b185639 100644
--- a/dlls/comctl32/tests/taskdialog.c
+++ b/dlls/comctl32/tests/taskdialog.c
@@ -417,7 +417,7 @@ static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radi
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     hr = pTaskDialogIndirect(info, &ret_button, &ret_radio, &ret_verification);
-    ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#x.\n", hr);
+    ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#lx.\n", hr);
 
     ok_sequence_(sequences, TASKDIALOG_SEQ_INDEX, msg_start, context, FALSE, file, line);
     ok_(file, line)(ret_button == expect_button,
@@ -437,7 +437,7 @@ static HRESULT CALLBACK taskdialog_callback_proc(HWND hwnd, UINT notification,
     const struct message_info *msg_send;
     struct message msg;
 
-    ok(test_ref_data == ref_data, "Unexpected ref data %lu.\n", ref_data);
+    ok(test_ref_data == ref_data, "Unexpected ref data %Iu.\n", ref_data);
 
     init_test_message(notification, (short)wParam, lParam, &msg);
     add_message(sequences, TASKDIALOG_SEQ_INDEX, &msg);
@@ -458,19 +458,19 @@ static void test_invalid_parameters(void)
     HRESULT hr;
 
     hr = pTaskDialogIndirect(NULL, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
 
     info.cbSize = 0;
     hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
 
     info.cbSize = sizeof(TASKDIALOGCONFIG) - 1;
     hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
 
     info.cbSize = sizeof(TASKDIALOGCONFIG) + 1;
     hr = pTaskDialogIndirect(&info, NULL, NULL, NULL);
-    ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr);
+    ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
 }
 
 static void test_callback(void)
@@ -729,9 +729,9 @@ static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT no
 
         /* TDM_SET_PROGRESS_BAR_RANGE */
         ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
-        ok(ret == MAKELONG(0, 100), "Expect range:%x got:%lx\n", MAKELONG(0, 100), ret);
+        ok(ret == MAKELONG(0, 100), "Expect range:%lx got:%lx\n", MAKELONG(0, 100), ret);
         ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
-        ok(ret == MAKELONG(0, 200), "Expect range:%x got:%lx\n", MAKELONG(0, 200), ret);
+        ok(ret == MAKELONG(0, 200), "Expect range:%lx got:%lx\n", MAKELONG(0, 200), ret);
 
         /* TDM_SET_PROGRESS_BAR_POS */
         if (flags & TDF_SHOW_MARQUEE_PROGRESS_BAR)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index dcd95ffa4d8..80f9e067c00 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -216,7 +216,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
         case TBN_GETDISPINFOW:
             nmdisp = (NMTBDISPINFOA *)lParam;
 
-            compare(nmdisp->dwMask, g_dwExpectedDispInfoMask, "%x");
+            compare(nmdisp->dwMask, g_dwExpectedDispInfoMask, "%lx");
             ok(nmdisp->pszText == NULL, "pszText is not NULL\n");
         break;
         case TBN_SAVE:
@@ -260,7 +260,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
             if (restore->iItem == -1)
             {
                 ok( restore->cButtons == 25, "got %d\n", restore->cButtons );
-                ok( *restore->pCurrent == 0xcafe, "got %08x\n", *restore->pCurrent );
+                ok( *restore->pCurrent == 0xcafe, "got %08lx\n", *restore->pCurrent );
                 /* Skip the last one */
                 restore->cButtons = 11;
                 restore->pCurrent++;
@@ -269,7 +269,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
             }
             else
             {
-                ok( *restore->pCurrent == 0xcafe0000 + restore->iItem, "got %08x\n", *restore->pCurrent );
+                ok( *restore->pCurrent == 0xcafe0000 + restore->iItem, "got %08lx\n", *restore->pCurrent );
                 if (restore->iItem < 7 || restore->iItem == 10)
                 {
                     ok( restore->tbButton.iBitmap == -1, "got %08x\n", restore->tbButton.iBitmap );
@@ -291,8 +291,8 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
                     ok( restore->tbButton.fsStyle == BTNS_SEP, "%d: got %02x\n", restore->iItem, restore->tbButton.fsStyle );
                 }
 
-                ok( restore->tbButton.dwData == 0, "got %08lx\n", restore->tbButton.dwData );
-                ok( restore->tbButton.iString == 0, "got %08lx\n", restore->tbButton.iString );
+                ok( restore->tbButton.dwData == 0, "got %08Ix\n", restore->tbButton.dwData );
+                ok( restore->tbButton.iString == 0, "got %08Ix\n", restore->tbButton.iString );
 
                 restore->tbButton.iBitmap = 0;
                 restore->tbButton.fsState = TBSTATE_ENABLED;
@@ -467,12 +467,12 @@ static void basic_test(void)
     ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1008, 0), "B3 pressed\n");
 
     /* tests with invalid index */
-    compare(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), -1L, "%ld");
-    compare(SendMessageA(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), -1L, "%ld");
-    compare(SendMessageA(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), -1L, "%ld");
-    compare(SendMessageA(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), -1L, "%ld");
-    compare(SendMessageA(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), -1L, "%ld");
-    compare(SendMessageA(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), -1L, "%ld");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
+    compare(SendMessageA(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
 
     DestroyWindow(hToolbar);
 }
@@ -753,11 +753,11 @@ static void test_add_bitmap(void)
     /* however TB_SETBITMAPSIZE/add std bitmap won't change the image size (the button size does change) */
     ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(8, 8)) == TRUE, "TB_SETBITMAPSIZE failed\n");
     UpdateWindow(hToolbar);
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(15, 14), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(15, 14), "%lx");
     CHECK_IMAGELIST(10, 20, 15);
     ok(SendMessageA(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&stdsmall) == 1, "TB_SETBITMAPSIZE failed\n");
     UpdateWindow(hToolbar);
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%lx");
     CHECK_IMAGELIST(22, 20, 15);
 
     /* check standard bitmaps */
@@ -768,12 +768,12 @@ static void test_add_bitmap(void)
 
     ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
     CHECK_IMAGELIST(15, 16, 16);
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%lx");
     addbmp.nID = IDB_STD_LARGE_COLOR;
     rebuild_toolbar(&hToolbar);
     ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
     CHECK_IMAGELIST(15, 24, 24);
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(31, 30), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(31, 30), "%lx");
 
     addbmp.nID = IDB_VIEW_SMALL_COLOR;
     rebuild_toolbar(&hToolbar);
@@ -901,71 +901,71 @@ static void test_hotitem(void)
      * comctl6 doesn't have this requirement even when theme == NULL */
     SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_FLAT | GetWindowLongA(hToolbar, GWL_STYLE));
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == -1, "Hot item: %ld, expected -1\n", ret);
+    ok(ret == -1, "Hot item: %Id, expected -1\n", ret);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0);
-    ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret);
+    ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 1, "Hot item: %ld, expected 1\n", ret);
+    ok(ret == 1, "Hot item: %Id, expected 1\n", ret);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0);
-    ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret);
+    ok(ret == 1, "TB_SETHOTITEM returned %Id, expected 1\n", ret);
 
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeef, 0);
-    ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret);
+    ok(ret == 2, "TB_SETHOTITEM returned %Id, expected 2\n", ret);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 2, "Hot item: %lx, expected 2\n", ret);
+    ok(ret == 2, "Hot item: %Ix, expected 2\n", ret);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeef, 0);
-    ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret);
+    ok(ret == 2, "TB_SETHOTITEM returned %Id, expected 2\n", ret);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == -1, "Hot item: %lx, expected -1\n", ret);
+    ok(ret == -1, "Hot item: %Ix, expected -1\n", ret);
 
     expect_hot_notify(0, 7);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0);
-    ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret);
+    ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret);
     check_hot_notify();
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 3, "Hot item: %lx, expected 3\n", ret);
+    ok(ret == 3, "Hot item: %Ix, expected 3\n", ret);
     g_fBlockHotItemChange = TRUE;
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0);
-    ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 3, "Hot item: %lx, expected 3\n", ret);
+    ok(ret == 3, "Hot item: %Ix, expected 3\n", ret);
     g_fBlockHotItemChange = FALSE;
 
     g_fReceivedHotItemChange = FALSE;
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeaf, 0);
-    ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret);
     ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received for invalid parameter\n");
 
     g_fReceivedHotItemChange = FALSE;
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0);
-    ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret);
     ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received after a duplication\n");
 
     expect_hot_notify(7, 0);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeaf, 0);
-    ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret);
     check_hot_notify();
     SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0);
 
     /* setting disabled buttons will generate a notify with the button id but no button will be hot */
     expect_hot_notify(7, 9);
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 4, 0);
-    ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret);
     check_hot_notify();
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == -1, "Hot item: %lx, expected -1\n", ret);
+    ok(ret == -1, "Hot item: %Ix, expected -1\n", ret);
     /* enabling the button won't change that */
     SendMessageA(hToolbar, TB_ENABLEBUTTON, 9, TRUE);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret);
+    ok(ret == -1, "TB_GETHOTITEM returned %Id, expected -1\n", ret);
 
     /* disabling a hot button works */
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0);
-    ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret);
+    ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret);
     g_fReceivedHotItemChange = FALSE;
     SendMessageA(hToolbar, TB_ENABLEBUTTON, 7, FALSE);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 3, "TB_GETHOTITEM returned %ld, expected 3\n", ret);
+    ok(ret == 3, "TB_GETHOTITEM returned %Id, expected 3\n", ret);
     ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
 
     SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0);
@@ -975,17 +975,17 @@ static void test_hotitem(void)
     g_fReceivedHotItemChange = FALSE;
     ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&tbinfo) == TRUE, "TB_SETBUTTONINFOA failed\n");
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == 1, "TB_GETHOTITEM returned %ld, expected 1\n", ret);
+    ok(ret == 1, "TB_GETHOTITEM returned %Id, expected 1\n", ret);
     ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
 
     /* deleting a button unsets the hot item */
     ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0, 0);
-    ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret);
+    ok(ret == 1, "TB_SETHOTITEM returned %Id, expected 1\n", ret);
     g_fReceivedHotItemChange = FALSE;
     ret = SendMessageA(hToolbar, TB_DELETEBUTTON, 1, 0);
-    ok(ret == TRUE, "TB_DELETEBUTTON returned %ld, expected TRUE\n", ret);
+    ok(ret == TRUE, "TB_DELETEBUTTON returned %Id, expected TRUE\n", ret);
     ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
-    ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret);
+    ok(ret == -1, "TB_GETHOTITEM returned %Id, expected -1\n", ret);
     ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
 
     DestroyWindow(hToolbar);
@@ -1519,11 +1519,11 @@ static void test_sizes(void)
     /* -1 in TB_SETBITMAPSIZE is a special code meaning that the coordinate shouldn't be changed */
     add_128x15_bitmap(hToolbar, 16);
     ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(14, -1)), "TB_SETBITMAPSIZE failed\n");
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 21), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 21), "%lx");
     ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(-1, 12)), "TB_SETBITMAPSIZE failed\n");
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%lx");
     ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(-1, -1)), "TB_SETBITMAPSIZE failed\n");
-    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%x");
+    compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%lx");
     /* check the imagelist */
     InvalidateRect(hToolbar, NULL, TRUE);
     UpdateWindow(hToolbar);
@@ -1689,13 +1689,13 @@ static void test_sizes(void)
     SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)buttons1);
     check_sizes();
     GetClientRect(hToolbar, &rect);
-    ok(rect.top == 0, "rect.top = %d\n", rect.top);
-    ok(rect.bottom == 26, "rect.bottom = %d\n", rect.bottom);
+    ok(rect.top == 0, "rect.top = %ld\n", rect.top);
+    ok(rect.bottom == 26, "rect.bottom = %ld\n", rect.bottom);
 
     rebuild_toolbar_ex(&hToolbar, WS_EX_DLGMODALFRAME);
     GetClientRect(hToolbar, &rect);
-    ok(rect.top == 0, "rect.top = %d\n", rect.top);
-    ok(rect.bottom == 26, "rect.bottom = %d\n", rect.bottom);
+    ok(rect.top == 0, "rect.top = %ld\n", rect.top);
+    ok(rect.bottom == 26, "rect.bottom = %ld\n", rect.bottom);
 
     free_tbsize_results();
     DestroyWindow(hToolbar);
@@ -1714,7 +1714,7 @@ static void prepare_recalc_test(HWND *phToolbar)
     SetWindowLongA(*phToolbar, GWL_STYLE,
         GetWindowLongA(*phToolbar, GWL_STYLE) | TBSTYLE_FLAT);
     SendMessageA(*phToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect);
-    ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n",
+    ok(rect.top == 2, "Test will make no sense because initial top is %ld instead of 2\n",
         rect.top);
 }
 
@@ -1722,7 +1722,7 @@ static BOOL did_recalc(HWND hToolbar)
 {
     RECT rect;
     SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect);
-    ok(rect.top == 2 || rect.top == 0, "Unexpected top margin %d in recalc test\n",
+    ok(rect.top == 2 || rect.top == 0, "Unexpected top margin %ld in recalc test\n",
         rect.top);
     return (rect.top == 0);
 }
@@ -1741,7 +1741,7 @@ static void restore_recalc_state(HWND hToolbar)
                    SendMessageA(hToolbar, TB_GETSTYLE, 0, 0) | TBSTYLE_FLAT);
     /* safety check */
     SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect);
-    ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n",
+    ok(rect.top == 2, "Test will make no sense because initial top is %ld instead of 2\n",
         rect.top);
 }
 
@@ -1960,13 +1960,13 @@ static void test_dispinfo(void)
 
     ret = (BOOL)SendMessageA(hToolbar, CCM_SETUNICODEFORMAT, TRUE, 0);
     compare(ret, FALSE, "%d");
-    compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), 1L, "%ld");
+    compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), (LRESULT)1L, "%Id");
     InvalidateRect(hToolbar, NULL, FALSE);
     UpdateWindow(hToolbar);
 
     ret = (BOOL)SendMessageA(hToolbar, CCM_SETUNICODEFORMAT, FALSE, 0);
     compare(ret, TRUE, "%d");
-    compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), 0L, "%ld");
+    compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), (LRESULT)0L, "%Id");
     InvalidateRect(hToolbar, NULL, FALSE);
     UpdateWindow(hToolbar);
 
@@ -2023,7 +2023,7 @@ static void test_setrows(void)
 
         rows = SendMessageA(hToolbar, TB_GETROWS, MAKELONG(0,0), MAKELONG(0,0));
         ok(rows == tbrows_results[i].expectedRows,
-                   "[%d] Unexpected number of rows %d (expected %d)\n", i, rows,
+                   "[%ld] Unexpected number of rows %d (expected %d)\n", i, rows,
                    tbrows_results[i].expectedRows);
     }
 
@@ -2133,25 +2133,25 @@ static void test_get_set_style(void)
     style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0);
     style2 = GetWindowLongA(hToolbar, GWL_STYLE);
     todo_wine
-    ok(style == style2, "got 0x%08x, expected 0x%08x\n", style, style2);
+    ok(style == style2, "got 0x%08lx, expected 0x%08lx\n", style, style2);
 
     /* try to alter common window bits */
     style2 |= WS_BORDER;
     ret = SendMessageA(hToolbar, TB_SETSTYLE, 0, style2);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0);
     style2 = GetWindowLongA(hToolbar, GWL_STYLE);
     ok((style != style2) && (style == (style2 | WS_BORDER)),
-        "got 0x%08x, expected 0x%08x\n", style, style2);
-    ok(style & WS_BORDER, "got 0x%08x\n", style);
+        "got 0x%08lx, expected 0x%08lx\n", style, style2);
+    ok(style & WS_BORDER, "got 0x%08lx\n", style);
 
     /* now styles are the same, alter window style */
     ret = SendMessageA(hToolbar, TB_SETSTYLE, 0, style2);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
     style2 |= WS_BORDER;
     SetWindowLongA(hToolbar, GWL_STYLE, style2);
     style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0);
-    ok(style == style2, "got 0x%08x, expected 0x%08x\n", style, style2);
+    ok(style == style2, "got 0x%08lx, expected 0x%08lx\n", style, style2);
 
     DestroyWindow(hToolbar);
 }
@@ -2179,13 +2179,13 @@ static LRESULT WINAPI toolbar_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam,
 
             /* control is already set up */
             style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
-            ok(style != 0, "got %x\n", style);
+            ok(style != 0, "got %lx\n", style);
 
             style = GetWindowLongA(hwnd, GWL_STYLE);
-            ok((style & TBSTYLE_TOOLTIPS) == 0, "got 0x%08x\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == 0, "got 0x%08lx\n", style);
             SetWindowLongA(hwnd, GWL_STYLE, style|TBSTYLE_TOOLTIPS);
             style = GetWindowLongA(hwnd, GWL_STYLE);
-            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
 
             return ret;
         }
@@ -2199,23 +2199,23 @@ static LRESULT WINAPI toolbar_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam,
             CHECK_EXPECT2(g_hook_WM_CREATE);
 
             style = GetWindowLongA(hwnd, GWL_STYLE);
-            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
 
             /* test if toolbar-specific messages are already working before WM_CREATE */
             style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
-            ok(style != 0, "got %x\n", style);
-            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%x\n", style);
-            ok((cs->style & TBSTYLE_TOOLTIPS) == 0, "0x%08x\n", cs->style);
+            ok(style != 0, "got %lx\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%lx\n", style);
+            ok((cs->style & TBSTYLE_TOOLTIPS) == 0, "0x%08lx\n", cs->style);
 
             ret = CallWindowProcA(oldproc, hwnd, msg, wParam, lParam);
 
             style = GetWindowLongA(hwnd, GWL_STYLE);
-            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
 
             /* test if toolbar-specific messages are already working before WM_CREATE */
             style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
-            ok(style != 0, "got %x\n", style);
-            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%x\n", style);
+            ok(style != 0, "got %lx\n", style);
+            ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%lx\n", style);
 
             return ret;
         }
@@ -2276,11 +2276,11 @@ static void test_create(BOOL v6)
     style = GetWindowLongA(hwnd, GWL_STYLE);
     if (v6)
     {
-        ok(!(style & TBSTYLE_TOOLTIPS), "got 0x%08x\n", style);
+        ok(!(style & TBSTYLE_TOOLTIPS), "got 0x%08lx\n", style);
     }
     else
     {
-        ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style);
+        ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
 
         tooltip = (HWND)SendMessageA(hwnd, TB_GETTOOLTIPS, 0, 0);
         ok(tooltip != NULL, "got %p\n", tooltip);
@@ -2296,10 +2296,10 @@ static void test_create(BOOL v6)
         0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL);
 
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08x\n", style);
+    ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08lx\n", style);
 
     style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
-    ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08x\n", style);
+    ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 
@@ -2314,10 +2314,10 @@ static void test_create(BOOL v6)
                          GetModuleHandleA(NULL), NULL);
 
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08x\n", style);
+    ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08lx\n", style);
 
     style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
-    ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08x\n", style);
+    ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 }
@@ -2384,20 +2384,20 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void)
         oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0);
 
         oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, ptr->mask, ptr->style);
-        ok(oldstyle == oldstyle2, "%d: got old style 0x%08x, expected 0x%08x\n", i, oldstyle, oldstyle2);
+        ok(oldstyle == oldstyle2, "%d: got old style 0x%08lx, expected 0x%08lx\n", i, oldstyle, oldstyle2);
         style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0);
-        ok(style == ptr->style_set, "%d: got style 0x%08x, expected 0x%08x\n", i, style, ptr->style_set);
+        ok(style == ptr->style_set, "%d: got style 0x%08lx, expected 0x%08lx\n", i, style, ptr->style_set);
     }
 
     /* Windows sets CCS_VERT when TB_GETEXTENDEDSTYLE is set */
     oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0);
     oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_VERTICAL);
-    ok(oldstyle == oldstyle2, "got old style 0x%08x, expected 0x%08x\n", oldstyle, oldstyle2);
+    ok(oldstyle == oldstyle2, "got old style 0x%08lx, expected 0x%08lx\n", oldstyle, oldstyle2);
     style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0);
-    ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08x, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL);
+    ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08lx, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL);
     style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0);
     todo_wine
-    ok(style == CCS_VERT, "got style 0x%08x, expected CCS_VERT\n", style);
+    ok(style == CCS_VERT, "got style 0x%08lx, expected CCS_VERT\n", style);
 
     DestroyWindow(hwnd);
 }
@@ -2504,11 +2504,11 @@ static void test_save(void)
     DestroyWindow( wnd );
 
     res = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\WineTest", &key );
-    ok( !res, "got %08x\n", res );
+    ok( !res, "got %08lx\n", res );
     res = RegQueryValueExW( key, L"toolbartest", NULL, &type, data, &size );
-    ok( !res, "got %08x\n", res );
-    ok( type == REG_BINARY, "got %08x\n", type );
-    ok( size == sizeof(expect), "got %08x\n", size );
+    ok( !res, "got %08lx\n", res );
+    ok( type == REG_BINARY, "got %08lx\n", type );
+    ok( size == sizeof(expect), "got %08lx\n", size );
     ok( !memcmp( data, expect, size ), "mismatch\n" );
 
     RegCloseKey( key );
@@ -2521,23 +2521,23 @@ static void test_save(void)
     ok( res, "restoring failed\n" );
     ok_sequence(sequences, PARENT_SEQ_INDEX, restore_parent_seq, "restore", FALSE);
     count = SendMessageW( wnd, TB_BUTTONCOUNT, 0, 0 );
-    ok( count == ARRAY_SIZE(expect_btns), "got %d\n", count );
+    ok( count == ARRAY_SIZE(expect_btns), "got %ld\n", count );
 
     for (i = 0; i < count; i++)
     {
         res = SendMessageW( wnd, TB_GETBUTTON, i, (LPARAM)&tb );
-        ok( res, "got %d\n", res );
+        ok( res, "got %ld\n", res );
 
-        ok( tb.iBitmap == expect_btns[i].iBitmap, "%d: got %d\n", i, tb.iBitmap );
-        ok( tb.idCommand == expect_btns[i].idCommand, "%d: got %d\n", i, tb.idCommand );
-        ok( tb.fsState == expect_btns[i].fsState, "%d: got %02x\n", i, tb.fsState );
-        ok( tb.fsStyle == expect_btns[i].fsStyle, "%d: got %02x\n", i, tb.fsStyle );
-        ok( tb.dwData == expect_btns[i].dwData, "%d: got %lx\n", i, tb.dwData );
+        ok( tb.iBitmap == expect_btns[i].iBitmap, "%ld: got %d\n", i, tb.iBitmap );
+        ok( tb.idCommand == expect_btns[i].idCommand, "%ld: got %d\n", i, tb.idCommand );
+        ok( tb.fsState == expect_btns[i].fsState, "%ld: got %02x\n", i, tb.fsState );
+        ok( tb.fsStyle == expect_btns[i].fsStyle, "%ld: got %02x\n", i, tb.fsStyle );
+        ok( tb.dwData == expect_btns[i].dwData, "%ld: got %Ix\n", i, tb.dwData );
         if (IS_INTRESOURCE(expect_btns[i].iString))
-            ok( tb.iString == expect_btns[i].iString, "%d: got %lx\n", i, tb.iString );
+            ok( tb.iString == expect_btns[i].iString, "%ld: got %Ix\n", i, tb.iString );
         else
             ok( !strcmp( (char *)tb.iString, (char *)expect_btns[i].iString ),
-                "%d: got %s\n", i, (char *)tb.iString );
+                "%ld: got %s\n", i, (char *)tb.iString );
 
         /* In fact the ptr value set in TBN_GETBUTTONINFOA is simply copied */
         if (tb.idCommand == 7)
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
index 7570ea68b0a..3bde35250cc 100644
--- a/dlls/comctl32/tests/tooltips.c
+++ b/dlls/comctl32/tests/tooltips.c
@@ -27,7 +27,7 @@
 #include "v6util.h"
 #include "msg.h"
 
-#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
+#define expect(expected, got) ok(got == expected, "Expected %d, got %ld\n", expected, got)
 
 enum seq_index
 {
@@ -55,7 +55,7 @@ static void test_create_tooltip(BOOL is_v6)
     style = GetWindowLongA(hwnd, GWL_STYLE);
     exp_style = 0x7fffffff | WS_POPUP;
     exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME);
-    ok(style == exp_style, "wrong style %08x/%08x\n", style, exp_style);
+    ok(style == exp_style, "wrong style %08lx/%08lx\n", style, exp_style);
 
     DestroyWindow(hwnd);
 
@@ -70,7 +70,7 @@ static void test_create_tooltip(BOOL is_v6)
         exp_style |= WS_BORDER;
     todo_wine_if(is_v6)
     ok(style == exp_style || broken(style == (exp_style | WS_BORDER)) /* XP */,
-        "Unexpected window style %#x.\n", style);
+        "Unexpected window style %#lx.\n", style);
 
     DestroyWindow(hwnd);
 
@@ -196,7 +196,7 @@ static void test_customdraw(void) {
                                50, 50,
                                300, 300,
                                NULL, NULL, NULL, 0);
-       ok(parent != NULL, "%d: Creation of main window failed\n", iterationNumber);
+       ok(parent != NULL, "%ld: Creation of main window failed\n", iterationNumber);
 
        /* Make it show */
        ShowWindow(parent, SW_SHOWNORMAL);
@@ -208,7 +208,7 @@ static void test_customdraw(void) {
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 CW_USEDEFAULT, CW_USEDEFAULT,
                                 parent, NULL, GetModuleHandleA(NULL), 0);
-       ok(hwndTip != NULL, "%d: Creation of tooltip window failed\n", iterationNumber);
+       ok(hwndTip != NULL, "%ld: Creation of tooltip window failed\n", iterationNumber);
 
        /* Set up parms for the wndproc to handle */
        CD_Stages = 0;
@@ -229,7 +229,7 @@ static void test_customdraw(void) {
        toolInfo.lParam = 0xdeadbeef;
        GetClientRect (parent, &toolInfo.rect);
        ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
-       ok(ret, "%d: Failed to add the tool.\n", iterationNumber);
+       ok(ret, "%ld: Failed to add the tool.\n", iterationNumber);
 
        /* Make tooltip appear quickly */
        SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0));
@@ -243,23 +243,23 @@ static void test_customdraw(void) {
        {
            /* Check CustomDraw results */
            ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls,
-              "%d: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages,
+              "%ld: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages,
               expectedResults[iterationNumber].ExpectedCalls);
        }
 
        ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0);
-       ok(ret, "%d: Failed to get current tool %#lx.\n", iterationNumber, ret);
+       ok(ret, "%ld: Failed to get current tool %#Ix.\n", iterationNumber, ret);
 
        memset(&toolInfo, 0xcc, sizeof(toolInfo));
        toolInfo.cbSize = sizeof(toolInfo);
        toolInfo.lpszText = NULL;
        toolInfo.lpReserved = (void *)0xdeadbeef;
        SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo);
-       ok(toolInfo.hwnd == parent, "%d: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd);
-       ok(toolInfo.hinst == GetModuleHandleA(NULL), "%d: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst);
-       ok(toolInfo.uId == 0x1234abcd, "%d: Unexpected uId %lx.\n", iterationNumber, toolInfo.uId);
-       ok(toolInfo.lParam == 0, "%d: Unexpected lParam %lx.\n", iterationNumber, toolInfo.lParam);
-       ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%d: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved);
+       ok(toolInfo.hwnd == parent, "%ld: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd);
+       ok(toolInfo.hinst == GetModuleHandleA(NULL), "%ld: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst);
+       ok(toolInfo.uId == 0x1234abcd, "%ld: Unexpected uId %Ix.\n", iterationNumber, toolInfo.uId);
+       ok(toolInfo.lParam == 0, "%ld: Unexpected lParam %Ix.\n", iterationNumber, toolInfo.lParam);
+       ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%ld: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved);
 
        /* Clean up */
        DestroyWindow(hwndTip);
@@ -378,19 +378,19 @@ static void test_gettext(void)
     toolinfoA.lParam = 0xdeadbeef;
     GetClientRect(hwnd, &toolinfoA.rect);
     r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
-    ok(r, "got %ld\n", r);
+    ok(r, "got %Id\n", r);
 
     toolinfoA.hwnd = NULL;
     toolinfoA.uId = 0x1234abcd;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!*toolinfoA.lpszText, "lpszText should be empty, got %s\n", toolinfoA.lpszText);
 
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
     todo_wine
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(toolinfoA.lpszText == NULL, "expected NULL, got %p\n", toolinfoA.lpszText);
 
     /* NULL hinst, valid resource id for text */
@@ -409,17 +409,17 @@ static void test_gettext(void)
     toolinfoA.uId = 0x1233abcd;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, "abc"), "got wrong text, %s\n", toolinfoA.lpszText);
 
     toolinfoA.hinst = (HINSTANCE)0xdeadbee;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
     todo_wine
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(toolinfoA.hinst == NULL, "expected NULL, got %p\n", toolinfoA.hinst);
 
     r = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
 
     /* add another tool with text */
     toolinfoA.cbSize = sizeof(TTTOOLINFOA);
@@ -435,24 +435,24 @@ static void test_gettext(void)
     ok(r, "Adding the tool to the tooltip failed\n");
 
     length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0);
-    ok(length == 0, "Expected 0, got %d\n", length);
+    ok(length == 0, "Expected 0, got %ld\n", length);
 
     toolinfoA.hwnd = NULL;
     toolinfoA.uId = 0x1235abcd;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
 
     memset(bufA, 0x1f, sizeof(bufA));
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
     todo_wine
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
 
     length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0);
-    ok(length == 0, "Expected 0, got %d\n", length);
+    ok(length == 0, "Expected 0, got %ld\n", length);
 
     /* add another with callback text */
     toolinfoA.cbSize = sizeof(TTTOOLINFOA);
@@ -470,13 +470,13 @@ static void test_gettext(void)
     toolinfoA.uId = 0x1236abcd;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, testcallbackA), "lpszText should be an (%s) string\n", testcallbackA);
 
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
     todo_wine
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(toolinfoA.lpszText == LPSTR_TEXTCALLBACKA, "expected LPSTR_TEXTCALLBACKA, got %p\n", toolinfoA.lpszText);
 
     DestroyWindow(hwnd);
@@ -518,13 +518,13 @@ static void test_gettext(void)
     toolinfoA.lParam = 0xdeadbeef;
     GetClientRect(hwnd, &toolinfoA.rect);
     r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
-    ok(r, "got %ld\n", r);
+    ok(r, "got %Id\n", r);
 
     toolinfoA.hwnd = NULL;
     toolinfoA.uId = 0x1235abce;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %s\n", testtipA, toolinfoA.lpszText);
 
     /* enable TTS_NOPREFIX, original text is retained */
@@ -535,7 +535,7 @@ static void test_gettext(void)
     toolinfoA.uId = 0x1235abce;
     toolinfoA.lpszText = bufA;
     r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
-    ok(!r, "got %ld\n", r);
+    ok(!r, "got %Id\n", r);
     ok(!strcmp(toolinfoA.lpszText, testtip2A), "expected %s, got %s\n", testtip2A, toolinfoA.lpszText);
 
     DestroyWindow(hwnd);
@@ -566,7 +566,7 @@ static void test_ttm_gettoolinfo(void)
     ti.lParam = 0xaaaaaaaa;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti);
     ok(r, "Getting tooltip info failed\n");
-    ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %lx\n", ti.lParam);
+    ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %Ix\n", ti.lParam);
 
     tiW.cbSize = TTTOOLINFOW_V2_SIZE;
     tiW.hwnd = NULL;
@@ -575,7 +575,7 @@ static void test_ttm_gettoolinfo(void)
     tiW.lpszText = NULL;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW);
     ok(r, "Getting tooltip info failed\n");
-    ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %lx\n", tiW.lParam);
+    ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %Ix\n", tiW.lParam);
 
     ti.cbSize = TTTOOLINFOA_V2_SIZE;
     ti.uId = 0x1234ABCD;
@@ -586,7 +586,7 @@ static void test_ttm_gettoolinfo(void)
     ti.lParam = 0xdeadbeef;
     r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti);
     ok(r, "Getting tooltip info failed\n");
-    ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %lx\n", ti.lParam);
+    ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %Ix\n", ti.lParam);
 
     DestroyWindow(hwnd);
 
@@ -890,16 +890,16 @@ static void test_track(void)
     SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));
 
     GetWindowRect(tt, &pos);
-    ok(almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
-    ok(almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
+    ok(almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left);
+    ok(almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);
 
     info.uFlags = TTF_IDISHWND | TTF_ABSOLUTE;
     SendMessageW(tt, TTM_SETTOOLINFOW, 0, (LPARAM)&info);
     SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));
 
     GetWindowRect(tt, &pos);
-    ok(!almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
-    ok(!almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
+    ok(!almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left);
+    ok(!almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);
 
     DestroyWindow(tt);
     DestroyWindow(parent);
@@ -1066,27 +1066,27 @@ static void test_margin(void)
     ok(hwnd != NULL, "failed to create tooltip wnd\n");
 
     ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
 
     SetRect(&r, -1, -1, 1, 1);
     ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
 
     SetRectEmpty(&r1);
     ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
     ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
 
     ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
 
     SetRectEmpty(&r1);
     ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
     ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
 
     ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0);
-    ok(!ret, "got %d\n", ret);
+    ok(!ret, "got %ld\n", ret);
 
     DestroyWindow(hwnd);
 }
diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c
index 70b61d4db20..a367b7e699c 100644
--- a/dlls/comctl32/tests/trackbar.c
+++ b/dlls/comctl32/tests/trackbar.c
@@ -28,7 +28,7 @@
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define NUM_MSG_SEQUENCE 2
@@ -722,21 +722,21 @@ static void test_position(void)
     r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
     ok(r == 25, "got %d\n", r);
     SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2);
-    ok(rect.left == rect2.left, "got %d\n", rect.left);
+    ok(rect.left == rect2.left, "got %ld\n", rect.left);
 
     /* with repaint */
     SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 30);
     r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
     ok(r == 30, "got %d\n", r);
     SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2);
-    ok(rect.left != rect2.left, "got %d, expected %d\n", rect2.left, rect.left);
+    ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect2.left, rect.left);
 
     /* now move it with keys */
     SendMessageA(hWndTrackbar, WM_KEYDOWN, VK_END, 0);
     r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0);
     ok(r == 100, "got %d\n", r);
     SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect);
-    ok(rect.left != rect2.left, "got %d, expected %d\n", rect.left, rect2.left);
+    ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect.left, rect2.left);
 
     DestroyWindow(hWndTrackbar);
 }
@@ -1114,7 +1114,7 @@ static void test_tic_placement(void)
     SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0);
 
     numtics = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0);
-    ok(numtics == 6, "Expected 6, got %d\n", numtics);
+    ok(numtics == 6, "Expected 6, got %ld\n", numtics);
 
     flush_sequences(sequences, NUM_MSG_SEQUENCE);
     /* test TBM_GETPTICS */
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 45e2091f3b2..41a61f1465b 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -60,7 +60,7 @@ static BOOL g_v6;
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
@@ -800,17 +800,17 @@ static void test_get_set_bkcolor(void)
 
     /* If the value is -1, the control is using the system color for the background color. */
     crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
-    ok(crColor == ~0u, "Default background color reported as 0x%.8x\n", crColor);
+    ok(crColor == ~0u, "Default background color reported as 0x%.8lx\n", crColor);
 
     /* Test for black background */
     SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0));
     crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
-    ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor);
+    ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8lx\n", crColor);
 
     /* Test for white background */
     SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255));
     crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0);
-    ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor);
+    ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8lx\n", crColor);
 
     /* Reset the default background */
     SendMessageA(hTree, TVM_SETBKCOLOR, 0, -1);
@@ -884,7 +884,7 @@ static void test_get_set_insertmark(void)
 
     SendMessageA(hTree, TVM_SETINSERTMARKCOLOR, 0, crColor);
     crColor = SendMessageA(hTree, TVM_GETINSERTMARKCOLOR, 0, 0);
-    ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8x, expected 0x00000000\n", crColor);
+    ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8lx, expected 0x00000000\n", crColor);
 
     ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_insertmarkcolor_seq,
         "test get set insertmark color", FALSE);
@@ -1057,17 +1057,17 @@ static void test_get_set_textcolor(void)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
-    ok(crColor == ~0u, "Default text color reported as 0x%.8x\n", crColor);
+    ok(crColor == ~0u, "Default text color reported as 0x%.8lx\n", crColor);
 
     /* Test for black text */
     SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0));
     crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
-    ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor);
+    ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8lx\n", crColor);
 
     /* Test for white text */
     SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255));
     crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0);
-    ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor);
+    ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8lx\n", crColor);
 
     /* Reset the default text color */
     SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, CLR_NONE);
@@ -1359,7 +1359,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
                   g_item_expanding.mask = TVIF_STATE;
                   g_item_expanding.hItem = hRoot;
                   ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanding);
-                  ok(ret == TRUE, "got %lu\n", ret);
+                  ok(ret == TRUE, "got %Iu\n", ret);
                 }
                 break;
               }
@@ -1375,7 +1375,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
                   g_item_expanded.mask = TVIF_STATE;
                   g_item_expanded.hItem = hRoot;
                   ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanded);
-                  ok(ret == TRUE, "got %lu\n", ret);
+                  ok(ret == TRUE, "got %Iu\n", ret);
                 }
                 if (g_get_rect_in_expand)
                 {
@@ -1424,9 +1424,9 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
                     return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT;
                 case CDDS_ITEMPREPAINT:
                     ok(text == nmcd->clrText || (g_v6 && nmcd->clrText == 0xffffffff),
-                       "got %08x vs %08x\n", text, nmcd->clrText);
+                       "got %08lx vs %08lx\n", text, nmcd->clrText);
                     ok(bkgnd == nmcd->clrTextBk || (g_v6 && nmcd->clrTextBk == 0xffffffff),
-                       "got %08x vs %08x\n", bkgnd, nmcd->clrTextBk);
+                       "got %08lx vs %08lx\n", bkgnd, nmcd->clrTextBk);
                     nmcd->clrText = cafe;
                     nmcd->clrTextBk = c0ffee;
                     SetTextColor(nmcd->nmcd.hdc, c0ffee);
@@ -1436,10 +1436,10 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
                     return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT;
                 case CDDS_ITEMPOSTPAINT:
                     /* at the point of post paint notification colors are already restored */
-                    ok(nmcd->clrText == cafe, "got 0%x\n", nmcd->clrText);
-                    ok(nmcd->clrTextBk == c0ffee, "got 0%x\n", nmcd->clrTextBk);
-                    ok(text != cafe, "got 0%x\n", text);
-                    ok(bkgnd != c0ffee, "got 0%x\n", bkgnd);
+                    ok(nmcd->clrText == cafe, "got 0%lx\n", nmcd->clrText);
+                    ok(nmcd->clrTextBk == c0ffee, "got 0%lx\n", nmcd->clrTextBk);
+                    ok(text != cafe, "got 0%lx\n", text);
+                    ok(bkgnd != c0ffee, "got 0%lx\n", bkgnd);
                     if (g_customdraw_font)
                         ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n",
                            GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT));
@@ -1587,8 +1587,8 @@ static void test_expand(void)
     *(HTREEITEM *)&rect = first;
     visible = SendMessageA(tv, TVM_GETITEMRECT, FALSE, (LPARAM)&rect);
     ok(visible, "first node should be visible\n");
-    ok(!rect.left, "rect.left = %d\n", rect.left);
-    ok(!rect.top, "rect.top = %d\n", rect.top);
+    ok(!rect.left, "rect.left = %ld\n", rect.left);
+    ok(!rect.top, "rect.top = %ld\n", rect.top);
     ok(rect.right, "rect.right = 0\n");
     ok(rect.bottom, "rect.bottom = 0\n");
 
@@ -1705,7 +1705,7 @@ static void test_itemedit(void)
     r = SetWindowTextA(edit, buffA);
     expect(TRUE, r);
     r = GetWindowTextA(edit, buffA, ARRAY_SIZE(buffA));
-    ok( r == ARRAY_SIZE(buffA) - 1, "got %d\n", r );
+    ok( r == ARRAY_SIZE(buffA) - 1, "got %ld\n", r );
     /* ...but it's trimmed to MAX_PATH chars when editing ends */
     r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
     expect(0, r);
@@ -2141,7 +2141,7 @@ static void test_WM_PAINT(void)
     hTree = create_treeview_control(0);
 
     clr = SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255, 0, 0));
-    ok(clr == ~0u, "got %d, expected -1\n", clr);
+    ok(clr == ~0u, "got %ld, expected -1\n", clr);
 
     hdc = GetDC(hMainWnd);
 
@@ -2149,10 +2149,10 @@ static void test_WM_PAINT(void)
     FillRect(hdc, &rc, GetStockObject(BLACK_BRUSH));
 
     clr = GetPixel(hdc, 1, 1);
-    ok(clr == RGB(0, 0, 0), "got 0x%x\n", clr);
+    ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);
 
     ret = SendMessageA(hTree, WM_PAINT, (WPARAM)hdc, 0);
-    ok(ret == 0, "got %d\n", ret);
+    ok(ret == 0, "got %ld\n", ret);
 
     clr = GetPixel(hdc, 1, 1);
     htheme = pGetWindowTheme(hTree);
@@ -2160,7 +2160,7 @@ static void test_WM_PAINT(void)
     ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */
        /* When theming is on and treeview glyphs are transparent, parent window needs to be repainted */
        || (is_glyph_transparent && clr == GetSysColor(COLOR_WINDOW)),
-        "got 0x%x\n", clr);
+        "got 0x%lx\n", clr);
 
     ReleaseDC(hMainWnd, hdc);
 
@@ -2191,8 +2191,8 @@ static void test_delete_items(void)
 
     if (item_sequence[0]->count == 2)
     {
-      ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%lx\n", hChild, msg[0].lParam);
-      ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%lx\n", hRoot, msg[1].lParam);
+      ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%Ix\n", hChild, msg[0].lParam);
+      ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%Ix\n", hRoot, msg[1].lParam);
     }
 
     ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0);
@@ -2334,7 +2334,7 @@ static void _check_item(HWND hwnd, HTREEITEM item, BOOL is_version_6, int line)
             width = data->width;
     todo_wine
         ok_(__FILE__, line)(width == (rect.right - rect.left) || broken(is_version_6 && width == 0) /* XP */,
-                "Width %d, rect width %d.\n", width, rect.right - rect.left);
+                "Width %d, rect width %ld.\n", width, rect.right - rect.left);
     }
 }
 
@@ -2647,7 +2647,7 @@ static void test_WM_GETDLGCODE(void)
     hTree = create_treeview_control(0);
 
     code = SendMessageA(hTree, WM_GETDLGCODE, VK_TAB, 0);
-    ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08x\n", code);
+    ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08lx\n", code);
 
     DestroyWindow(hTree);
 }
@@ -2707,7 +2707,7 @@ static void test_TVS_FULLROWSELECT(void)
     hwnd = create_treeview_control(TVS_FULLROWSELECT);
 
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08x\n", style);
+    ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 
@@ -2717,7 +2717,7 @@ static void test_TVS_FULLROWSELECT(void)
     style = GetWindowLongA(hwnd, GWL_STYLE);
     SetWindowLongA(hwnd, GWL_STYLE, style | TVS_FULLROWSELECT);
     style = GetWindowLongA(hwnd, GWL_STYLE);
-    ok(style & TVS_FULLROWSELECT, "got style 0x%08x\n", style);
+    ok(style & TVS_FULLROWSELECT, "got style 0x%08lx\n", style);
 
     DestroyWindow(hwnd);
 }
diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c
index 6ffdcb9e1ab..3a475318a25 100644
--- a/dlls/comctl32/tests/updown.c
+++ b/dlls/comctl32/tests/updown.c
@@ -53,7 +53,7 @@
 #define expect(expected,got) expect_(__LINE__, expected, got)
 static inline void expect_(unsigned line, DWORD expected, DWORD got)
 {
-    ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
+    ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
 }
 
 #define NUM_MSG_SEQUENCES   3
@@ -806,7 +806,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.right = 0;
     GetClientRect(updown, &r);
-    ok(r.right > 0, "Expected default width, got %d\n", r.right);
+    ok(r.right > 0, "Expected default width, got %ld\n", r.right);
     DestroyWindow(updown);
     /* create with really small width */
     updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 2, 0,
@@ -814,7 +814,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.right = 0;
     GetClientRect(updown, &r);
-    ok(r.right != 2 && r.right > 0, "Expected default width, got %d\n", r.right);
+    ok(r.right != 2 && r.right > 0, "Expected default width, got %ld\n", r.right);
     DestroyWindow(updown);
     /* create with width greater than default */
     updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 100, 0,
@@ -822,7 +822,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.right = 0;
     GetClientRect(updown, &r);
-    ok(r.right < 100 && r.right > 0, "Expected default width, got %d\n", r.right);
+    ok(r.right < 100 && r.right > 0, "Expected default width, got %ld\n", r.right);
     DestroyWindow(updown);
     /* create with zero height, UDS_HORZ */
     updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0,
@@ -830,7 +830,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.bottom = 0;
     GetClientRect(updown, &r);
-    ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom);
+    ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom);
     DestroyWindow(updown);
     /* create with really small height, UDS_HORZ */
     updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 2,
@@ -838,7 +838,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.bottom = 0;
     GetClientRect(updown, &r);
-    ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom);
+    ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom);
     DestroyWindow(updown);
     /* create with height greater than default, UDS_HORZ */
     updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 100,
@@ -846,7 +846,7 @@ static void test_updown_create(void)
     ok(updown != NULL, "Failed to create updown control\n");
     r.bottom = 0;
     GetClientRect(updown, &r);
-    ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %d\n", r.bottom);
+    ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %ld\n", r.bottom);
     DestroyWindow(updown);
 }
 
@@ -987,9 +987,9 @@ static void test_UDS_SETBUDDY(void)
 
     updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_ARROWKEYS, g_edit);
     ret = SetWindowPos(g_edit, 0, 100, 100, start_width, start_height, SWP_NOACTIVATE | SWP_NOZORDER);
-    ok(ret, "SetWindowPos failed, error %u.\n", GetLastError());
+    ok(ret, "SetWindowPos failed, error %lu.\n", GetLastError());
     ret = GetWindowRect(g_edit, &rect);
-    ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
+    ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
     width = rect.right - rect.left;
     height = rect.bottom - rect.top;
     ok(width == start_width, "Expected width %d, got %d.\n", start_width, width);
@@ -997,13 +997,13 @@ static void test_UDS_SETBUDDY(void)
 
     SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0);
     ret = GetWindowRect(g_edit, &rect);
-    ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
+    ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
     updown_width = start_width - (rect.right - rect.left);
     ok(updown_width > 0, "Expected updown width > 0, got %d.\n", updown_width);
 
     SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0);
     ret = GetWindowRect(g_edit, &rect);
-    ok(ret, "GetWindowRect failed, error %u.\n", GetLastError());
+    ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError());
     width = rect.right - rect.left;
     height = rect.bottom - rect.top;
     ok(width == start_width - 2 * updown_width, "Expected width %d, got %d.\n",
diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h
index 626f6e61255..fc32616d777 100644
--- a/dlls/comctl32/tests/v6util.h
+++ b/dlls/comctl32/tests/v6util.h
@@ -107,7 +107,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
     hmod = GetModuleHandleA("comctl32.dll");
 
     ret = ActivateActCtx(*hCtx, pcookie);
-    ok(ret, "Failed to activate context, error %d.\n", GetLastError());
+    ok(ret, "Failed to activate context, error %ld.\n", GetLastError());
 
     if (!ret)
     {
@@ -118,7 +118,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
     data.cbSize = sizeof(data);
     ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
         "comctl32.dll", &data);
-    ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError());
+    ok(ret, "failed to find comctl32.dll in active context, %lu\n", GetLastError());
     if (ret)
     {
         FreeLibrary(hmod);




More information about the wine-devel mailing list