Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 4 participants
- 84544 discussions
[PATCH v2 2/5] win32u: Move NtUserDestroyWindow implementation from user32.
by Huw Davies March 17, 2022
by Huw Davies March 17, 2022
March 17, 2022
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/user32/clipboard.c | 23 ---
dlls/user32/combo.c | 2 +-
dlls/user32/dde_misc.c | 6 +-
dlls/user32/dde_server.c | 2 +-
dlls/user32/defwnd.c | 2 +-
dlls/user32/dialog.c | 4 +-
dlls/user32/driver.c | 7 +-
dlls/user32/mdi.c | 2 +-
dlls/user32/menu.c | 8 +-
dlls/user32/message.c | 2 -
dlls/user32/msgbox.c | 70 ++++----
dlls/user32/painting.c | 12 --
dlls/user32/user32.spec | 2 +-
dlls/user32/user_main.c | 10 ++
dlls/user32/win.c | 248 +--------------------------
dlls/user32/win.h | 1 -
dlls/win32u/clipboard.c | 25 +++
dlls/win32u/driver.c | 1 +
dlls/win32u/gdiobj.c | 1 +
dlls/win32u/message.c | 2 +
dlls/win32u/ntuser_private.h | 4 +
dlls/win32u/sysparams.c | 18 +-
dlls/win32u/win32u.spec | 2 +-
dlls/win32u/win32u_private.h | 6 +
dlls/win32u/window.c | 315 +++++++++++++++++++++++++++++++++++
dlls/win32u/wrappers.c | 6 +
include/ntuser.h | 4 +-
27 files changed, 440 insertions(+), 345 deletions(-)
diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c
index 1a69421ea17..b45ddf9c7c0 100644
--- a/dlls/user32/clipboard.c
+++ b/dlls/user32/clipboard.c
@@ -616,29 +616,6 @@ static HANDLE render_synthesized_format( UINT format, UINT from )
return data;
}
-/**************************************************************************
- * CLIPBOARD_ReleaseOwner
- */
-void CLIPBOARD_ReleaseOwner( HWND hwnd )
-{
- HWND viewer = 0, owner = 0;
-
- SendMessageW( hwnd, WM_RENDERALLFORMATS, 0, 0 );
-
- SERVER_START_REQ( release_clipboard )
- {
- req->owner = wine_server_user_handle( hwnd );
- if (!wine_server_call( req ))
- {
- viewer = wine_server_ptr_handle( reply->viewer );
- owner = wine_server_ptr_handle( reply->owner );
- }
- }
- SERVER_END_REQ;
-
- if (viewer) SendNotifyMessageW( viewer, WM_DRAWCLIPBOARD, (WPARAM)owner, 0 );
-}
-
/**************************************************************************
* RegisterClipboardFormatW (USER32.@)
diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index 77cb24be064..b375de5080c 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -173,7 +173,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
TRACE("[%p]: freeing storage\n", lphc->self);
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
- DestroyWindow( lphc->hWndLBox );
+ NtUserDestroyWindow( lphc->hWndLBox );
SetWindowLongPtrW( lphc->self, 0, 0 );
HeapFree( GetProcessHeap(), 0, lphc );
diff --git a/dlls/user32/dde_misc.c b/dlls/user32/dde_misc.c
index 41181d099cc..7bc1656432e 100644
--- a/dlls/user32/dde_misc.c
+++ b/dlls/user32/dde_misc.c
@@ -1158,7 +1158,7 @@ BOOL WINAPI DdeUninitialize(DWORD idInst)
*/
WDML_FreeAllHSZ(pInstance);
- DestroyWindow(pInstance->hwndEvent);
+ NtUserDestroyWindow( pInstance->hwndEvent );
/* OK now delete the instance handle itself */
@@ -1711,7 +1711,7 @@ void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic)
pPrev->next = pServer->next;
}
- DestroyWindow(pServer->hwndServer);
+ NtUserDestroyWindow(pServer->hwndServer);
WDML_DecHSZ(pInstance, pServer->hszServiceSpec);
WDML_DecHSZ(pInstance, pServer->hszService);
@@ -2105,7 +2105,7 @@ void WDML_RemoveConv(WDML_CONV* pRef, WDML_SIDE side)
hWnd = (side == WDML_CLIENT_SIDE) ? pRef->hwndClient : pRef->hwndServer;
SetWindowLongPtrW(hWnd, GWL_WDML_CONVERSATION, 0);
- DestroyWindow((side == WDML_CLIENT_SIDE) ? pRef->hwndClient : pRef->hwndServer);
+ NtUserDestroyWindow((side == WDML_CLIENT_SIDE) ? pRef->hwndClient : pRef->hwndServer);
WDML_DecHSZ(pRef->instance, pRef->hszService);
WDML_DecHSZ(pRef->instance, pRef->hszTopic);
diff --git a/dlls/user32/dde_server.c b/dlls/user32/dde_server.c
index 3867e0f014b..26494b835e5 100644
--- a/dlls/user32/dde_server.c
+++ b/dlls/user32/dde_server.c
@@ -360,7 +360,7 @@ static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClien
}
else
{
- DestroyWindow(hwndServerConv);
+ NtUserDestroyWindow(hwndServerConv);
}
return pConv;
}
diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c
index f78236cb194..271644bb953 100644
--- a/dlls/user32/defwnd.c
+++ b/dlls/user32/defwnd.c
@@ -400,7 +400,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return 0;
case WM_CLOSE:
- DestroyWindow( hwnd );
+ NtUserDestroyWindow( hwnd );
return 0;
case WM_MOUSEACTIVATE:
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index e6e5b91587c..f9d388d0104 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -707,7 +707,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
return hwnd;
}
if (disabled_owner) EnableWindow( disabled_owner, TRUE );
- if( IsWindow(hwnd) ) DestroyWindow( hwnd );
+ if (IsWindow(hwnd)) NtUserDestroyWindow( hwnd );
return 0;
}
@@ -827,7 +827,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
}
}
retval = dlgInfo->idResult;
- DestroyWindow( hwnd );
+ NtUserDestroyWindow( hwnd );
return retval;
}
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c
index 72ea5ad17bd..ada0b8ca2f7 100644
--- a/dlls/user32/driver.c
+++ b/dlls/user32/driver.c
@@ -79,10 +79,6 @@ static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
return TRUE;
}
-static void CDECL nulldrv_DestroyWindow( HWND hwnd )
-{
-}
-
static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
DWORD mask, DWORD flags )
{
@@ -174,7 +170,7 @@ static struct user_driver_funcs lazy_load_driver =
/* windowing functions */
NULL,
loaderdrv_CreateWindow,
- nulldrv_DestroyWindow,
+ NULL,
NULL,
NULL,
nulldrv_MsgWaitForMultipleObjectsEx,
@@ -223,7 +219,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
SET_USER_FUNC(SetCursorPos);
SET_USER_FUNC(UpdateClipboard);
SET_USER_FUNC(CreateWindow);
- SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(SetWindowIcon);
SET_USER_FUNC(SetWindowText);
diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index 6bab3e96adf..3d85487f808 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -580,7 +580,7 @@ static LRESULT MDIDestroyChild( HWND client, MDICLIENTINFO *ci,
{
SendMessageW(client, WM_MDIREFRESHMENU, 0, 0);
MDI_PostUpdate(GetParent(child), ci, SB_BOTH+1);
- DestroyWindow(child);
+ NtUserDestroyWindow(child);
}
TRACE("child destroyed - %p\n", child);
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 1d680009747..113e6103cd9 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -2333,7 +2333,7 @@ static void MENU_HideSubPopups( HWND hwndOwner, HMENU hmenu,
if (!(submenu = MENU_GetMenu( hsubmenu ))) return;
MENU_HideSubPopups( hwndOwner, hsubmenu, FALSE, wFlags );
MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM, sendMenuSelect, 0 );
- DestroyWindow( submenu->hWnd );
+ NtUserDestroyWindow( submenu->hWnd );
submenu->hWnd = 0;
if (!(wFlags & TPM_NONOTIFY))
@@ -3319,7 +3319,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
if (menu && (menu->wFlags & MF_POPUP))
{
- DestroyWindow( menu->hWnd );
+ NtUserDestroyWindow( menu->hWnd );
menu->hWnd = 0;
if (!(wFlags & TPM_NONOTIFY))
@@ -3531,7 +3531,7 @@ BOOL WINAPI TrackPopupMenuEx( HMENU hMenu, UINT wFlags, INT x, INT y,
if (menu->hWnd)
{
- DestroyWindow( menu->hWnd );
+ NtUserDestroyWindow( menu->hWnd );
menu->hWnd = 0;
if (!(wFlags & TPM_NONOTIFY))
@@ -4269,7 +4269,7 @@ BOOL WINAPI DestroyMenu( HMENU hMenu )
/* DestroyMenu should not destroy system menu popup owner */
if ((lppop->wFlags & (MF_POPUP | MF_SYSMENU)) == MF_POPUP && lppop->hWnd)
{
- DestroyWindow( lppop->hWnd );
+ NtUserDestroyWindow( lppop->hWnd );
lppop->hWnd = 0;
}
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 365f703c56e..0ba540d2e5d 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -1859,8 +1859,6 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
{
switch(msg)
{
- case WM_WINE_DESTROYWINDOW:
- return WIN_DestroyWindow( hwnd );
case WM_WINE_SHOWWINDOW:
if (is_desktop_window( hwnd )) return 0;
return ShowWindow( hwnd, wparam );
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 195bab2384b..c74d33092f0 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -116,57 +116,57 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
hItem = 0;
switch(lpmb->dwStyle & MB_TYPEMASK) {
case MB_OK:
- DestroyWindow(GetDlgItem(hwnd, IDCANCEL));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCANCEL));
/* fall through */
case MB_OKCANCEL:
hItem = GetDlgItem(hwnd, IDOK);
- DestroyWindow(GetDlgItem(hwnd, IDABORT));
- DestroyWindow(GetDlgItem(hwnd, IDRETRY));
- DestroyWindow(GetDlgItem(hwnd, IDIGNORE));
- DestroyWindow(GetDlgItem(hwnd, IDYES));
- DestroyWindow(GetDlgItem(hwnd, IDNO));
- DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
- DestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDABORT));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDRETRY));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDIGNORE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDYES));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDNO));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
break;
case MB_ABORTRETRYIGNORE:
hItem = GetDlgItem(hwnd, IDABORT);
- DestroyWindow(GetDlgItem(hwnd, IDOK));
- DestroyWindow(GetDlgItem(hwnd, IDCANCEL));
- DestroyWindow(GetDlgItem(hwnd, IDYES));
- DestroyWindow(GetDlgItem(hwnd, IDNO));
- DestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
- DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDOK));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCANCEL));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDYES));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDNO));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
break;
case MB_YESNO:
- DestroyWindow(GetDlgItem(hwnd, IDCANCEL));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCANCEL));
/* fall through */
case MB_YESNOCANCEL:
hItem = GetDlgItem(hwnd, IDYES);
- DestroyWindow(GetDlgItem(hwnd, IDOK));
- DestroyWindow(GetDlgItem(hwnd, IDABORT));
- DestroyWindow(GetDlgItem(hwnd, IDRETRY));
- DestroyWindow(GetDlgItem(hwnd, IDIGNORE));
- DestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
- DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDOK));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDABORT));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDRETRY));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDIGNORE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
break;
case MB_RETRYCANCEL:
hItem = GetDlgItem(hwnd, IDRETRY);
- DestroyWindow(GetDlgItem(hwnd, IDOK));
- DestroyWindow(GetDlgItem(hwnd, IDABORT));
- DestroyWindow(GetDlgItem(hwnd, IDIGNORE));
- DestroyWindow(GetDlgItem(hwnd, IDYES));
- DestroyWindow(GetDlgItem(hwnd, IDNO));
- DestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
- DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDOK));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDABORT));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDIGNORE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDYES));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDNO));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDCONTINUE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN));
break;
case MB_CANCELTRYCONTINUE:
hItem = GetDlgItem(hwnd, IDCANCEL);
- DestroyWindow(GetDlgItem(hwnd, IDOK));
- DestroyWindow(GetDlgItem(hwnd, IDABORT));
- DestroyWindow(GetDlgItem(hwnd, IDIGNORE));
- DestroyWindow(GetDlgItem(hwnd, IDYES));
- DestroyWindow(GetDlgItem(hwnd, IDNO));
- DestroyWindow(GetDlgItem(hwnd, IDRETRY));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDOK));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDABORT));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDIGNORE));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDYES));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDNO));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDRETRY));
}
if (hItem) SetWindowLongW(hItem, GWL_STYLE, GetWindowLongW(hItem, GWL_STYLE) | WS_GROUP);
@@ -202,7 +202,7 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
/* Remove Help button unless MB_HELP supplied */
if (!(lpmb->dwStyle & MB_HELP)) {
- DestroyWindow(GetDlgItem(hwnd, IDHELP));
+ NtUserDestroyWindow(GetDlgItem(hwnd, IDHELP));
}
/* Position everything */
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 8722cb68f12..ee9d23b1f71 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -35,18 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(win);
-/***********************************************************************
- * free_dce
- *
- * Free a class or window DCE.
- */
-void free_dce( struct dce *dce, HWND hwnd )
-{
- /* FIXME: move callers to win32u */
- NtUserCallTwoParam( (UINT_PTR)dce, HandleToUlong(hwnd), NtUserFreeDCE );
-}
-
-
/***********************************************************************
* invalidate_dce
*
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 7c27d9400db..cb18d9415c9 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -161,7 +161,7 @@
@ stdcall DestroyIcon(long)
@ stdcall DestroyMenu(long)
# @ stub DestroyReasons
-@ stdcall DestroyWindow(long)
+@ stdcall DestroyWindow(long) NtUserDestroyWindow
# @ stub DeviceEventWorker
@ stdcall DialogBoxIndirectParamA(long ptr long ptr long)
@ stdcall DialogBoxIndirectParamAorW(long ptr long ptr long long)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index ff9b469dae6..bc0dec6b579 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -140,6 +140,11 @@ static void CDECL notify_ime( HWND hwnd, UINT param )
if (ime_default) SendMessageW( ime_default, WM_IME_INTERNAL, param, HandleToUlong(hwnd) );
}
+void WINAPI unregister_imm( HWND hwnd )
+{
+ imm_unregister_window( hwnd );
+}
+
static void CDECL free_win_ptr( WND *win )
{
HeapFree( GetProcessHeap(), 0, win->text );
@@ -150,7 +155,9 @@ static void CDECL free_win_ptr( WND *win )
static const struct user_callbacks user_funcs =
{
CopyImage,
+ DestroyCaret,
DestroyMenu,
+ EndMenu,
HideCaret,
PostMessageW,
SendInput,
@@ -161,12 +168,14 @@ static const struct user_callbacks user_funcs =
ShowWindow,
WaitForInputIdle,
free_win_ptr,
+ MENU_IsMenuActive,
notify_ime,
register_builtin_classes,
MSG_SendInternalMessageTimeout,
SCROLL_SetStandardScrollPainted,
(void *)__wine_set_user_driver,
set_window_pos,
+ unregister_imm,
};
static void WINAPI User32CallFreeIcon( ULONG *param, ULONG size )
@@ -227,6 +236,7 @@ static void thread_detach(void)
struct user_thread_info *thread_info = get_user_thread_info();
exiting_thread_id = GetCurrentThreadId();
+ NtUserCallNoParam( NtUserExitingThread );
WDML_NotifyThreadDetach();
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index b57d6bd7566..b0e6b33eb56 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -558,38 +558,6 @@ HWND WIN_GetFullHandle( HWND hwnd )
}
-/***********************************************************************
- * WIN_SetOwner
- *
- * Change the owner of a window.
- */
-static HWND WIN_SetOwner( HWND hwnd, HWND owner )
-{
- WND *win = WIN_GetPtr( hwnd );
- HWND ret = 0;
-
- if (!win || win == WND_DESKTOP) return 0;
- if (win == WND_OTHER_PROCESS)
- {
- if (IsWindow(hwnd)) ERR( "cannot set owner %p on other process window %p\n", owner, hwnd );
- return 0;
- }
- SERVER_START_REQ( set_window_owner )
- {
- req->handle = wine_server_user_handle( hwnd );
- req->owner = wine_server_user_handle( owner );
- if (!wine_server_call( req ))
- {
- win->owner = wine_server_ptr_handle( reply->full_owner );
- ret = wine_server_ptr_handle( reply->prev_owner );
- }
- }
- SERVER_END_REQ;
- WIN_ReleasePtr( win );
- return ret;
-}
-
-
/***********************************************************************
* WIN_SetStyle
*
@@ -739,87 +707,6 @@ other_process:
}
-/***********************************************************************
- * WIN_DestroyWindow
- *
- * Destroy storage associated to a window. "Internals" p.358
- */
-LRESULT WIN_DestroyWindow( HWND hwnd )
-{
- WND *wndPtr;
- HWND *list;
- HMENU menu = 0, sys_menu;
- struct window_surface *surface;
-
- TRACE("%p\n", hwnd );
-
- /* destroy default IME window */
- if (win_set_flags( hwnd, 0, WIN_HAS_IME_WIN ) & WIN_HAS_IME_WIN)
- {
- TRACE("unregister IME window for %p\n", hwnd);
- imm_unregister_window( hwnd );
- }
-
- /* free child windows */
- if ((list = WIN_ListChildren( hwnd )))
- {
- int i;
- for (i = 0; list[i]; i++)
- {
- if (WIN_IsCurrentThread( list[i] )) WIN_DestroyWindow( list[i] );
- else SendNotifyMessageW( list[i], WM_WINE_DESTROYWINDOW, 0, 0 );
- }
- HeapFree( GetProcessHeap(), 0, list );
- }
-
- /* Unlink now so we won't bother with the children later on */
- SERVER_START_REQ( set_parent )
- {
- req->handle = wine_server_user_handle( hwnd );
- req->parent = 0;
- wine_server_call( req );
- }
- SERVER_END_REQ;
-
- /*
- * Send the WM_NCDESTROY to the window being destroyed.
- */
- SendMessageW( hwnd, WM_NCDESTROY, 0, 0 );
-
- /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
-
- /* free resources associated with the window */
-
- if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0;
- if ((wndPtr->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD)
- menu = (HMENU)wndPtr->wIDmenu;
- sys_menu = wndPtr->hSysMenu;
- free_dce( wndPtr->dce, hwnd );
- wndPtr->dce = NULL;
- HeapFree( GetProcessHeap(), 0, wndPtr->text );
- wndPtr->text = NULL;
- HeapFree( GetProcessHeap(), 0, wndPtr->pScroll );
- wndPtr->pScroll = NULL;
- DestroyIcon( wndPtr->hIconSmall2 );
- surface = wndPtr->surface;
- wndPtr->surface = NULL;
- WIN_ReleasePtr( wndPtr );
-
- if (menu) DestroyMenu( menu );
- if (sys_menu) DestroyMenu( sys_menu );
- if (surface)
- {
- register_window_surface( surface, NULL );
- window_surface_release( surface );
- }
-
- USER_Driver->pDestroyWindow( hwnd );
-
- free_window_handle( hwnd );
- return 0;
-}
-
-
/***********************************************************************
* WIN_FixCoordinates
*
@@ -1435,7 +1322,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
return hwnd;
failed:
- WIN_DestroyWindow( hwnd );
+ NtUserCallHwnd( hwnd, NtUserDestroyWindowHandle );
SetThreadDpiAwarenessContext( context );
return 0;
}
@@ -1506,139 +1393,6 @@ HWND WINAPI DECLSPEC_HOTPATCH CreateWindowExW( DWORD exStyle, LPCWSTR className,
}
-/***********************************************************************
- * WIN_SendDestroyMsg
- */
-static void WIN_SendDestroyMsg( HWND hwnd )
-{
- GUITHREADINFO info;
-
- info.cbSize = sizeof(info);
- if (NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ))
- {
- if (hwnd == info.hwndCaret) DestroyCaret();
- if (hwnd == info.hwndActive) WINPOS_ActivateOtherWindow( hwnd );
- }
-
- if (hwnd == NtUserGetClipboardOwner()) CLIPBOARD_ReleaseOwner( hwnd );
-
- /*
- * Send the WM_DESTROY to the window.
- */
- SendMessageW( hwnd, WM_DESTROY, 0, 0);
-
- /*
- * This WM_DESTROY message can trigger re-entrant calls to DestroyWindow
- * make sure that the window still exists when we come back.
- */
- if (IsWindow(hwnd))
- {
- HWND* pWndArray;
- int i;
-
- if (!(pWndArray = WIN_ListChildren( hwnd ))) return;
-
- for (i = 0; pWndArray[i]; i++)
- {
- if (IsWindow( pWndArray[i] )) WIN_SendDestroyMsg( pWndArray[i] );
- }
- HeapFree( GetProcessHeap(), 0, pWndArray );
- }
- else
- WARN("\tdestroyed itself while in WM_DESTROY!\n");
-}
-
-
-/***********************************************************************
- * DestroyWindow (USER32.@)
- */
-BOOL WINAPI DestroyWindow( HWND hwnd )
-{
- BOOL is_child;
-
- if (!(hwnd = WIN_IsCurrentThread( hwnd )) || is_desktop_window( hwnd ))
- {
- SetLastError( ERROR_ACCESS_DENIED );
- return FALSE;
- }
-
- TRACE("(%p)\n", hwnd);
-
- /* Call hooks */
-
- if (HOOK_CallHooks( WH_CBT, HCBT_DESTROYWND, (WPARAM)hwnd, 0, TRUE )) return FALSE;
-
- if (MENU_IsMenuActive() == hwnd)
- EndMenu();
-
- is_child = (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) != 0;
-
- if (is_child)
- {
- if (!USER_IsExitingThread( GetCurrentThreadId() ))
- send_parent_notify( hwnd, WM_DESTROY );
- }
- else if (!GetWindow( hwnd, GW_OWNER ))
- {
- HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWDESTROYED, (WPARAM)hwnd, 0L, TRUE );
- /* FIXME: clean up palette - see "Internals" p.352 */
- }
-
- if (!IsWindow(hwnd)) return TRUE;
-
- /* Hide the window */
- if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)
- {
- /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */
- if (is_child)
- ShowWindow( hwnd, SW_HIDE );
- else
- NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
- SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
- }
-
- if (!IsWindow(hwnd)) return TRUE;
-
- /* Recursively destroy owned windows */
-
- if (!is_child)
- {
- for (;;)
- {
- int i;
- BOOL got_one = FALSE;
- HWND *list = WIN_ListChildren( GetDesktopWindow() );
- if (list)
- {
- for (i = 0; list[i]; i++)
- {
- if (GetWindow( list[i], GW_OWNER ) != hwnd) continue;
- if (WIN_IsCurrentThread( list[i] ))
- {
- DestroyWindow( list[i] );
- got_one = TRUE;
- continue;
- }
- WIN_SetOwner( list[i], 0 );
- }
- HeapFree( GetProcessHeap(), 0, list );
- }
- if (!got_one) break;
- }
- }
-
- /* Send destroy messages */
-
- WIN_SendDestroyMsg( hwnd );
- if (!IsWindow( hwnd )) return TRUE;
-
- /* Destroy the window storage */
-
- WIN_DestroyWindow( hwnd );
- return TRUE;
-}
-
-
/***********************************************************************
* CloseWindow (USER32.@)
*/
diff --git a/dlls/user32/win.h b/dlls/user32/win.h
index 3e6885ab090..89e91a255f9 100644
--- a/dlls/user32/win.h
+++ b/dlls/user32/win.h
@@ -45,7 +45,6 @@ extern HWND WIN_IsCurrentThread( HWND hwnd ) DECLSPEC_HIDDEN;
extern UINT win_set_flags( HWND hwnd, UINT set_mask, UINT clear_mask ) DECLSPEC_HIDDEN;
extern ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
extern BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWindow, RECT *rectClient ) DECLSPEC_HIDDEN;
-extern LRESULT WIN_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, BOOL unicode ) DECLSPEC_HIDDEN;
extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ) DECLSPEC_HIDDEN;
extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c
index e132f981344..585a2aae631 100644
--- a/dlls/win32u/clipboard.c
+++ b/dlls/win32u/clipboard.c
@@ -288,3 +288,28 @@ BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd )
SERVER_END_REQ;
return ret;
}
+
+/**************************************************************************
+ * release_clipboard_owner
+ */
+void release_clipboard_owner( HWND hwnd )
+{
+ HWND viewer = 0, owner = 0;
+
+ send_message( hwnd, WM_RENDERALLFORMATS, 0, 0 );
+
+ SERVER_START_REQ( release_clipboard )
+ {
+ req->owner = wine_server_user_handle( hwnd );
+ if (!wine_server_call( req ))
+ {
+ viewer = wine_server_ptr_handle( reply->viewer );
+ owner = wine_server_ptr_handle( reply->owner );
+ }
+ }
+ SERVER_END_REQ;
+
+ if (viewer)
+ NtUserMessageCall( viewer, WM_DRAWCLIPBOARD, (WPARAM)owner, 0,
+ 0, FNID_SENDNOTIFYMESSAGE, FALSE );
+}
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c
index afe44e1c4a3..166c2009dbc 100644
--- a/dlls/win32u/driver.c
+++ b/dlls/win32u/driver.c
@@ -1190,6 +1190,7 @@ static const struct user_driver_funcs lazy_load_driver =
.pUpdateDisplayDevices = loaderdrv_UpdateDisplayDevices,
/* windowing functions */
.pCreateDesktopWindow = loaderdrv_CreateDesktopWindow,
+ .pDestroyWindow = nulldrv_DestroyWindow,
.pFlashWindowEx = loaderdrv_FlashWindowEx,
.pGetDC = loaderdrv_GetDC,
.pSetCapture = nulldrv_SetCapture,
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index adb162ab7ff..69607f0e3de 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1162,6 +1162,7 @@ static struct unix_funcs unix_funcs =
NtUserCountClipboardFormats,
NtUserDeferWindowPosAndBand,
NtUserDestroyCursor,
+ NtUserDestroyWindow,
NtUserDrawIconEx,
NtUserEndDeferWindowPosEx,
NtUserEndPaint,
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index d00178e6aa4..690de6cdf8a 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -41,6 +41,8 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
{
switch(msg)
{
+ case WM_WINE_DESTROYWINDOW:
+ return destroy_window( hwnd );
case WM_WINE_SETWINDOWPOS:
if (is_desktop_window( hwnd )) return 0;
return set_window_pos( (WINDOWPOS *)lparam, 0, 0 );
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index aa9b45b1542..b3cafe791df 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -31,7 +31,9 @@ struct tagWND;
struct user_callbacks
{
HANDLE (WINAPI *pCopyImage)( HANDLE, UINT, INT, INT, UINT );
+ BOOL (WINAPI *pDestroyCaret)(void);
BOOL (WINAPI *pDestroyMenu)( HMENU );
+ BOOL (WINAPI *pEndMenu)(void);
BOOL (WINAPI *pHideCaret)( HWND hwnd );
BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM );
UINT (WINAPI *pSendInput)( UINT count, INPUT *inputs, int size );
@@ -42,6 +44,7 @@ struct user_callbacks
BOOL (WINAPI *pShowWindow)( HWND, INT );
DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD );
void (CDECL *free_win_ptr)( struct tagWND *win );
+ HWND (CDECL *is_menu_active)(void);
void (CDECL *notify_ime)( HWND hwnd, UINT param );
void (CDECL *register_builtin_classes)(void);
LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
@@ -50,6 +53,7 @@ struct user_callbacks
BOOL (CDECL *set_window_pos)( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
const RECT *valid_rects );
+ void (WINAPI *unregister_imm)( HWND hwnd );
};
#define WM_SYSTIMER 0x0118
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index d9ddfe3400e..0166b64c76a 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -4591,6 +4591,16 @@ static BOOL message_beep( UINT i )
return TRUE;
}
+static DWORD exiting_thread_id;
+
+/**********************************************************************
+ * is_exiting_thread
+ */
+BOOL is_exiting_thread( DWORD tid )
+{
+ return tid == exiting_thread_id;
+}
+
static void thread_detach(void)
{
struct user_thread_info *thread_info = get_user_thread_info();
@@ -4602,6 +4612,8 @@ static void thread_detach(void)
destroy_thread_windows();
NtClose( thread_info->server_queue );
+
+ exiting_thread_id = 0;
}
/***********************************************************************
@@ -4618,6 +4630,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code )
case NtUserReleaseCapture:
return release_capture();
/* temporary exports */
+ case NtUserExitingThread:
+ exiting_thread_id = GetCurrentThreadId();
+ return 0;
case NtUserThreadDetach:
thread_detach();
return 0;
@@ -4724,9 +4739,6 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return HandleToUlong( alloc_user_handle( (struct user_object *)arg1, arg2 ));
case NtUserAllocWinProc:
return (UINT_PTR)alloc_winproc( (WNDPROC)arg1, arg2 );
- case NtUserFreeDCE:
- free_dce( (struct dce *)arg1, UlongToHandle(arg2) );
- return 0;
case NtUserFreeHandle:
return (UINT_PTR)free_user_handle( UlongToHandle(arg1), arg2 );
case NtUserGetHandlePtr:
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 96d8d4833b0..aacfebd1b15 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -834,7 +834,7 @@
@ stub NtUserDestroyInputContext
@ stub NtUserDestroyMenu
@ stub NtUserDestroyPalmRejectionDelayZone
-@ stub NtUserDestroyWindow
+@ stdcall NtUserDestroyWindow(long)
@ stub NtUserDisableImmersiveOwner
@ stub NtUserDisableProcessWindowFiltering
@ stub NtUserDisableThreadIme
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index 516f4540315..83b0e093a20 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -199,6 +199,7 @@ struct unix_funcs
INT x, INT y, INT cx, INT cy,
UINT flags, UINT unk1, UINT unk2 );
BOOL (WINAPI *pNtUserDestroyCursor)( HCURSOR cursor, ULONG arg );
+ BOOL (WINAPI *pNtUserDestroyWindow)( HWND hwnd );
BOOL (WINAPI *pNtUserDrawIconEx)( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags );
BOOL (WINAPI *pNtUserEndDeferWindowPosEx)( HDWP hdwp, BOOL async );
@@ -286,6 +287,9 @@ struct unix_funcs
struct window_surface *surface );
};
+/* clipboard.c */
+extern void release_clipboard_owner( HWND hwnd ) DECLSPEC_HIDDEN;
+
/* cursoricon.c */
extern HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN;
extern BOOL get_clip_cursor( RECT *rect ) DECLSPEC_HIDDEN;
@@ -327,6 +331,7 @@ extern UINT get_system_dpi(void) DECLSPEC_HIDDEN;
extern int get_system_metrics( int index ) DECLSPEC_HIDDEN;
extern UINT get_thread_dpi(void) DECLSPEC_HIDDEN;
extern RECT get_virtual_screen_rect( UINT dpi ) DECLSPEC_HIDDEN;
+extern BOOL is_exiting_thread( DWORD tid ) DECLSPEC_HIDDEN;
extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern HMONITOR monitor_from_point( POINT pt, DWORD flags, UINT dpi ) DECLSPEC_HIDDEN;
@@ -344,6 +349,7 @@ extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
struct tagWND;
extern HDWP begin_defer_window_pos( INT count ) DECLSPEC_HIDDEN;
extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
+extern LRESULT destroy_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
extern UINT get_dpi_for_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_full_window_handle( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index a28b6ae9ebf..f8d147b785c 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -3174,6 +3174,99 @@ BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async )
return TRUE;
}
+/***********************************************************************
+ * win_set_flags
+ *
+ * Set the flags of a window and return the previous value.
+ */
+static UINT win_set_flags( HWND hwnd, UINT set_mask, UINT clear_mask )
+{
+ WND *win = get_win_ptr( hwnd );
+ UINT ret;
+
+ if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return 0;
+ ret = win->flags;
+ win->flags = (ret & ~clear_mask) | set_mask;
+ release_win_ptr( win );
+ return ret;
+}
+
+/*******************************************************************
+ * can_activate_window
+ *
+ * Check if we can activate the specified window.
+ */
+static BOOL can_activate_window( HWND hwnd )
+{
+ LONG style;
+
+ if (!hwnd) return FALSE;
+ style = get_window_long( hwnd, GWL_STYLE );
+ if (!(style & WS_VISIBLE)) return FALSE;
+ if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
+ return !(style & WS_DISABLED);
+}
+
+/*******************************************************************
+ * activate_other_window
+ *
+ * Activates window other than hwnd.
+ */
+static void activate_other_window( HWND hwnd )
+{
+ HWND hwnd_to, fg;
+
+ if ((get_window_long( hwnd, GWL_STYLE ) & WS_POPUP) &&
+ (hwnd_to = get_window_relative( hwnd, GW_OWNER )))
+ {
+ hwnd_to = NtUserGetAncestor( hwnd_to, GA_ROOT );
+ if (can_activate_window( hwnd_to )) goto done;
+ }
+
+ hwnd_to = hwnd;
+ for (;;)
+ {
+ if (!(hwnd_to = get_window_relative( hwnd_to, GW_HWNDNEXT ))) break;
+ if (can_activate_window( hwnd_to )) goto done;
+ }
+
+ hwnd_to = get_window_relative( get_desktop_window(), GW_CHILD );
+ for (;;)
+ {
+ if (hwnd_to == hwnd)
+ {
+ hwnd_to = 0;
+ break;
+ }
+ if (can_activate_window( hwnd_to )) goto done;
+ if (!(hwnd_to = get_window_relative( hwnd_to, GW_HWNDNEXT ))) break;
+ }
+
+ done:
+ fg = NtUserGetForegroundWindow();
+ TRACE( "win = %p fg = %p\n", hwnd_to, fg );
+ if (!fg || hwnd == fg)
+ {
+ if (set_foreground_window( hwnd_to, FALSE )) return;
+ }
+ if (NtUserSetActiveWindow( hwnd_to )) NtUserSetActiveWindow( 0 );
+}
+
+/*******************************************************************
+ * send_parent_notify
+ */
+static void send_parent_notify( HWND hwnd, UINT msg )
+{
+ if ((get_window_long( hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
+ !(get_window_long( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY))
+ {
+ HWND parent = get_parent( hwnd );
+ if (parent && parent != get_desktop_window())
+ send_message( parent, WM_PARENTNOTIFY,
+ MAKEWPARAM( msg, get_window_long( hwnd, GWLP_ID )), (LPARAM)hwnd );
+ }
+}
+
/*******************************************************************
* update_window_state
*
@@ -3260,6 +3353,226 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
}
/***********************************************************************
+ * send_destroy_message
+ */
+static void send_destroy_message( HWND hwnd )
+{
+ GUITHREADINFO info;
+
+ info.cbSize = sizeof(info);
+ if (NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ))
+ {
+ if (hwnd == info.hwndCaret && user_callbacks) user_callbacks->pDestroyCaret();
+ if (hwnd == info.hwndActive) activate_other_window( hwnd );
+ }
+
+ if (hwnd == NtUserGetClipboardOwner()) release_clipboard_owner( hwnd );
+
+ send_message( hwnd, WM_DESTROY, 0, 0);
+
+ /*
+ * This WM_DESTROY message can trigger re-entrant calls to DestroyWindow
+ * make sure that the window still exists when we come back.
+ */
+ if (is_window(hwnd))
+ {
+ HWND *children;
+ int i;
+
+ if (!(children = list_window_children( 0, hwnd, NULL, 0 ))) return;
+
+ for (i = 0; children[i]; i++)
+ {
+ if (is_window( children[i] )) send_destroy_message( children[i] );
+ }
+ free( children );
+ }
+ else
+ WARN( "\tdestroyed itself while in WM_DESTROY!\n" );
+}
+
+/***********************************************************************
+ * free_window_handle
+ *
+ * Free a window handle.
+ */
+static void free_window_handle( HWND hwnd )
+{
+ WND *win;
+
+ TRACE( "\n" );
+
+ if ((win = get_user_handle_ptr( hwnd, NTUSER_OBJ_WINDOW )) && win != OBJ_OTHER_PROCESS)
+ {
+ SERVER_START_REQ( destroy_window )
+ {
+ req->handle = wine_server_user_handle( hwnd );
+ wine_server_call( req );
+ set_user_handle_ptr( hwnd, NULL );
+ }
+ SERVER_END_REQ;
+ user_unlock();
+ if (user_callbacks) user_callbacks->free_win_ptr( win );
+ }
+}
+
+/***********************************************************************
+ * destroy_window
+ */
+LRESULT destroy_window( HWND hwnd )
+{
+ struct window_surface *surface;
+ HMENU menu = 0, sys_menu;
+ WND *win;
+ HWND *children;
+
+ TRACE( "%p\n", hwnd );
+
+ /* destroy default IME window */
+ if (win_set_flags( hwnd, 0, WIN_HAS_IME_WIN ) & WIN_HAS_IME_WIN)
+ {
+ TRACE("unregister IME window for %p\n", hwnd);
+ if (user_callbacks) user_callbacks->unregister_imm( hwnd );
+ }
+
+ /* free child windows */
+ if ((children = list_window_children( 0, hwnd, NULL, 0 )))
+ {
+ int i;
+ for (i = 0; children[i]; i++)
+ {
+ if (is_current_thread_window( children[i] ))
+ destroy_window( children[i] );
+ else
+ NtUserMessageCall( children[i], WM_WINE_DESTROYWINDOW, 0, 0,
+ 0, FNID_SENDNOTIFYMESSAGE, FALSE );
+ }
+ free( children );
+ }
+
+ /* Unlink now so we won't bother with the children later on */
+ SERVER_START_REQ( set_parent )
+ {
+ req->handle = wine_server_user_handle( hwnd );
+ req->parent = 0;
+ wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ send_message( hwnd, WM_NCDESTROY, 0, 0 );
+
+ /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
+
+ /* free resources associated with the window */
+
+ if (!(win = get_win_ptr( hwnd )) || win == WND_OTHER_PROCESS) return 0;
+ if ((win->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD)
+ menu = (HMENU)win->wIDmenu;
+ sys_menu = win->hSysMenu;
+ free_dce( win->dce, hwnd );
+ win->dce = NULL;
+ NtUserDestroyCursor( win->hIconSmall2, 0 );
+ surface = win->surface;
+ win->surface = NULL;
+ release_win_ptr( win );
+
+ NtUserDestroyMenu( menu );
+ NtUserDestroyMenu( sys_menu );
+ if (surface)
+ {
+ register_window_surface( surface, NULL );
+ window_surface_release( surface );
+ }
+
+ user_driver->pDestroyWindow( hwnd );
+
+ free_window_handle( hwnd );
+ return 0;
+}
+
+/***********************************************************************
+ * NtUserDestroyWindow (win32u.@)
+ */
+BOOL WINAPI NtUserDestroyWindow( HWND hwnd )
+{
+ BOOL is_child;
+
+ if (!(hwnd = is_current_thread_window( hwnd )) || is_desktop_window( hwnd ))
+ {
+ SetLastError( ERROR_ACCESS_DENIED );
+ return FALSE;
+ }
+
+ TRACE( "(%p)\n", hwnd );
+
+ if (call_hooks( WH_CBT, HCBT_DESTROYWND, (WPARAM)hwnd, 0, TRUE )) return FALSE;
+
+ if (user_callbacks && user_callbacks->is_menu_active() == hwnd)
+ user_callbacks->pEndMenu();
+
+ is_child = (get_window_long( hwnd, GWL_STYLE ) & WS_CHILD) != 0;
+
+ if (is_child)
+ {
+ if (!is_exiting_thread( GetCurrentThreadId() ))
+ send_parent_notify( hwnd, WM_DESTROY );
+ }
+ else if (!get_window_relative( hwnd, GW_OWNER ))
+ {
+ call_hooks( WH_SHELL, HSHELL_WINDOWDESTROYED, (WPARAM)hwnd, 0L, TRUE );
+ /* FIXME: clean up palette - see "Internals" p.352 */
+ }
+
+ if (!is_window( hwnd )) return TRUE;
+
+ /* Hide the window */
+ if (get_window_long( hwnd, GWL_STYLE ) & WS_VISIBLE)
+ {
+ /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */
+ if (is_child)
+ NtUserShowWindow( hwnd, SW_HIDE );
+ else
+ NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
+ SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
+ }
+
+ if (!is_window( hwnd )) return TRUE;
+
+ /* Recursively destroy child windows */
+ if (!is_child)
+ {
+ for (;;)
+ {
+ BOOL got_one = FALSE;
+ HWND *children;
+ unsigned int i;
+
+ if (!(children = list_window_children( 0, get_desktop_window(), NULL, 0 ))) break;
+
+ for (i = 0; children[i]; i++)
+ {
+ if (get_window_relative( children[i], GW_OWNER ) != hwnd) continue;
+ if (is_current_thread_window( children[i] ))
+ {
+ NtUserDestroyWindow( children[i] );
+ got_one = TRUE;
+ continue;
+ }
+ set_window_owner( children[i], 0 );
+ }
+ free( children );
+ if (!got_one) break;
+ }
+ }
+
+ send_destroy_message( hwnd );
+ if (!is_window( hwnd )) return TRUE;
+
+ destroy_window( hwnd );
+ return TRUE;
+}
+
+/*****************************************************************************
* destroy_thread_windows
*
* Destroy all window owned by the current thread.
@@ -3329,6 +3642,8 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
/* temporary exports */
case NtUserCreateDesktopWindow:
return user_driver->pCreateDesktopWindow( hwnd );
+ case NtUserDestroyWindowHandle:
+ return destroy_window( hwnd );
case NtUserGetDummySurface:
return (UINT_PTR)&dummy_surface;
default:
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index 258483ad8de..da1957c8c88 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -783,6 +783,12 @@ BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg )
return unix_funcs->pNtUserDestroyCursor( cursor, arg );
}
+BOOL WINAPI NtUserDestroyWindow( HWND hwnd )
+{
+ if (!unix_funcs) return FALSE;
+ return unix_funcs->pNtUserDestroyWindow( hwnd );
+}
+
BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags )
{
diff --git a/include/ntuser.h b/include/ntuser.h
index aeb3e9ae2cc..de958caa735 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -91,6 +91,7 @@ enum
NtUserGetInputState,
NtUserReleaseCapture,
/* temporary exports */
+ NtUserExitingThread,
NtUserThreadDetach,
};
@@ -134,7 +135,6 @@ enum
/* temporary exports */
NtUserAllocHandle,
NtUserAllocWinProc,
- NtUserFreeDCE,
NtUserFreeHandle,
NtUserGetHandlePtr,
NtUserInvalidateDCE,
@@ -154,6 +154,7 @@ enum
NtUserIsWindowVisible,
/* temporary exports */
NtUserCreateDesktopWindow,
+ NtUserDestroyWindowHandle,
NtUserGetDummySurface,
};
@@ -302,6 +303,7 @@ HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, IN
BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle );
BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg );
BOOL WINAPI NtUserDestroyMenu( HMENU menu );
+BOOL WINAPI NtUserDestroyWindow( HWND hwnd );
BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags );
BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async );
--
2.23.0
1
0
[PATCH v2 1/5] win32u: Move destroy_thread_windows implementation from user32.
by Huw Davies March 17, 2022
by Huw Davies March 17, 2022
March 17, 2022
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/user32/user_main.c | 11 +++++--
dlls/user32/win.c | 56 ------------------------------------
dlls/user32/win.h | 1 -
dlls/win32u/menu.c | 8 ++++++
dlls/win32u/ntuser_private.h | 5 ++--
dlls/win32u/sysparams.c | 5 ++--
dlls/win32u/win32u_private.h | 1 +
dlls/win32u/window.c | 48 ++++++++++++++++++++++++++++++-
include/ntuser.h | 2 +-
9 files changed, 72 insertions(+), 65 deletions(-)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 8e8c357bdcf..ff9b469dae6 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -140,9 +140,17 @@ static void CDECL notify_ime( HWND hwnd, UINT param )
if (ime_default) SendMessageW( ime_default, WM_IME_INTERNAL, param, HandleToUlong(hwnd) );
}
+static void CDECL free_win_ptr( WND *win )
+{
+ HeapFree( GetProcessHeap(), 0, win->text );
+ HeapFree( GetProcessHeap(), 0, win->pScroll );
+ HeapFree( GetProcessHeap(), 0, win );
+}
+
static const struct user_callbacks user_funcs =
{
CopyImage,
+ DestroyMenu,
HideCaret,
PostMessageW,
SendInput,
@@ -152,6 +160,7 @@ static const struct user_callbacks user_funcs =
ShowCaret,
ShowWindow,
WaitForInputIdle,
+ free_win_ptr,
notify_ime,
register_builtin_classes,
MSG_SendInternalMessageTimeout,
@@ -222,8 +231,6 @@ static void thread_detach(void)
WDML_NotifyThreadDetach();
NtUserCallNoParam( NtUserThreadDetach );
- destroy_thread_windows();
- CloseHandle( thread_info->server_queue );
HeapFree( GetProcessHeap(), 0, thread_info->wmchar_data );
HeapFree( GetProcessHeap(), 0, thread_info->rawinput );
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index a21bdc62ed5..b57d6bd7566 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -820,62 +820,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
}
-/***********************************************************************
- * next_thread_window
- */
-static WND *next_thread_window( HWND *hwnd )
-{
- return (WND *)NtUserCallOneParam( (UINT_PTR)hwnd, NtUserNextThreadWindow );
-}
-
-
-/***********************************************************************
- * destroy_thread_windows
- *
- * Destroy all window owned by the current thread.
- */
-void destroy_thread_windows(void)
-{
- WND *win, *free_list = NULL, **free_list_ptr = &free_list;
- HWND hwnd = 0;
-
- USER_Lock();
- while ((win = next_thread_window( &hwnd )))
- {
- free_dce( win->dce, win->obj.handle );
- NtUserCallTwoParam( HandleToUlong(hwnd), 0, NtUserSetHandlePtr );
- win->obj.handle = *free_list_ptr;
- free_list_ptr = (WND **)&win->obj.handle;
- }
- if (free_list)
- {
- SERVER_START_REQ( destroy_window )
- {
- req->handle = 0; /* destroy all thread windows */
- wine_server_call( req );
- }
- SERVER_END_REQ;
- }
- USER_Unlock();
-
- while ((win = free_list))
- {
- free_list = win->obj.handle;
- TRACE( "destroying %p\n", win );
-
- if ((win->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD && win->wIDmenu)
- DestroyMenu( UlongToHandle(win->wIDmenu) );
- if (win->hSysMenu) DestroyMenu( win->hSysMenu );
- if (win->surface)
- {
- register_window_surface( win->surface, NULL );
- window_surface_release( win->surface );
- }
- HeapFree( GetProcessHeap(), 0, win );
- }
-}
-
-
/***********************************************************************
* WIN_FixCoordinates
*
diff --git a/dlls/user32/win.h b/dlls/user32/win.h
index 08bb16a0d4a..3e6885ab090 100644
--- a/dlls/user32/win.h
+++ b/dlls/user32/win.h
@@ -46,7 +46,6 @@ extern UINT win_set_flags( HWND hwnd, UINT set_mask, UINT clear_mask ) DECLSPEC_
extern ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
extern BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWindow, RECT *rectClient ) DECLSPEC_HIDDEN;
extern LRESULT WIN_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN;
-extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
extern HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, BOOL unicode ) DECLSPEC_HIDDEN;
extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ) DECLSPEC_HIDDEN;
extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c
index abaca12047f..1e8410d347e 100644
--- a/dlls/win32u/menu.c
+++ b/dlls/win32u/menu.c
@@ -105,3 +105,11 @@ BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle )
free( accel );
return TRUE;
}
+
+/**********************************************************************
+ * NtUserDestroyMenu (win32u.@)
+ */
+BOOL WINAPI NtUserDestroyMenu( HMENU menu )
+{
+ return user_callbacks && user_callbacks->pDestroyMenu( menu );
+}
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index d6c3e681c2f..aa9b45b1542 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -26,10 +26,12 @@
#include "wine/list.h"
struct dce;
+struct tagWND;
struct user_callbacks
{
HANDLE (WINAPI *pCopyImage)( HANDLE, UINT, INT, INT, UINT );
+ BOOL (WINAPI *pDestroyMenu)( HMENU );
BOOL (WINAPI *pHideCaret)( HWND hwnd );
BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM );
UINT (WINAPI *pSendInput)( UINT count, INPUT *inputs, int size );
@@ -39,6 +41,7 @@ struct user_callbacks
BOOL (WINAPI *pShowCaret)( HWND hwnd );
BOOL (WINAPI *pShowWindow)( HWND, INT );
DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD );
+ void (CDECL *free_win_ptr)( struct tagWND *win );
void (CDECL *notify_ime)( HWND hwnd, UINT param );
void (CDECL *register_builtin_classes)(void);
LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
@@ -122,8 +125,6 @@ static inline BOOL is_broadcast( HWND hwnd )
return hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST;
}
-WND *next_thread_window_ptr( HWND *hwnd );
-
#define WM_IME_INTERNAL 0x287
#define IME_INTERNAL_ACTIVATE 0x17
#define IME_INTERNAL_DEACTIVATE 0x18
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index f0ecb3b92bb..d9ddfe3400e 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -4599,6 +4599,9 @@ static void thread_detach(void)
free( thread_info->key_state );
thread_info->key_state = 0;
+
+ destroy_thread_windows();
+ NtClose( thread_info->server_queue );
}
/***********************************************************************
@@ -4689,8 +4692,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
case 1: user_unlock(); return 0;
default: user_check_not_lock(); return 0;
}
- case NtUserNextThreadWindow:
- return (UINT_PTR)next_thread_window_ptr( (HWND *)arg );
case NtUserSetCallbacks:
return (UINT_PTR)InterlockedExchangePointer( (void **)&user_callbacks, (void *)arg );
default:
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index 0c4e3b82f0f..516f4540315 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -343,6 +343,7 @@ extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
/* window.c */
struct tagWND;
extern HDWP begin_defer_window_pos( INT count ) DECLSPEC_HIDDEN;
+extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
extern UINT get_dpi_for_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_full_window_handle( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index 079b4b0695f..a28b6ae9ebf 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -141,7 +141,7 @@ void *free_user_handle( HANDLE handle, unsigned int type )
/***********************************************************************
* next_thread_window
*/
-WND *next_thread_window_ptr( HWND *hwnd )
+static WND *next_thread_window_ptr( HWND *hwnd )
{
struct user_object *ptr;
WND *win;
@@ -3259,6 +3259,52 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
}
}
+/***********************************************************************
+ * destroy_thread_windows
+ *
+ * Destroy all window owned by the current thread.
+ */
+void destroy_thread_windows(void)
+{
+ WND *win, *free_list = NULL;
+ HWND hwnd = 0;
+
+ user_lock();
+ while ((win = next_thread_window_ptr( &hwnd )))
+ {
+ free_dce( win->dce, win->obj.handle );
+ set_user_handle_ptr( hwnd, NULL );
+ win->obj.handle = free_list;
+ free_list = win;
+ }
+ if (free_list)
+ {
+ SERVER_START_REQ( destroy_window )
+ {
+ req->handle = 0; /* destroy all thread windows */
+ wine_server_call( req );
+ }
+ SERVER_END_REQ;
+ }
+ user_unlock();
+
+ while ((win = free_list))
+ {
+ free_list = win->obj.handle;
+ TRACE( "destroying %p\n", win );
+
+ if ((win->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD && win->wIDmenu)
+ NtUserDestroyMenu( UlongToHandle(win->wIDmenu) );
+ if (win->hSysMenu) NtUserDestroyMenu( win->hSysMenu );
+ if (win->surface)
+ {
+ register_window_surface( win->surface, NULL );
+ window_surface_release( win->surface );
+ }
+ if (user_callbacks) user_callbacks->free_win_ptr( win );
+ }
+}
+
/*****************************************************************************
* NtUserCallHwnd (win32u.@)
*/
diff --git a/include/ntuser.h b/include/ntuser.h
index 5e79083aa01..aeb3e9ae2cc 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -119,7 +119,6 @@ enum
NtUserHandleInternalMessage,
NtUserIncrementKeyStateCounter,
NtUserLock,
- NtUserNextThreadWindow,
NtUserSetCallbacks,
};
@@ -302,6 +301,7 @@ HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, IN
INT cx, INT cy, UINT flags, UINT unk1, UINT unk2 );
BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle );
BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg );
+BOOL WINAPI NtUserDestroyMenu( HMENU menu );
BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags );
BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async );
--
2.23.0
1
0
[PATCH 5/5] win32u: Move GetWindowContextHelpId implementation from user32.
by Jacek Caban March 17, 2022
by Jacek Caban March 17, 2022
March 17, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/win.c | 12 +-----------
dlls/win32u/window.c | 18 ++++++++++++++++++
include/ntuser.h | 1 +
3 files changed, 20 insertions(+), 11 deletions(-)
1
0
March 17, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/combo.c | 4 +-
dlls/user32/defwnd.c | 2 +-
dlls/user32/dialog.c | 6 +-
dlls/user32/driver.c | 8 +-
dlls/user32/mdi.c | 12 +-
dlls/user32/message.c | 21 +-
dlls/user32/nonclient.c | 6 +-
dlls/user32/scroll.c | 2 +-
dlls/user32/user32.spec | 4 +-
dlls/user32/user_main.c | 1 -
dlls/user32/win.c | 10 +-
dlls/user32/win.h | 6 -
dlls/user32/winpos.c | 228 +---------------
dlls/win32u/driver.c | 1 +
dlls/win32u/gdiobj.c | 2 +
dlls/win32u/input.c | 2 +-
dlls/win32u/message.c | 3 +
dlls/win32u/ntuser_private.h | 7 +-
dlls/win32u/win32u.spec | 4 +-
dlls/win32u/win32u_private.h | 4 +
dlls/win32u/window.c | 485 ++++++++++++++++++++++++++++++++++-
dlls/win32u/wrappers.c | 12 +
include/ntuser.h | 1 +
23 files changed, 540 insertions(+), 291 deletions(-)
1
0
March 17, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/user_main.c | 1 +
dlls/user32/winpos.c | 92 ++--------------------------------
dlls/win32u/menu.c | 6 +++
dlls/win32u/ntuser_private.h | 1 +
dlls/win32u/win32u_private.h | 3 ++
dlls/win32u/window.c | 97 ++++++++++++++++++++++++++++++++++++
include/ntuser.h | 1 +
7 files changed, 113 insertions(+), 88 deletions(-)
1
0
[PATCH 1/5] win32u: Move destroy_thread_windows implementation from user32.
by Jacek Caban March 17, 2022
by Jacek Caban March 17, 2022
March 17, 2022
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/user_main.c | 11 +++++--
dlls/user32/win.c | 56 ------------------------------------
dlls/user32/win.h | 1 -
dlls/win32u/menu.c | 8 ++++++
dlls/win32u/ntuser_private.h | 5 ++--
dlls/win32u/sysparams.c | 5 ++--
dlls/win32u/win32u_private.h | 1 +
dlls/win32u/window.c | 48 ++++++++++++++++++++++++++++++-
include/ntuser.h | 2 +-
9 files changed, 72 insertions(+), 65 deletions(-)
1
0
[PATCH vkd3d v2 1/3] tests: Work around a rounding difference between NVIDIA and AMD.
by Giovanni Mascellani March 17, 2022
by Giovanni Mascellani March 17, 2022
March 17, 2022
NVIDIA and AMD round differently the assignment of 0.5f to a UAV
of type R16G16_UNORM. NVIDIA rounds to 0x7fff and AMD to 0x8000.
According to both Vulkan and D3D12 specifications, both values
are acceptable, but the discrepancy currently appears as a
failure on NVIDIA cards.
Work around the issue by using 0.25f instead of 0.5f, which is
rounded as 0x4000 on both implementations.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
tests/d3d12.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 5067dd97..46de3316 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -4930,7 +4930,7 @@ static void test_clear_unordered_access_view_buffer(void)
{DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE},
{0x1234, 0xabcd, 0, 0}, 0xabcd1234},
{DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE},
- {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, true},
+ {0x3e800000 /* 0.25f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff4000, true},
{DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE},
{0x40000000 /* 2.0f */, 0 /* 0.0f */, 0, 0}, 0x0000ffff, true},
{DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE},
@@ -5124,7 +5124,7 @@ static void test_clear_unordered_access_view_image(void)
{DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, 0, {}, {1, 2, 3, 4}, 0x00c01001},
/* Test float clears with formats. */
{DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1, 0, {},
- {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, true},
+ {0x3e800000 /* 0.25f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff4000, true},
{DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1, 0, {},
{0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x3c003800, true},
{DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1, 0, {},
--
2.35.1
2
5
March 17, 2022
This is needed because BCryptFinalizeKey doesn't change the
pubkey_len member based on the keylen member. Also it doesn't
reallocate the pubkey buffer. If we don't do this programs get
an error when trying to generate a key by setting the length
using BCryptSetProperty.
Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com>
---
dlls/bcrypt/bcrypt_main.c | 19 ++++++++++++++++++-
dlls/bcrypt/tests/bcrypt.c | 29 +++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 5df4da009a4..2b3ceb803a0 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -704,7 +704,24 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val
else if (!wcscmp( prop, BCRYPT_KEY_LENGTH ))
{
if (size < sizeof(DWORD)) return STATUS_INVALID_PARAMETER;
- key->u.a.bitlen = *(DWORD*)value;
+ if (key->u.a.bitlen == *(DWORD *)value) return STATUS_SUCCESS;
+
+ key->u.a.bitlen = *(DWORD *)value;
+ switch (key->alg_id)
+ {
+ case ALG_ID_RSA:
+ case ALG_ID_RSA_SIGN:
+ key->u.a.pubkey_len = sizeof(BCRYPT_RSAKEY_BLOB) + 2 * key->u.a.bitlen / 8;
+ break;
+ case ALG_ID_DSA:
+ key->u.a.pubkey_len = sizeof(BCRYPT_DSA_KEY_BLOB) + 3 * key->u.a.bitlen / 8;
+ break;
+ default:
+ FIXME( "algorithm %u not supported\n", key->alg_id );
+ return STATUS_NOT_SUPPORTED;
+ }
+
+ key->u.a.pubkey = realloc( key->u.a.pubkey, key->u.a.pubkey_len );
return STATUS_SUCCESS;
}
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index efb5843fa4e..3b4fd3e31e7 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -2182,6 +2182,19 @@ static void test_RSA(void)
HeapFree(GetProcessHeap(), 0, buf);
BCryptDestroyKey(key);
+ /* generate rsa keys setting the key len by using properties */
+ key = NULL;
+ ret = BCryptGenerateKeyPair(alg, &key, 1024, 0);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(key != NULL, "got null handle\n");
+
+ keylen = 2048;
+ BCryptSetProperty(key, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, sizeof(keylen), 0);
+
+ ret = BCryptFinalizeKeyPair(key, 0);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ if(key) BCryptDestroyKey(key);
+
ret = BCryptCloseAlgorithmProvider(alg, 0);
ok(!ret, "got %#lx\n", ret);
}
@@ -2867,6 +2880,7 @@ static void test_DSA(void)
BCRYPT_DSA_KEY_BLOB *dsablob;
UCHAR sig[40], schemes;
ULONG len, size;
+ DWORD keylen;
NTSTATUS ret;
BYTE *buf;
@@ -2945,6 +2959,21 @@ static void test_DSA(void)
ret = BCryptDestroyKey(key);
ok(!ret, "got %#lx\n", ret);
+ /* generate dsa key by setting the key length */
+ key = NULL;
+ ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+
+ keylen = 1024;
+ ret = BCryptSetProperty(key, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, sizeof(keylen), 0);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+
+ ret = BCryptFinalizeKeyPair(key, 0);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+
+ ret = BCryptDestroyKey(key);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+
ret = BCryptCloseAlgorithmProvider(alg, 0);
ok(!ret, "got %#lx\n", ret);
}
--
2.32.0
2
1
March 17, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/user32/tests/win.c | 1499 ++++++++++++++++++++++++-----------------------
1 file changed, 750 insertions(+), 749 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index cfcec5cc78f..49bbd5894a9 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -19,6 +19,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <assert.h>
#include <limits.h>
@@ -76,7 +77,7 @@ static DWORD our_pid;
static void dump_minmax_info( const MINMAXINFO *minmax )
{
- trace("Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n",
+ trace("Reserved=%ld,%ld MaxSize=%ld,%ld MaxPos=%ld,%ld MinTrack=%ld,%ld MaxTrack=%ld,%ld\n",
minmax->ptReserved.x, minmax->ptReserved.y,
minmax->ptMaxSize.x, minmax->ptMaxSize.y,
minmax->ptMaxPosition.x, minmax->ptMaxPosition.y,
@@ -186,7 +187,7 @@ static DWORD wait_for_events( DWORD count, HANDLE *events, DWORD timeout )
else timeout = end - GetTickCount();
}
- ok( ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %#x\n", ret );
+ ok( ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %#lx\n", ret );
return ret;
}
@@ -229,7 +230,7 @@ static void test_parent_owner(void)
test = CreateWindowExA(0, "ToolWindowClass", "Tool window 1",
WS_CHILD, 0, 0, 100, 100, 0, 0, 0, NULL );
ok( !test, "WS_CHILD without parent created\n" );
- ok( GetLastError() == ERROR_TLW_WITH_WSCHILD, "CreateWindowExA error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_TLW_WITH_WSCHILD, "CreateWindowExA error %lu\n", GetLastError() );
/* desktop window */
check_parents( desktop, 0, 0, 0, 0, 0, 0 );
@@ -681,7 +682,7 @@ static DWORD CALLBACK enum_thread( void *arg )
info.cbSize = sizeof(info) + 1;
ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
}
PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */
@@ -741,7 +742,7 @@ static DWORD CALLBACK test_thread_exit_parent_thread( void *args )
params->hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
100, 100, 200, 200, 0, 0, 0, NULL );
- ok( params->hwnd != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+ ok( params->hwnd != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
flush_events( TRUE );
SetEvent( params->created_event );
@@ -779,22 +780,22 @@ static void test_thread_exit_destroy(void)
adopter = CreateWindowW( L"static", L"adopter", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
300, 100, 200, 200, 0, 0, 0, NULL );
- ok( adopter != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+ ok( adopter != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
flush_events( TRUE );
thread = CreateThread( NULL, 0, test_thread_exit_parent_thread, ¶ms, 0, NULL );
- ok( thread != 0, "CreateThread failed, error %u\n", GetLastError() );
+ ok( thread != 0, "CreateThread failed, error %lu\n", GetLastError() );
WaitForSingleObject( params.created_event, INFINITE );
child1 = CreateWindowW( L"static", L"child1", WS_CHILD|WS_VISIBLE,
50, 50, 50, 50, params.hwnd, 0, 0, NULL );
- ok( child1 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+ ok( child1 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
child2 = CreateWindowW( L"static", L"child2", WS_CHILD|WS_VISIBLE,
100, 50, 50, 50, params.hwnd, 0, 0, NULL );
- ok( child2 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+ ok( child2 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
child3 = CreateWindowW( L"static", L"child3", WS_CHILD|WS_VISIBLE,
50, 100, 50, 50, params.hwnd, 0, 0, NULL );
- ok( child3 != 0, "CreateWindowExW failed, error %u\n", GetLastError() );
+ ok( child3 != 0, "CreateWindowExW failed, error %lu\n", GetLastError() );
flush_events( TRUE );
trace("parent %p adopter %p child1 %p child2 %p child3 %p\n", params.hwnd, adopter, child1, child2, child3);
@@ -808,28 +809,28 @@ static void test_thread_exit_destroy(void)
ok( GetCapture() == child1, "GetCapture %p, expected %p\n", GetCapture(), child1 );
ret = SetPropW( child1, L"myprop", UlongToHandle(0xdeadbeef) );
- ok( ret, "SetPropW failed, error %u\n", GetLastError() );
+ ok( ret, "SetPropW failed, error %lu\n", GetLastError() );
ret = SetPropW( child2, L"myprop", UlongToHandle(0xdeadbeef) );
- ok( ret, "SetPropW failed, error %u\n", GetLastError() );
+ ok( ret, "SetPropW failed, error %lu\n", GetLastError() );
old_wndproc = (WNDPROC)GetWindowLongPtrW( child1, GWLP_WNDPROC );
- ok( old_wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %u\n", GetLastError() );
+ ok( old_wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %lu\n", GetLastError() );
ret = GetWindowLongW( child1, GWL_STYLE );
- ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#x\n", ret );
+ ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#lx\n", ret );
SetEvent( params.stop_event );
ret = WaitForSingleObject( thread, INFINITE );
- ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#x\n", ret );
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx\n", ret );
CloseHandle( thread );
/* child windows should all still be alive but hidden */
ret = IsWindow( child1 );
- ok( ret, "IsWindow returned %u\n", ret );
+ ok( ret, "IsWindow returned %lu\n", ret );
ret = IsWindow( child2 );
- ok( ret, "IsWindow returned %u\n", ret );
+ ok( ret, "IsWindow returned %lu\n", ret );
ret = IsWindow( child3 );
- ok( ret, "IsWindow returned %u\n", ret );
+ ok( ret, "IsWindow returned %lu\n", ret );
todo_wine
ok( GetActiveWindow() == adopter, "GetActiveWindow %p, expected %p\n", GetActiveWindow(), adopter );
@@ -850,38 +851,38 @@ static void test_thread_exit_destroy(void)
SetLastError( 0xdeadbeef );
ret = GetWindowLongW( child1, GWL_STYLE );
todo_wine
- ok( ret == WS_CHILD, "GetWindowLongW returned %#x\n", ret );
- ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+ ok( ret == WS_CHILD, "GetWindowLongW returned %#lx\n", ret );
+ ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
ret = SetWindowLongW( child1, GWL_STYLE, WS_CHILD|WS_VISIBLE );
- ok( ret, "SetWindowLongW failed, error %u\n", GetLastError() );
+ ok( ret, "SetWindowLongW failed, error %lu\n", GetLastError() );
ret = GetWindowLongW( child1, GWL_STYLE );
- ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#x\n", ret );
+ ok( ret == (WS_CHILD|WS_VISIBLE), "GetWindowLongW returned %#lx\n", ret );
/* and cannot be adopted */
SetLastError( 0xdeadbeef );
tmp = GetParent( child1 );
- ok( tmp == params.hwnd, "GetParent returned %p, error %u\n", tmp, GetLastError() );
- ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+ ok( tmp == params.hwnd, "GetParent returned %p, error %lu\n", tmp, GetLastError() );
+ ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
tmp = SetParent( child1, adopter );
ok( tmp == 0, "SetParent returned %p\n", tmp );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
tmp = SetParent( child3, adopter );
ok( tmp == 0, "SetParent returned %p\n", tmp );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
tmp = GetParent( child1 );
- ok( tmp == params.hwnd, "GetParent returned %p, error %u\n", tmp, GetLastError() );
- ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %u\n", GetLastError() );
+ ok( tmp == params.hwnd, "GetParent returned %p, error %lu\n", tmp, GetLastError() );
+ ok( GetLastError() == 0xdeadbeef, "GetWindowLongW error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = GetWindowLongW( params.hwnd, GWL_STYLE );
- ok( ret == 0, "GetWindowLongW returned %#x\n", ret );
- ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetWindowLongW error %u\n", GetLastError() );
+ ok( ret == 0, "GetWindowLongW returned %#lx\n", ret );
+ ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetWindowLongW error %lu\n", GetLastError() );
wndproc = (WNDPROC)GetWindowLongPtrW( child1, GWLP_WNDPROC );
- ok( wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %u\n", GetLastError() );
+ ok( wndproc != NULL, "GetWindowLongPtrW GWLP_WNDPROC failed, error %lu\n", GetLastError() );
ok( wndproc == old_wndproc, "GetWindowLongPtrW GWLP_WNDPROC returned %p\n", wndproc );
tmp = GetPropW( child1, L"myprop" );
@@ -892,58 +893,58 @@ static void test_thread_exit_destroy(void)
child = CreateWindowExA( 0, "ToolWindowClass", "Tool window 1", WS_CHILD,
0, 0, 100, 100, child1, 0, 0, NULL );
ok( !child && GetLastError() == ERROR_INVALID_PARAMETER,
- "CreateWindowExA returned %p %u\n", child, GetLastError() );
+ "CreateWindowExA returned %p %lu\n", child, GetLastError() );
ret = MoveWindow( child1, 5, 5, 10, 10, FALSE );
- ok( ret, "MoveWindow failed: %u\n", GetLastError() );
+ ok( ret, "MoveWindow failed: %lu\n", GetLastError() );
/* destroying child1 ourselves succeeds */
ret = DestroyWindow( child1 );
- ok( ret, "DestroyWindow returned %u\n", ret );
+ ok( ret, "DestroyWindow returned %lu\n", ret );
ret = DestroyWindow( child1 );
- ok( !ret, "DestroyWindow returned %u\n", ret );
+ ok( !ret, "DestroyWindow returned %lu\n", ret );
ret = IsWindow( child1 );
- ok( !ret, "IsWindow returned %u\n", ret );
+ ok( !ret, "IsWindow returned %lu\n", ret );
tmp = GetPropW( child1, L"myprop" );
ok( HandleToULong(tmp) == 0, "GetPropW returned %p\n", tmp );
/* child2 is still alive, for now */
ret = IsWindow( child2 );
- ok( ret, "IsWindow returned %u\n", ret );
+ ok( ret, "IsWindow returned %lu\n", ret );
SetLastError( 0xdeadbeef );
ret = SetWindowPos( child2, HWND_TOPMOST, 0, 0, 100, 100, SWP_NOSIZE|SWP_NOMOVE );
todo_wine
ok( !ret, "SetWindowPos succeeded\n" );
todo_wine
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = SetWindowPos( child2, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE );
todo_wine
ok( !ret, "SetWindowPos succeeded\n" );
todo_wine
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
rgn = CreateRectRgn( 5, 5, 15, 15 );
SetLastError( 0xdeadbeef );
ret = SetWindowRgn( child2, rgn, TRUE );
- ok( ret, "SetWindowRgn failed, error %u\n", GetLastError() );
+ ok( ret, "SetWindowRgn failed, error %lu\n", GetLastError() );
DeleteObject( rgn );
wndproc = (WNDPROC)SetWindowLongPtrW( child2, GWLP_WNDPROC, (LONG_PTR)test_thread_exit_wnd_proc );
ret = SendMessageW( child2, WM_USER, 0, 0 );
- ok( ret == 0xdeadbeef, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+ ok( ret == 0xdeadbeef, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
ret = SendMessageW( child2, WM_USER + 1, 0, 0 );
- ok( ret == 0xfeedcafe, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+ ok( ret == 0xfeedcafe, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
ret = SendMessageW( child2, WM_USER + 2, 0, 0 );
- ok( ret == 0, "SendMessageW returned %u, error %u\n", ret, GetLastError() );
+ ok( ret == 0, "SendMessageW returned %lu, error %lu\n", ret, GetLastError() );
ret = GetWindowTextW( child2, buffer, ARRAY_SIZE(buffer) );
- ok( ret == 6, "GetWindowTextW returned %u\n", ret );
+ ok( ret == 6, "GetWindowTextW returned %lu\n", ret );
ok( !wcscmp( buffer, L"child2" ), "GetWindowTextW returned %s\n", debugstr_w( buffer ) );
ret = IsWindow( child2 );
- ok( ret, "IsWindow returned %u\n", ret );
+ ok( ret, "IsWindow returned %lu\n", ret );
/* but peeking any message should reap them all */
PeekMessageW( &msg, child2, 0, 0, PM_REMOVE );
@@ -952,12 +953,12 @@ static void test_thread_exit_destroy(void)
ok( HandleToULong(tmp) == 0, "GetPropW returned %p\n", tmp );
ret = IsWindow( child2 );
- ok( !ret, "IsWindow returned %u\n", ret );
+ ok( !ret, "IsWindow returned %lu\n", ret );
ret = IsWindow( child3 );
todo_wine
- ok( !ret, "IsWindow returned %u\n", ret );
+ ok( !ret, "IsWindow returned %lu\n", ret );
ret = DestroyWindow( child2 );
- ok( !ret, "DestroyWindow returned %u\n", ret );
+ ok( !ret, "DestroyWindow returned %lu\n", ret );
DestroyWindow( adopter );
@@ -1025,7 +1026,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
GetClientRect(hwnd, &rc2);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
wine_dbgstr_rect(&rc2));
@@ -1082,7 +1083,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
}
@@ -1119,7 +1120,7 @@ static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPAR
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
}
@@ -1151,7 +1152,7 @@ static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
}
@@ -1224,17 +1225,17 @@ static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *in
ok(EqualRect(&rcClient, &info->rcClient), "wrong rcClient for %p in hook %s\n", hwnd, hook);
ok(info->dwStyle == (DWORD)GetWindowLongA(hwnd, GWL_STYLE),
- "wrong dwStyle: %08x != %08x for %p in hook %s\n",
+ "wrong dwStyle: %08lx != %08lx for %p in hook %s\n",
info->dwStyle, GetWindowLongA(hwnd, GWL_STYLE), hwnd, hook);
/* Windows reports some undocumented exstyles in WINDOWINFO, but
* doesn't return them in GetWindowLong(hwnd, GWL_EXSTYLE).
*/
ok((info->dwExStyle & ~0xe0000800) == (DWORD)GetWindowLongA(hwnd, GWL_EXSTYLE),
- "wrong dwExStyle: %08x != %08x for %p in hook %s\n",
+ "wrong dwExStyle: %08lx != %08lx for %p in hook %s\n",
info->dwExStyle, GetWindowLongA(hwnd, GWL_EXSTYLE), hwnd, hook);
status = (GetActiveWindow() == hwnd) ? WS_ACTIVECAPTION : 0;
if (GetForegroundWindow())
- ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04x != %04x active %p fg %p in hook %s\n",
+ ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04lx != %04lx active %p fg %p in hook %s\n",
info->dwWindowStatus, status, GetActiveWindow(), GetForegroundWindow(), hook);
/* win2k and XP return broken border info in GetWindowInfo most of
@@ -1244,7 +1245,7 @@ if (0)
{
UINT border;
ok(info->cxWindowBorders == (unsigned)(rcClient.left - rcWindow.left),
- "wrong cxWindowBorders %d != %d\n", info->cxWindowBorders, rcClient.left - rcWindow.left);
+ "wrong cxWindowBorders %d != %ld\n", info->cxWindowBorders, rcClient.left - rcWindow.left);
border = min(rcWindow.bottom - rcClient.bottom, rcClient.top - rcWindow.top);
ok(info->cyWindowBorders == border,
"wrong cyWindowBorders %d != %d\n", info->cyWindowBorders, border);
@@ -1267,13 +1268,13 @@ static void test_window_info(const char *hook, HWND hwnd)
SetLastError(0xdeadbeef);
ok(!pGetWindowInfo(0, NULL), "GetWindowInfo should fail\n");
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
- "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+ "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
}
SetLastError(0xdeadbeef);
ok(!pGetWindowInfo(0, &info), "GetWindowInfo should fail\n");
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
- "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+ "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
info.cbSize = sizeof(WINDOWINFO);
ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
@@ -1422,7 +1423,7 @@ static LRESULT CALLBACK test_standard_scrollbar_proc(HWND hwnd, UINT msg, WPARAM
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wp, lp);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wp, lp);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wp, lp);
return ret;
}
@@ -1462,28 +1463,28 @@ static void test_nonclient_area(HWND hwnd)
FixedAdjustWindowRectEx(&rc, style, menu, exstyle);
ok(EqualRect(&rc, &rc_window),
- "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
+ "window rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, win=%s, calc=%s\n",
style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
rc = rc_client;
MapWindowPoints(hwnd, 0, (LPPOINT)&rc, 2);
wine_AdjustWindowRectEx(&rc, style, menu, exstyle);
ok(EqualRect(&rc, &rc_window),
- "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
+ "window rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, win=%s, calc=%s\n",
style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
rc = rc_window;
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
ok(EqualRect(&rc, &rc_client),
- "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=%s, calc=%s\n",
+ "client rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d client=%s, calc=%s\n",
style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
/* NULL rectangle shouldn't crash */
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0);
- ok(ret == 0, "NULL rectangle returned %ld instead of 0\n", ret);
+ ok(ret == 0, "NULL rectangle returned %Id instead of 0\n", ret);
/* and now test AdjustWindowRectEx and WM_NCCALCSIZE on synthetic data */
SetRect(&rc_client, 0, 0, 250, 150);
@@ -1493,17 +1494,17 @@ static void test_nonclient_area(HWND hwnd)
rc = rc_window;
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
ok(EqualRect(&rc, &rc_client),
- "synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=%s, calc=%s\n",
+ "synthetic rect does not match: style:exstyle=0x%08lx:0x%08lx, menu=%d, client=%s, calc=%s\n",
style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
/* Test standard scroll bars */
uxtheme = LoadLibraryA("uxtheme.dll");
- ok(!!uxtheme, "Failed to load uxtheme.dll, error %u.\n", GetLastError());
+ ok(!!uxtheme, "Failed to load uxtheme.dll, error %lu.\n", GetLastError());
pIsThemeActive = (void *)GetProcAddress(uxtheme, "IsThemeActive");
- ok(!!pIsThemeActive, "Failed to load IsThemeActive, error %u.\n", GetLastError());
+ ok(!!pIsThemeActive, "Failed to load IsThemeActive, error %lu.\n", GetLastError());
is_theme_active = pIsThemeActive();
memset(&cls, 0, sizeof(cls));
@@ -1521,7 +1522,7 @@ static void test_nonclient_area(HWND hwnd)
parent = CreateWindowA("TestStandardScrollbarParentClass", "parent", WS_POPUP | WS_VISIBLE, 100,
100, 100, 100, NULL, NULL, 0, NULL);
- ok(!!parent, "Failed to create a parent window, error %u.\n", GetLastError());
+ ok(!!parent, "Failed to create a parent window, error %lu.\n", GetLastError());
GetCursorPos(&old_cursor_pos);
/* Place the cursor on the standard scroll bar arrow button when not painting it at all.
@@ -1529,16 +1530,16 @@ static void test_nonclient_area(HWND hwnd)
offset = GetSystemMetrics(SM_CYHSCROLL);
child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE,
0, 0, 50, 50, parent, NULL, 0, NULL);
- ok(!!child, "Failed to create a test window, error %u.\n", GetLastError());
+ ok(!!child, "Failed to create a test window, error %lu.\n", GetLastError());
hdc = GetDC(parent);
- ok(!!hdc, "GetDC failed, error %d.\n", GetLastError());
+ ok(!!hdc, "GetDC failed, error %ld.\n", GetLastError());
SetCursorPos(0, 0);
flush_events(TRUE);
RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME);
old_color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2,
50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
- ok(old_color == 0xc0c0c0, "Expected color %#x, got %#x.\n", 0xc0c0c0, old_color);
+ ok(old_color == 0xc0c0c0, "Expected color %#x, got %#lx.\n", 0xc0c0c0, old_color);
point.x = 50 - GetSystemMetrics(SM_CXVSCROLL) / 2;
point.y = 50 - GetSystemMetrics(SM_CYHSCROLL) / 2;
@@ -1548,7 +1549,7 @@ static void test_nonclient_area(HWND hwnd)
RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME);
color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2,
50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
- ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color);
+ ok(color == old_color, "Expected color %#lx, got %#lx.\n", old_color, color);
ReleaseDC(parent, hdc);
DestroyWindow(child);
@@ -1558,9 +1559,9 @@ static void test_nonclient_area(HWND hwnd)
offset = GetSystemMetrics(SM_CYHSCROLL) - 1;
child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE,
0, 0, 50, 50, parent, NULL, 0, NULL);
- ok(!!child, "Failed to create a test window, error %u.\n", GetLastError());
+ ok(!!child, "Failed to create a test window, error %lu.\n", GetLastError());
hdc = GetDC(parent);
- ok(!!hdc, "GetDC failed, error %d.\n", GetLastError());
+ ok(!!hdc, "GetDC failed, error %ld.\n", GetLastError());
SetCursorPos(0, 0);
flush_events(TRUE);
@@ -1578,10 +1579,10 @@ static void test_nonclient_area(HWND hwnd)
50 - GetSystemMetrics(SM_CYHSCROLL) / 2);
if (is_theme_active)
ok(color != old_color || broken(color == old_color), /* Win 10 1507 64-bit */
- "Got unexpected color %#x.\n", color);
+ "Got unexpected color %#lx.\n", color);
else
todo_wine
- ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color);
+ ok(color == old_color, "Expected color %#lx, got %#lx.\n", old_color, color);
SetCursorPos(old_cursor_pos.x, old_cursor_pos.y);
ReleaseDC(parent, hdc);
@@ -1623,7 +1624,7 @@ static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
/* WS_VISIBLE should be turned off yet */
style = createwnd->lpcs->style & ~WS_VISIBLE;
ok(style == GetWindowLongA(hwnd, GWL_STYLE),
- "style of hwnd and style in the CREATESTRUCT do not match: %08x != %08x\n",
+ "style of hwnd and style in the CREATESTRUCT do not match: %08lx != %08lx\n",
GetWindowLongA(hwnd, GWL_STYLE), style);
if (0)
@@ -1827,7 +1828,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1838,7 +1839,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0);
@@ -1854,7 +1855,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
{
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1871,7 +1872,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_child = (HWND)SendMessageW(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1887,7 +1888,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
(LPARAM)mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1903,7 +1904,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
(LPARAM)mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1924,7 +1925,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
{
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -1942,7 +1943,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
(LPARAM)mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1958,7 +1959,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1974,7 +1975,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -1993,7 +1994,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2014,7 +2015,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
{
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2032,7 +2033,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == first_id, "wrong child id %ld\n", id);
+ ok(id == first_id, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0;
ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd);
@@ -2056,7 +2057,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == 0, "wrong child id %ld\n", id);
+ ok(id == 0, "wrong child id %Id\n", id);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
@@ -2070,7 +2071,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == 0, "wrong child id %ld\n", id);
+ ok(id == 0, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2085,7 +2086,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == 0, "wrong child id %ld\n", id);
+ ok(id == 0, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2099,7 +2100,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == 0, "wrong child id %ld\n", id);
+ ok(id == 0, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2113,7 +2114,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id)
mdi_lParam_test_message);
ok(mdi_child != 0, "MDI child creation failed\n");
id = GetWindowLongPtrA(mdi_child, GWLP_ID);
- ok(id == 0, "wrong child id %ld\n", id);
+ ok(id == 0, "wrong child id %Id\n", id);
hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd);
ok(GetMenuItemCount(frame_menu) == 0, "Got wrong frame menu item count: %u\n", GetMenuItemCount(frame_menu));
@@ -2233,7 +2234,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
/* MDICREATESTRUCT should have original values */
ok(mdi_cs->style == 0 || mdi_cs->style == 0x7fffffff || mdi_cs->style == 0xffffffff || mdi_cs->style == WS_MAXIMIZE,
- "mdi_cs->style does not match (%08x)\n", mdi_cs->style);
+ "mdi_cs->style does not match (%08lx)\n", mdi_cs->style);
ok(mdi_cs->x == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->x);
ok(mdi_cs->y == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->y);
ok(mdi_cs->cx == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cx);
@@ -2253,7 +2254,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
{
LONG style = mdi_cs->style | WS_CHILD | WS_CLIPSIBLINGS;
ok(cs->style == style,
- "cs->style does not match (%08x)\n", cs->style);
+ "cs->style does not match (%08lx)\n", cs->style);
}
else
{
@@ -2262,7 +2263,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
style |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
ok(cs->style == style,
- "cs->style does not match (%08x)\n", cs->style);
+ "cs->style does not match (%08lx)\n", cs->style);
}
break;
}
@@ -2286,13 +2287,13 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
AdjustWindowRectEx(&rc, style, 0, exstyle);
if (winetest_debug > 1)
{
- trace("MDI child: calculated max window size = (%d x %d)\n", rc.right-rc.left, rc.bottom-rc.top);
+ trace("MDI child: calculated max window size = (%ld x %ld)\n", rc.right-rc.left, rc.bottom-rc.top);
dump_minmax_info( minmax );
}
- ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %ld != %ld\n",
minmax->ptMaxSize.x, rc.right - rc.left);
- ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %ld != %ld\n",
minmax->ptMaxSize.y, rc.bottom - rc.top);
DefMDIChildProcA(hwnd, msg, wparam, lparam);
@@ -2304,9 +2305,9 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
}
MDI_ChildGetMinMaxInfo(client, hwnd, &my_minmax);
- ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %ld != %ld\n",
minmax->ptMaxSize.x, my_minmax.ptMaxSize.x);
- ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %ld != %ld\n",
minmax->ptMaxSize.y, my_minmax.ptMaxSize.y);
return 1;
@@ -2369,7 +2370,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
GetClientRect(parent, &rc);
if (winetest_debug > 1)
{
- trace("WM_GETMINMAXINFO: parent %p client size = (%d x %d)\n", parent, rc.right, rc.bottom);
+ trace("WM_GETMINMAXINFO: parent %p client size = (%ld x %ld)\n", parent, rc.right, rc.bottom);
dump_minmax_info( minmax );
}
GetClientRect(parent, &rc);
@@ -2377,9 +2378,9 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
AdjustWindowRectEx(&rc, style, 0, exstyle);
- ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %ld != %ld\n",
minmax->ptMaxSize.x, rc.right - rc.left);
- ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
+ ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %ld != %ld\n",
minmax->ptMaxSize.y, rc.bottom - rc.top);
break;
}
@@ -2399,7 +2400,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
GetWindowRect(hwnd, &rc1);
GetClientRect(hwnd, &rc2);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s client=%s\n",
wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
@@ -2429,7 +2430,7 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
}
@@ -2492,7 +2493,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA
case WM_NCCALCSIZE:
{
LRESULT ret = DefFrameProcA(hwnd, mdi_client, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
@@ -2562,7 +2563,7 @@ static void test_mdi(void)
SCROLLINFO si;
BOOL ret, gotit;
- winetest_push_context("style %#x", style[i]);
+ winetest_push_context("style %#lx", style[i]);
mdi_client = CreateWindowExA(0, "mdiclient", NULL,
WS_CHILD | style[i],
0, 0, rc.right, rc.bottom,
@@ -2797,11 +2798,11 @@ static void check_icon_size_( int line, HICON icon, LONG width, LONG height )
BOOL ret;
ret = GetIconInfo( icon, &info );
- ok_(__FILE__, line)(ret, "failed to get icon info, error %u\n", GetLastError());
+ ok_(__FILE__, line)(ret, "failed to get icon info, error %lu\n", GetLastError());
ret = GetObjectW(info.hbmColor, sizeof(bitmap), &bitmap);
- ok_(__FILE__, line)(ret, "failed to get bitmap, error %u\n", GetLastError());
- ok_(__FILE__, line)(bitmap.bmWidth == width, "expected width %d, got %d\n", width, bitmap.bmWidth);
- ok_(__FILE__, line)(bitmap.bmHeight == height, "expected height %d, got %d\n", height, bitmap.bmHeight);
+ ok_(__FILE__, line)(ret, "failed to get bitmap, error %lu\n", GetLastError());
+ ok_(__FILE__, line)(bitmap.bmWidth == width, "expected width %ld, got %d\n", width, bitmap.bmWidth);
+ ok_(__FILE__, line)(bitmap.bmHeight == height, "expected height %ld, got %d\n", height, bitmap.bmHeight);
}
#define check_internal_icon_size(a, b, c, d) check_internal_icon_size_(__LINE__, a, b, c, d)
@@ -2814,7 +2815,7 @@ static void check_internal_icon_size_( int line, HANDLE window, UINT type, LONG
ok_(__FILE__, line)(icon != 0, "expected nonzero icon\n");
check_icon_size_( line, icon, width, height );
ret = DestroyIcon( icon );
- ok_(__FILE__, line)(ret, "failed to destroy icon, error %u\n", GetLastError());
+ ok_(__FILE__, line)(ret, "failed to destroy icon, error %lu\n", GetLastError());
}
static DWORD WINAPI internal_get_icon_thread(void *arg)
@@ -2825,7 +2826,7 @@ static DWORD WINAPI internal_get_icon_thread(void *arg)
icon = pInternalGetWindowIcon( arg, ICON_BIG );
ok( icon != 0, "expected nonzero icon\n" );
ret = DestroyIcon( icon );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
return 0;
}
@@ -2861,15 +2862,15 @@ static void test_icons(void)
SetLastError( 0xdeadbeef );
res = pInternalGetWindowIcon( hwnd, ICON_BIG );
ok( res != 0, "expected nonzero icon\n" );
- ok( GetLastError() == 0xdeadbeef, "got error %u\n", GetLastError() );
+ ok( GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError() );
check_icon_size( res, 40, 40 );
res2 = pInternalGetWindowIcon( hwnd, ICON_BIG );
ok( res2 && res2 != res, "got %p\n", res2 );
check_icon_size( res2, 40, 40 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
ret = DestroyIcon( res );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL, 0 );
ok( !res, "wrong small icon %p\n", res );
@@ -2880,9 +2881,9 @@ static void test_icons(void)
ok( res2 && res2 != res, "got %p\n", res2 );
check_icon_size( res2, 50, 50 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
ret = DestroyIcon( res );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
ok( !res, "wrong small2 icon %p\n", res );
@@ -2893,9 +2894,9 @@ static void test_icons(void)
ok( res2 && res2 != res, "got %p\n", res2 );
check_icon_size( res2, 50, 50 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
ret = DestroyIcon( res );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon );
ok( res == 0, "wrong previous big icon %p/0\n", res );
@@ -2905,7 +2906,7 @@ static void test_icons(void)
ok( res2 && res2 != icon, "got %p\n", res2 );
check_icon_size( res2, 10, 10 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon2 );
ok( res == icon, "wrong previous big icon %p/%p\n", res, icon );
@@ -2915,7 +2916,7 @@ static void test_icons(void)
ok( res2 && res2 != icon2, "got %p\n", res2 );
check_icon_size( res2, 20, 20 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL, 0 );
ok( res == 0, "wrong small icon %p/0\n", res );
@@ -2923,7 +2924,7 @@ static void test_icons(void)
ok( res2 != 0, "expected nonzero icon\n" );
check_icon_size( res2, small_width, small_height );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
ok( res && res != icon3 && res != icon2, "wrong small2 icon %p\n", res );
@@ -2934,7 +2935,7 @@ static void test_icons(void)
ok( res2 && res2 != icon3 && res2 != icon2 && res2 != res, "got %p\n", res2 );
check_icon_size( res2, small_width, small_height );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon );
ok( res == 0, "wrong previous small icon %p/0\n", res );
@@ -2944,7 +2945,7 @@ static void test_icons(void)
ok( res2 && res2 != icon, "got %p\n", res2 );
check_icon_size( res2, 10, 10 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
ok( res == icon, "wrong small2 icon after set %p/%p\n", res, icon );
@@ -2952,7 +2953,7 @@ static void test_icons(void)
ok( res2 && res2 != icon && res2 != res, "got %p\n", res2 );
check_icon_size( res2, 10, 10 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon3 );
ok( res == icon, "wrong previous small icon %p/%p\n", res, icon );
@@ -2962,7 +2963,7 @@ static void test_icons(void)
ok( res2 && res2 != icon3, "got %p\n", res2 );
check_icon_size( res2, 30, 30 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_SMALL2, 0 );
ok( res == icon3, "wrong small2 icon after set %p/%p\n", res, icon3 );
@@ -2970,7 +2971,7 @@ static void test_icons(void)
ok( res2 && res2 != icon3 && res2 != res, "got %p\n", res2 );
check_icon_size( res2, 30, 30 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
/* make sure the big icon hasn't changed */
res = (HICON)SendMessageA( hwnd, WM_GETICON, ICON_BIG, 0 );
@@ -2979,17 +2980,17 @@ static void test_icons(void)
ok( res2 && res2 != icon2, "got %p\n", res2 );
check_icon_size( res2, 20, 20 );
ret = DestroyIcon( res2 );
- ok( ret, "got error %u\n", GetLastError() );
+ ok( ret, "got error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
res = pInternalGetWindowIcon( NULL, ICON_BIG );
ok( !res, "got %p\n", res );
- ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
res = pInternalGetWindowIcon( hwnd, 0xdeadbeef );
ok( !res, "got %p\n", res );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
thread = CreateThread( NULL, 0, internal_get_icon_thread, hwnd, 0, NULL );
ret = WaitForSingleObject( thread, 1000 );
@@ -3133,13 +3134,13 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ok(ret, "Got %d\n", ret);
hwnd_desktop = GetDesktopWindow();
- ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%d).\n", GetLastError());
+ ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%ld).\n", GetLastError());
hwnd_child = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd);
- ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+ ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
hwnd_grandchild = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd_child);
- ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+ ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
hwnd_child2 = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd);
- ok(!!hwnd_child2, "Failed to create second child window (%d)\n", GetLastError());
+ ok(!!hwnd_child2, "Failed to create second child window (%ld)\n", GetLastError());
ret = SetWindowPos(hwnd, hwnd2, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
ok(ret, "Got %d\n", ret);
@@ -3277,7 +3278,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
DestroyWindow(hwnd_child2);
hwnd_child = create_tool_window(WS_CHILD|WS_POPUP|WS_SYSMENU, hwnd2);
- ok(!!hwnd_child, "Failed to create child window (%d)\n", GetLastError());
+ ok(!!hwnd_child, "Failed to create child window (%ld)\n", GetLastError());
ret = SetWindowPos(hwnd_child, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_SHOWWINDOW);
ok(ret, "Got %d\n", ret);
flush_events( TRUE );
@@ -3305,7 +3306,7 @@ static void test_SetMenu(HWND parent)
ok(ret == hMenu, "unexpected menu id %p\n", ret);
/* test whether we can destroy a menu assigned to a window */
retok = DestroyMenu(hMenu);
- ok( retok, "DestroyMenu error %d\n", GetLastError());
+ ok( retok, "DestroyMenu error %ld\n", GetLastError());
retok = IsMenu(hMenu);
ok(!retok, "menu handle should be not valid after DestroyMenu\n");
ret = GetMenu(parent);
@@ -3409,7 +3410,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
for (i = 0; i < total; i++)
{
- ok(child[order[i]] == hwnd, "Z order of child #%ld is wrong\n", i);
+ ok(child[order[i]] == hwnd, "Z order of child #%Id is wrong\n", i);
hwnd = GetWindow(hwnd, GW_HWNDNEXT);
}
@@ -3677,7 +3678,7 @@ static void test_SetFocus(HWND hwnd)
ok( GetFocus() == child, "Focus should be on child %p\n", child );
SetLastError(0xdeadbeef);
EnableWindow(hwnd, FALSE);
- ok(GetLastError() == 0xdeadbeef, "got error %u in EnableWindow call\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "got error %lu in EnableWindow call\n", GetLastError());
ok( GetFocus() == child, "Focus should still be on child %p\n", child );
EnableWindow(hwnd, TRUE);
@@ -3736,16 +3737,16 @@ static void test_SetActiveWindow_0_proc( char **argv )
sscanf( argv[3], "%p", &other );
start_event = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_start" );
- ok( start_event != 0, "CreateEventW failed, error %u\n", GetLastError() );
+ ok( start_event != 0, "CreateEventW failed, error %lu\n", GetLastError() );
stop_event = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_stop" );
- ok( stop_event != 0, "CreateEventW failed, error %u\n", GetLastError() );
+ ok( stop_event != 0, "CreateEventW failed, error %lu\n", GetLastError() );
hwnd = CreateWindowExA( 0, "static", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, NULL, NULL );
- ok( !!hwnd, "CreateWindowExA failed, error %u\n", GetLastError() );
+ ok( !!hwnd, "CreateWindowExA failed, error %lu\n", GetLastError() );
flush_events( TRUE );
ret = SetForegroundWindow( hwnd );
- ok( ret, "SetForegroundWindow failed, error %u\n", GetLastError() );
+ ok( ret, "SetForegroundWindow failed, error %lu\n", GetLastError() );
tmp = GetForegroundWindow();
ok( tmp == hwnd, "GetForegroundWindow returned %p\n", tmp );
@@ -3756,12 +3757,12 @@ static void test_SetActiveWindow_0_proc( char **argv )
SetLastError( 0xdeadbeef );
tmp = SetActiveWindow( 0 );
- if (!tmp) ok( GetLastError() == 0xdeadbeef, "got error %u\n", GetLastError() );
+ if (!tmp) ok( GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError() );
else /* < Win10 */
{
ok( tmp == hwnd, "SetActiveWindow returned %p\n", tmp );
todo_wine
- ok( GetLastError() == 0, "got error %u\n", GetLastError() );
+ ok( GetLastError() == 0, "got error %lu\n", GetLastError() );
tmp = GetForegroundWindow();
ok( tmp == other || tmp == 0, "GetForegroundWindow returned %p\n", tmp );
@@ -3809,7 +3810,7 @@ static void test_SetActiveWindow_0( char **argv )
BOOL ret;
hwnd = CreateWindowExA( 0, "static", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, NULL, NULL );
- ok( !!hwnd, "CreateWindowExA failed, error %u\n", GetLastError() );
+ ok( !!hwnd, "CreateWindowExA failed, error %lu\n", GetLastError() );
SetWindowPos( hwnd, HWND_TOPMOST, 150, 150, 300, 300, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
flush_events( TRUE );
@@ -3821,13 +3822,13 @@ static void test_SetActiveWindow_0( char **argv )
ok( tmp == hwnd, "GetFocus returned %p\n", tmp );
events[1] = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_start" );
- ok( events[1] != 0, "CreateEventW failed, error %u\n", GetLastError() );
+ ok( events[1] != 0, "CreateEventW failed, error %lu\n", GetLastError() );
events[2] = CreateEventW( NULL, FALSE, FALSE, L"test_SetActiveWindow_0_stop" );
- ok( events[2] != 0, "CreateEventW failed, error %u\n", GetLastError() );
+ ok( events[2] != 0, "CreateEventW failed, error %lu\n", GetLastError() );
sprintf( cmdline, "%s %s SetActiveWindow_0 %p", argv[0], argv[1], hwnd );
ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info );
- ok( ret, "CreateProcessA failed, error %u\n", GetLastError() );
+ ok( ret, "CreateProcessA failed, error %lu\n", GetLastError() );
events[0] = info.hProcess;
if (wait_for_events( 2, events, INFINITE ) == 1)
@@ -3903,7 +3904,7 @@ static void test_SetActiveWindow(HWND hwnd)
ret = SetActiveWindow(GetDesktopWindow());
ok(ret == NULL, "expected NULL, got %p\n", ret);
todo_wine
- ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError());
check_wnd_state(hwnd, hwnd, hwnd, 0);
/* activating a child should activate the parent */
@@ -3932,10 +3933,10 @@ static DWORD WINAPI create_window_thread(void *param)
p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
ret = SetEvent(p->window_created);
- ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
+ ok(ret, "SetEvent failed, last error %#lx.\n", GetLastError());
res = WaitForSingleObject(p->test_finished, INFINITE);
- ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+ ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %#lx.\n", res, GetLastError());
DestroyWindow(p->window);
return 0;
@@ -3970,7 +3971,7 @@ static void test_SetForegroundWindow(HWND hwnd)
ret = SetForegroundWindow(0);
ok(!ret, "SetForegroundWindow returned TRUE instead of FALSE\n");
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
- "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
+ "got error %ld expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
check_wnd_state(hwnd, hwnd, hwnd, 0);
SetWindowPos(hwnd,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_HIDEWINDOW);
@@ -3982,7 +3983,7 @@ static void test_SetForegroundWindow(HWND hwnd)
hwnd2 = GetForegroundWindow();
ok(hwnd2 == hwnd, "Wrong foreground window %p\n", hwnd2);
ret = SetForegroundWindow( GetDesktopWindow() );
- ok(ret, "SetForegroundWindow(desktop) error: %d\n", GetLastError());
+ ok(ret, "SetForegroundWindow(desktop) error: %ld\n", GetLastError());
hwnd2 = GetForegroundWindow();
ok(hwnd2 != hwnd, "Wrong foreground window %p\n", hwnd2);
@@ -4016,13 +4017,13 @@ static void test_SetForegroundWindow(HWND hwnd)
check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
thread_params.window_created = CreateEventW(NULL, FALSE, FALSE, NULL);
- ok(!!thread_params.window_created, "CreateEvent failed, last error %#x.\n", GetLastError());
+ ok(!!thread_params.window_created, "CreateEvent failed, last error %#lx.\n", GetLastError());
thread_params.test_finished = CreateEventW(NULL, FALSE, FALSE, NULL);
- ok(!!thread_params.test_finished, "CreateEvent failed, last error %#x.\n", GetLastError());
+ ok(!!thread_params.test_finished, "CreateEvent failed, last error %#lx.\n", GetLastError());
thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid);
- ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError());
+ ok(!!thread, "Failed to create thread, last error %#lx.\n", GetLastError());
res = WaitForSingleObject(thread_params.window_created, INFINITE);
- ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
+ ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %#lx.\n", res, GetLastError());
check_wnd_state(hwnd2, thread_params.window, hwnd2, 0);
SetForegroundWindow(hwnd2);
@@ -4235,11 +4236,11 @@ static LRESULT CALLBACK test_capture_4_proc(HWND hWnd, UINT msg, WPARAM wParam,
gti.cbSize = sizeof(GUITHREADINFO);
status = pGetGUIThreadInfo(GetCurrentThreadId(), >i);
ok(status, "GetGUIThreadInfo() failed!\n");
- ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08X)!\n", gti.flags);
+ ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08lX)!\n", gti.flags);
}
cap_wnd = GetCapture();
- ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %lx\n", cap_wnd, lParam);
+ ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %Ix\n", cap_wnd, lParam);
todo_wine ok(cap_wnd == hWnd, "capture window %p does not match hwnd %p\n", cap_wnd, hWnd);
/* check that re-setting the capture for the menu fails */
@@ -4266,7 +4267,7 @@ static LRESULT CALLBACK test_capture_4_proc(HWND hWnd, UINT msg, WPARAM wParam,
gti.cbSize = sizeof(GUITHREADINFO);
status = pGetGUIThreadInfo(GetCurrentThreadId(), >i);
ok(status, "GetGUIThreadInfo() failed!\n");
- ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08X)!\n", gti.flags);
+ ok(gti.flags & GUI_INMENUMODE, "Thread info incorrect (flags=%08lX)!\n", gti.flags);
}
/* verify that no capture change took place */
@@ -4309,11 +4310,11 @@ static void test_capture_4(void)
wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0;
aclass = RegisterClassA( &wclass );
- ok( aclass, "RegisterClassA failed with error %d\n", GetLastError());
+ ok( aclass, "RegisterClassA failed with error %ld\n", GetLastError());
hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
400, 200, NULL, NULL, hInstance, NULL);
- ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+ ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
if (!hwnd) return;
hmenu = CreatePopupMenu();
@@ -4483,7 +4484,7 @@ static void test_mouse_input(HWND hwnd)
{
ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n",
msg.hwnd, msg.message);
- ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%d,%d)\n",
+ ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%ld,%ld)\n",
x, y, msg.pt.x, msg.pt.y);
}
@@ -4628,7 +4629,7 @@ static void test_mouse_input(HWND hwnd)
}
ok(msg.hwnd == child && msg.message == WM_NCLBUTTONDOWN, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
- ok(msg.wParam == HTSYSMENU, "wparam %ld\n", msg.wParam);
+ ok(msg.wParam == HTSYSMENU, "wparam %Id\n", msg.wParam);
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
@@ -4641,7 +4642,7 @@ static void test_mouse_input(HWND hwnd)
ok(ret, "no message available\n");
ok(msg.hwnd == child && msg.message == WM_LBUTTONDBLCLK, "hwnd %p/%p message %04x\n",
msg.hwnd, child, msg.message);
- ok(msg.wParam == MK_LBUTTON, "wparam %ld\n", msg.wParam);
+ ok(msg.wParam == MK_LBUTTON, "wparam %Id\n", msg.wParam);
ret = wait_for_message( &msg );
ok(ret, "no message available\n");
@@ -4713,7 +4714,7 @@ static void nccalchelper(HWND hwnd, INT x, INT y, RECT *prc)
GetWindowRect( hwnd, prc);
rc = *prc;
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)prc);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
if (winetest_debug > 1)
trace("window rect is %s, nccalc rect is %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(prc));
}
@@ -4953,17 +4954,17 @@ static LRESULT WINAPI cbt_proc(int ncode, WPARAM wparam, LPARAM lparam)
ts = c->lpcs->lpCreateParams;
ok(ts != NULL, "lpCreateParams not set\n");
- ok(c->lpcs->style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+ ok(c->lpcs->style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
c->lpcs->style, ts->cs_style);
- ok(c->lpcs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+ ok(c->lpcs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
c->lpcs->dwExStyle, ts->cs_exstyle);
style = GetWindowLongW(hwnd, GWL_STYLE);
- ok(style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+ ok(style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
style, ts->cs_style);
style = GetWindowLongW(hwnd, GWL_EXSTYLE);
ok(style == (ts->cs_exstyle & ~WS_EX_LAYERED),
- "exstyle = 0x%08x, expected 0x%08x\n", style, ts->cs_exstyle);
+ "exstyle = 0x%08lx, expected 0x%08lx\n", style, ts->cs_exstyle);
return CallNextHookEx(NULL, ncode, wparam, lparam);
}
@@ -4981,16 +4982,16 @@ static LRESULT WINAPI StyleCheckProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
ts = cs->lpCreateParams;
ok(ts != NULL, "lpCreateParams not set\n");
- ok(cs->style == ts->cs_style, "style = 0x%08x, expected 0x%08x\n",
+ ok(cs->style == ts->cs_style, "style = 0x%08lx, expected 0x%08lx\n",
cs->style, ts->cs_style);
- ok(cs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+ ok(cs->dwExStyle == ts->cs_exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
cs->dwExStyle, ts->cs_exstyle);
style = GetWindowLongW(hwnd, GWL_STYLE);
- ok(style == ts->style, "style = 0x%08x, expected 0x%08x\n",
+ ok(style == ts->style, "style = 0x%08lx, expected 0x%08lx\n",
style, ts->style);
style = GetWindowLongW(hwnd, GWL_EXSTYLE);
- ok(style == ts->exstyle, "exstyle = 0x%08x, expected 0x%08x\n",
+ ok(style == ts->exstyle, "exstyle = 0x%08lx, expected 0x%08lx\n",
style, ts->exstyle);
break;
}
@@ -5056,8 +5057,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
- ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
- ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+ ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+ ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
/* try setting the styles explicitly */
SetWindowLongA( hwnd, GWL_EXSTYLE, dwExStyleIn );
@@ -5070,8 +5071,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
else
dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
- ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
- ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+ ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+ ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
SetWindowLongA( hwnd, GWL_STYLE, dwStyleIn );
dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
@@ -5086,8 +5087,8 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
else
dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
- ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
- ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
+ ok(dwActualStyle == dwStyleOut, "expected style %#lx, got %#lx\n", dwStyleOut, dwActualStyle);
+ ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#lx, got %#lx\n", dwExStyleOut, dwActualExStyle);
DestroyWindow(hwnd);
if (hwndParent) DestroyWindow(hwndParent);
@@ -5150,7 +5151,7 @@ static void test_window_styles(void)
if ((tests[i].exstyle_in & WS_EX_LAYERED) && !pGetLayeredWindowAttributes)
continue;
- winetest_push_context("style %#x exstyle %#x", tests[i].style_in, tests[i].exstyle_in);
+ winetest_push_context("style %#lx exstyle %#lx", tests[i].style_in, tests[i].exstyle_in);
check_window_style(tests[i].style_in, tests[i].exstyle_in, tests[i].style_out, tests[i].exstyle_out);
winetest_pop_context();
}
@@ -5189,40 +5190,40 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
if (parent_is_child)
{
- ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
+ ok(IsWindowEnabled(param->parent), "wrong state for %08lx\n", style);
disabled_hwnd = param->grand_parent;
}
else
{
- ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
+ ok(!IsWindowEnabled(param->parent), "wrong state for %08lx\n", style);
disabled_hwnd = param->parent;
}
if (param->grand_parent)
{
if (parent_is_child)
- ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
+ ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08lx\n", style);
else
- ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
+ ok(IsWindowEnabled(param->grand_parent), "wrong state for %08lx\n", style);
}
DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0);
- ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style);
+ ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08lx\n", style);
ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
if (param->grand_parent)
- ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
+ ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08lx)\n", param->grand_parent, style);
DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
if (param->grand_parent)
- ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
+ ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08lx)\n", param->grand_parent, style);
param->dlg_data->style |= WS_CHILD;
DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0);
- ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
+ ok(IsWindowEnabled(hwnd), "wrong state for %p (%08lx)\n", hwnd, style);
EndDialog(hwnd, 0);
}
@@ -5252,7 +5253,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
parent = CreateWindowExA(0, "static", NULL, style_in,
0, 0, 0, 0, grand_parent, NULL, NULL, NULL);
- ok(parent != 0, "parent creation failed, style %#x\n", style_in);
+ ok(parent != 0, "parent creation failed, style %#lx\n", style_in);
dlg_data.dt.style = style_in;
dlg_data.dt.dwExtendedStyle = ex_style_in;
@@ -5267,22 +5268,22 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
dlg_data.caption[0] = 0;
hwnd = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc, 0);
- ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
+ ok(hwnd != 0, "dialog creation failed, style %#lx, exstyle %#lx\n", style_in, ex_style_in);
flush_events( TRUE );
style = GetWindowLongA(hwnd, GWL_STYLE);
ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
- ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
- ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+ ok(style == (style_out | DS_3DLOOK), "got %#lx\n", style);
+ ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
- ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
+ ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#lx)\n", style_in);
/* try setting the styles explicitly */
SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in);
style = GetWindowLongA(hwnd, GWL_STYLE);
ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
- ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
+ ok(style == (style_out | DS_3DLOOK), "got %#lx\n", style);
/* WS_EX_WINDOWEDGE can't always be changed */
if (ex_style_in & WS_EX_DLGMODALFRAME)
ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
@@ -5290,7 +5291,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
else
ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
- ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+ ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
SetWindowLongA(hwnd, GWL_STYLE, style_in);
style = GetWindowLongA(hwnd, GWL_STYLE);
@@ -5298,7 +5299,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
/* WS_CLIPSIBLINGS can't be reset on top-level windows */
if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in;
else style_out = style_in | WS_CLIPSIBLINGS;
- ok(style == style_out, "expected style %#x, got %#x\n", style_out, style);
+ ok(style == style_out, "expected style %#lx, got %#lx\n", style_out, style);
/* WS_EX_WINDOWEDGE can't always be changed */
if (ex_style_in & WS_EX_DLGMODALFRAME)
ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
@@ -5306,7 +5307,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
else
ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
- ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
+ ok(ex_style == ex_style_out, "expected ex_style %#lx, got %#lx\n", ex_style_out, ex_style);
DestroyWindow(hwnd);
@@ -5315,9 +5316,9 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou
param.dlg_data = &dlg_data.dt;
DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc2, (LPARAM)¶m);
- ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
+ ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#lx)\n", style_in);
if (grand_parent)
- ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in);
+ ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#lx)\n", style_in);
DestroyWindow(parent);
DestroyWindow(grand_parent);
@@ -5546,7 +5547,7 @@ static void test_dialog_parent(void)
param.root = parent;
param.ga_root_owner = child;
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m);
- ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
/* Dialogs without WS_CHILD behave as expected, they use passed owner just like CreateWindow does. */
dlg_data.dt.style = WS_OVERLAPPEDWINDOW;
@@ -5567,7 +5568,7 @@ static void test_dialog_parent(void)
param.owner = child;
param.root = param.ga_root_owner = NULL;
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m);
- ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
other = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)reparent_dialog_owner_proc);
@@ -5591,7 +5592,7 @@ static void test_dialog_parent(void)
param.root = NULL;
param.ga_root_owner = child;
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m);
- ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
/* If we change parent in WM_INITDIALOG for WS_CHILD dialog WM_ENTERIDLE is still sent to the original
* parent. EndDialog will enable the new parent. */
@@ -5599,7 +5600,7 @@ static void test_dialog_parent(void)
EnableWindow(other, FALSE);
dlg_data.dt.style = WS_CHILD;
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_dlg_proc, (LPARAM)other);
- ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 2, "DialogBoxIndirectParam returned %Id\n", ret);
ok(!IsWindowEnabled(other), "other is not disabled\n");
ok(!IsWindowEnabled(child), "child is not disabled\n");
ok(IsWindowEnabled(child2), "child2 is not enabled\n");
@@ -5611,7 +5612,7 @@ static void test_dialog_parent(void)
EnableWindow(other, FALSE);
dlg_data.dt.style = WS_OVERLAPPED;
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_owned_dlg_proc, (LPARAM)other);
- ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
ok(!IsWindowEnabled(other), "other is not disabled\n");
ok(!IsWindowEnabled(child), "child is not disabled\n");
ok(IsWindowEnabled(child2), "child2 is not enabled\n");
@@ -5621,14 +5622,14 @@ static void test_dialog_parent(void)
/* Quit dialog message loop by sending WM_QUIT message. Dialog owner is not enabled. */
SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)post_quit_dialog_owner_proc);
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0);
- ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
ok(!IsWindowEnabled(other), "other is enabled\n");
EnableWindow(other, TRUE);
/* Quit dialog message loop by destroying the window. Dialog owner is not enabled. */
SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)destroy_dialog_owner_proc);
ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0);
- ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret);
+ ok(ret == 1, "DialogBoxIndirectParam returned %Id\n", ret);
ok(!IsWindowEnabled(other), "other is enabled\n");
EnableWindow(other, TRUE);
@@ -5663,7 +5664,7 @@ static void test_scrollwindow( HWND hwnd)
flush_events(FALSE);
/* expected: black should have scrolled to the upper half */
colr = GetPixel( hdc, (rc2.left+rc2.right)/ 2, rc2.bottom / 4 );
- ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+ ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
/* Repeat that test of ScrollWindow(Ex) now with clip rectangle */
/* paint the lower half of the window black */
rc2 = rc;
@@ -5683,7 +5684,7 @@ static void test_scrollwindow( HWND hwnd)
flush_events(FALSE);
/* expected: black should have scrolled to the upper half */
colr = GetPixel( hdc, (rc2.left+rc2.right)/ 2, rc2.bottom / 4 );
- ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+ ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
/* clean up */
ReleaseDC( hwnd, hdc);
@@ -5914,11 +5915,11 @@ static void test_scrolldc( HWND parent)
cliprc.top = (rc.top + rc.bottom) /2;
/* test whether scrolled pixels are properly clipped */
colr = GetPixel( hdc, (rc.left+rc.right)/2, ( rc.top + rc.bottom) /2 - 1);
- ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+ ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
/* this scroll should not cause any visible changes */
ScrollDC( hdc, 5, -20, &rc, &cliprc, hrgn, &rcu);
colr = GetPixel( hdc, (rc.left+rc.right)/2, ( rc.top + rc.bottom) /2 - 1);
- ok ( colr == 0, "pixel should be black, color is %08x\n", colr);
+ ok ( colr == 0, "pixel should be black, color is %08lx\n", colr);
/* test with NULL clip rect */
ScrollDC( hdc, 20, -20, &rc, NULL, hrgn, &rcu);
/*FillRgn(hdc, hrgn, GetStockObject(WHITE_BRUSH));*/
@@ -5971,7 +5972,7 @@ static void test_params(void)
/* Just a param check */
SetLastError(0xdeadbeef);
rc = GetWindowTextA(hwndMain2, NULL, 1024);
- ok(!rc, "GetWindowText: rc=%d err=%d\n",rc,GetLastError());
+ ok(!rc, "GetWindowText: rc=%d err=%ld\n",rc,GetLastError());
SetLastError(0xdeadbeef);
hwnd=CreateWindowA("LISTBOX", "TestList",
@@ -5983,7 +5984,7 @@ static void test_params(void)
"CreateWindow with invalid menu handle should fail\n");
if (!hwnd)
ok(GetLastError() == ERROR_INVALID_MENU_HANDLE,
- "wrong last error value %d\n", GetLastError());
+ "wrong last error value %ld\n", GetLastError());
}
static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu)
@@ -5996,7 +5997,7 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu)
0,
menu ? hmenu : 0,
0, 0);
- ok(hwnd != NULL, "Failed to create window class=%s, style=0x%08x, exStyle=0x%08x\n", class, style, exStyle);
+ ok(hwnd != NULL, "Failed to create window class=%s, style=0x%08lx, exStyle=0x%08lx\n", class, style, exStyle);
ShowWindow(hwnd, SW_SHOW);
@@ -6080,7 +6081,7 @@ static void test_AWR_flags(void)
rect2 = rect;
AdjustWindowRectEx( &rect, style, FALSE, exstyle );
wine_AdjustWindowRectEx( &rect2, style, FALSE, exstyle );
- ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n",
+ ok( EqualRect( &rect, &rect2 ), "%08lx %08lx rects do not match: win %s wine %s\n",
style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 ));
if (pAdjustWindowRectExForDpi)
{
@@ -6088,7 +6089,7 @@ static void test_AWR_flags(void)
rect2 = rect;
pAdjustWindowRectExForDpi( &rect, style, FALSE, exstyle, 192 );
wine_AdjustWindowRectExForDpi( &rect2, style, FALSE, exstyle, 192 );
- ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n",
+ ok( EqualRect( &rect, &rect2 ), "%08lx %08lx rects do not match: win %s wine %s\n",
style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 ));
}
}
@@ -6238,7 +6239,7 @@ static void zero_parentdc_test(struct parentdc_test *t)
#define parentdc_field_ok(t, w, r, f, got) \
ok (t.w.r.f==got.w.r.f, "window " #w ", rect " #r ", field " #f \
- ": expected %d, got %d\n", \
+ ": expected %ld, got %ld\n", \
t.w.r.f, got.w.r.f)
#define parentdc_todo_field_ok(t, w, r, f, got) \
@@ -6611,7 +6612,7 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
ok( EqualRect( &rect, r ), "passed rect %s doesn't match window rect %s\n",
wine_dbgstr_rect( r ), wine_dbgstr_rect( &rect ));
ret = DefWindowProcA(hwnd, msg, wp, lp);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
return ret;
}
default:
@@ -6632,13 +6633,13 @@ static void test_CreateWindow(void)
#define expect_menu(window, menu) \
SetLastError(0xdeadbeef); \
res = (GetMenu(window) == (HMENU)menu); \
- ok(res, "GetMenu error %d\n", GetLastError())
+ ok(res, "GetMenu error %ld\n", GetLastError())
#define expect_style(window, style)\
- ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))
+ ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %lx != %lx\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))
#define expect_ex_style(window, ex_style)\
- ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))
+ ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %lx != %lx\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))
hmenu = CreateMenu();
assert(hmenu != 0);
@@ -6647,13 +6648,13 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
res = IsMenu(hmenu);
- ok(res, "IsMenu error %d\n", GetLastError());
+ ok(res, "IsMenu error %ld\n", GetLastError());
/* WS_CHILD */
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, 1);
expect_style(hwnd, WS_CHILD);
expect_ex_style(hwnd, WS_EX_APPWINDOW);
@@ -6662,7 +6663,7 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_CAPTION,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, 1);
expect_style(hwnd, WS_CHILD | WS_CAPTION);
expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
@@ -6671,7 +6672,7 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, 1);
expect_style(hwnd, WS_CHILD);
expect_ex_style(hwnd, 0);
@@ -6680,7 +6681,7 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_CAPTION,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, 1);
expect_style(hwnd, WS_CHILD | WS_CAPTION);
expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
@@ -6690,63 +6691,63 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_POPUP | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_APPWINDOW);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
hmenu = CreateMenu();
assert(hmenu != 0);
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
hmenu = CreateMenu();
assert(hmenu != 0);
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_POPUP | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, 0);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
hmenu = CreateMenu();
assert(hmenu != 0);
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
/* WS_CHILD | WS_POPUP */
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
ok(!hwnd, "CreateWindowEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
if (hwnd)
DestroyWindow(hwnd);
@@ -6755,20 +6756,20 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_APPWINDOW);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
ok(!hwnd, "CreateWindowEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
if (hwnd)
DestroyWindow(hwnd);
@@ -6777,20 +6778,20 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
ok(!hwnd, "CreateWindowEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
if (hwnd)
DestroyWindow(hwnd);
@@ -6799,20 +6800,20 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, 0);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, (HMENU)1, 0, NULL);
ok(!hwnd, "CreateWindowEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
if (hwnd)
DestroyWindow(hwnd);
@@ -6821,14 +6822,14 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION,
0, 0, 100, 100, parent, hmenu, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, hmenu);
expect_style(hwnd, WS_CHILD | WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS);
expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
DestroyWindow(hwnd);
SetLastError(0xdeadbeef);
ok(!IsMenu(hmenu), "IsMenu should fail\n");
- ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %ld\n", GetLastError());
/* test child window sizing */
cls.style = 0;
@@ -6846,7 +6847,7 @@ static void test_CreateWindow(void)
SetLastError(0xdeadbeef);
parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
0, 0, 100, 100, 0, 0, 0, NULL);
- ok(parent != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(parent != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(parent, 0);
expect_style(parent, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_CLIPSIBLINGS);
expect_ex_style(parent, WS_EX_WINDOWEDGE);
@@ -6869,7 +6870,7 @@ static void test_CreateWindow(void)
hwnd = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
parent, (HMENU)1, 0, NULL);
- ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %ld\n", GetLastError());
expect_menu(hwnd, 1);
expect_style(hwnd, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME);
expect_ex_style(hwnd, WS_EX_WINDOWEDGE);
@@ -6892,49 +6893,49 @@ static void test_CreateWindow(void)
SetRect( &expected_rect, 0, 0, 200000, 200000 );
broken_rect = expected_rect;
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 300000, 300000, 200000, 200000, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
ok( rc.right == 200000 || rc.right == 65535 || broken(rc.right == (short)200000),
- "invalid rect right %u\n", rc.right );
+ "invalid rect right %lu\n", rc.right );
ok( rc.bottom == 200000 || rc.bottom == 65535 || broken(rc.bottom == (short)200000),
- "invalid rect bottom %u\n", rc.bottom );
+ "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
expected_cx = expected_cy = -10;
SetRectEmpty(&expected_rect);
SetRect( &broken_rect, 0, 0, -10, -10 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
- ok( rc.right == 0, "invalid rect right %u\n", rc.right );
- ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom );
+ ok( rc.right == 0, "invalid rect right %lu\n", rc.right );
+ ok( rc.bottom == 0, "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
expected_cx = expected_cy = -200000;
SetRectEmpty(&expected_rect);
SetRect( &broken_rect, 0, 0, -200000, -200000 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
- ok( rc.right == 0, "invalid rect right %u\n", rc.right );
- ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom );
+ ok( rc.right == 0, "invalid rect right %lu\n", rc.right );
+ ok( rc.bottom == 0, "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
/* we need a parent at 0,0 so that child coordinates match */
DestroyWindow(parent);
parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
- ok(parent != 0, "CreateWindowEx error %d\n", GetLastError());
+ ok(parent != 0, "CreateWindowEx error %ld\n", GetLastError());
expected_cx = 100;
expected_cy = 0x7fffffff;
SetRect( &expected_rect, 10, 10, 110, 0x7fffffff );
SetRect( &broken_rect, 10, 10, 110, 0x7fffffffU + 10 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 10, 10, 100, 0x7fffffff, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
- ok( rc.right == 100, "invalid rect right %u\n", rc.right );
+ ok( rc.right == 100, "invalid rect right %lu\n", rc.right );
ok( rc.bottom == 0x7fffffff - 10 || rc.bottom ==65535 || broken(rc.bottom == 0),
- "invalid rect bottom %u\n", rc.bottom );
+ "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
expected_cx = 0x7fffffff;
@@ -6942,22 +6943,22 @@ static void test_CreateWindow(void)
SetRect( &expected_rect, 20, 10, 0x7fffffff, 0x7fffffff );
SetRect( &broken_rect, 20, 10, 0x7fffffffU + 20, 0x7fffffffU + 10 );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 20, 10, 0x7fffffff, 0x7fffffff, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
ok( rc.right == 0x7fffffff - 20 || rc.right == 65535 || broken(rc.right == 0),
- "invalid rect right %u\n", rc.right );
+ "invalid rect right %lu\n", rc.right );
ok( rc.bottom == 0x7fffffff - 10 || rc.right == 65535 || broken(rc.bottom == 0),
- "invalid rect bottom %u\n", rc.bottom );
+ "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
/* top level window */
expected_cx = expected_cy = 200000;
SetRect( &expected_rect, 0, 0, GetSystemMetrics(SM_CXMAXTRACK), GetSystemMetrics(SM_CYMAXTRACK) );
hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_OVERLAPPEDWINDOW, 300000, 300000, 200000, 200000, 0, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
GetClientRect( hwnd, &rc );
- ok( rc.right <= expected_cx, "invalid rect right %u\n", rc.right );
- ok( rc.bottom <= expected_cy, "invalid rect bottom %u\n", rc.bottom );
+ ok( rc.right <= expected_cx, "invalid rect right %lu\n", rc.right );
+ ok( rc.bottom <= expected_cy, "invalid rect bottom %lu\n", rc.bottom );
DestroyWindow(hwnd);
/* invalid class */
@@ -6965,7 +6966,7 @@ static void test_CreateWindow(void)
hwnd = CreateWindowExA(0, "INVALID_CLASS", NULL, WS_CHILD, 10, 10, 100, 100, parent, 0, 0, NULL);
ok(hwnd == 0, "CreateWindowEx succeeded\n");
ok(GetLastError() == ERROR_CLASS_DOES_NOT_EXIST || GetLastError() == ERROR_CANNOT_FIND_WND_CLASS,
- "invalid error %u\n", GetLastError());
+ "invalid error %lu\n", GetLastError());
DestroyWindow(hwnd);
hdc = GetDC( parent );
@@ -6977,19 +6978,19 @@ static void test_CreateWindow(void)
SetLastError( 0xdeadbeef );
parent = CreateWindowExA(WS_EX_APPWINDOW | WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP,
0, 0, 100, 100, 0, 0, 0, NULL);
- ok( parent != 0, "creation failed err %u\n", GetLastError());
+ ok( parent != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( parent, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL );
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( hwnd, WS_EX_LAYOUTRTL );
DestroyWindow( hwnd );
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 20, 20, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( hwnd, 0 );
DestroyWindow( hwnd );
SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT );
hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 20, 20, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( hwnd, 0 );
DestroyWindow( hwnd );
@@ -6999,31 +7000,31 @@ static void test_CreateWindow(void)
SetLastError( 0xdeadbeef );
ok( !pGetProcessDefaultLayout( NULL ), "GetProcessDefaultLayout succeeded\n" );
- ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_NOACCESS, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
res = pGetProcessDefaultLayout( &layout );
- ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
- ok( layout == 0, "GetProcessDefaultLayout wrong layout %x\n", layout );
+ ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+ ok( layout == 0, "GetProcessDefaultLayout wrong layout %lx\n", layout );
SetLastError( 0xdeadbeef );
res = pSetProcessDefaultLayout( 7 );
- ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
+ ok( res, "SetProcessDefaultLayout failed err %lu\n", GetLastError ());
res = pGetProcessDefaultLayout( &layout );
- ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
- ok( layout == 7, "GetProcessDefaultLayout wrong layout %x\n", layout );
+ ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+ ok( layout == 7, "GetProcessDefaultLayout wrong layout %lx\n", layout );
SetLastError( 0xdeadbeef );
res = pSetProcessDefaultLayout( LAYOUT_RTL );
- ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
+ ok( res, "SetProcessDefaultLayout failed err %lu\n", GetLastError ());
res = pGetProcessDefaultLayout( &layout );
- ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
- ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %x\n", layout );
+ ok( res, "GetProcessDefaultLayout failed err %lu\n", GetLastError ());
+ ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %lx\n", layout );
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
0, 0, 100, 100, 0, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( hwnd, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL );
DestroyWindow( hwnd );
hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
0, 0, 100, 100, parent, 0, 0, NULL);
- ok( hwnd != 0, "creation failed err %u\n", GetLastError());
+ ok( hwnd != 0, "creation failed err %lu\n", GetLastError());
expect_ex_style( hwnd, WS_EX_APPWINDOW );
DestroyWindow( hwnd );
pSetProcessDefaultLayout( 0 );
@@ -7087,103 +7088,103 @@ static void test_set_window_long_size(void)
/* GWLP_USERDATA */
SetWindowLongPtrA(hwnd, GWLP_USERDATA, ((LONG_PTR)1 << 32) | 123);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
retval = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
ok(retval > 123, "Unexpected user data.\n");
ret = GetWindowWord(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 124, "Unexpected user data %#x.\n", ret);
+ ok(ret == 124, "Unexpected user data %#lx.\n", ret);
retval = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
todo_wine
ok(retval == 124, "Unexpected user data.\n");
SetWindowLongA(hwnd, GWLP_USERDATA, (1 << 16) | 123);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
- ok(ret == ((1 << 16) | 123), "Unexpected user data %#x.\n", ret);
+ ok(ret == ((1 << 16) | 123), "Unexpected user data %#lx.\n", ret);
ret = GetWindowWord(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == ((1 << 16) | 124), "Unexpected user data %#x.\n", ret);
+ ok(ret == ((1 << 16) | 124), "Unexpected user data %#lx.\n", ret);
ret = GetWindowWord(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 124, "Unexpected user data %#x.\n", ret);
+ ok(ret == 124, "Unexpected user data %#lx.\n", ret);
/* GWLP_ID */
ret = SetWindowLongA(hwnd, GWLP_ID, 1);
- ok(!ret, "Unexpected id %#x.\n", ret);
+ ok(!ret, "Unexpected id %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_ID);
- ok(ret == 1, "Unexpected id %#x.\n", ret);
+ ok(ret == 1, "Unexpected id %#lx.\n", ret);
ret = GetWindowLongW(hwnd, GWLP_ID);
- ok(ret == 1, "Unexpected id %#x.\n", ret);
+ ok(ret == 1, "Unexpected id %#lx.\n", ret);
SetWindowLongPtrA(hwnd, GWLP_ID, ((LONG_PTR)1 << 32) | 123);
ret = GetWindowLongA(hwnd, GWLP_ID);
- ok(ret == 123, "Unexpected id %#x.\n", ret);
+ ok(ret == 123, "Unexpected id %#lx.\n", ret);
ret = GetWindowLongW(hwnd, GWLP_ID);
- ok(ret == 123, "Unexpected id %#x.\n", ret);
+ ok(ret == 123, "Unexpected id %#lx.\n", ret);
retval = GetWindowLongPtrA(hwnd, GWLP_ID);
ok(retval > 123, "Unexpected id.\n");
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_ID);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
/* GWLP_HINSTANCE */
retval = GetWindowLongPtrA(hwnd, GWLP_HINSTANCE);
- ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#lx.\n", retval);
+ ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#Ix.\n", retval);
SetLastError(0xdeadbeef);
ret = GetWindowLongA(hwnd, GWLP_HINSTANCE);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = GetWindowLongW(hwnd, GWLP_HINSTANCE);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_HINSTANCE);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowLongA(hwnd, GWLP_HINSTANCE, 1);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowLongW(hwnd, GWLP_HINSTANCE, 1);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
/* GWLP_HWNDPARENT */
SetLastError(0xdeadbeef);
ret = GetWindowLongA(hwnd, GWLP_HWNDPARENT);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowLongA(hwnd, GWLP_HWNDPARENT, 0);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowLongW(hwnd, GWLP_HWNDPARENT, 0);
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_HWNDPARENT);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
DestroyWindow(hwnd);
#endif
@@ -7218,59 +7219,59 @@ static void test_set_window_word_size(void)
/* GWLP_USERDATA */
ret = SetWindowLongA(hwnd, GWLP_USERDATA, (1 << 16) | 123);
- ok(!ret, "Unexpected user data %#x.\n", ret);
+ ok(!ret, "Unexpected user data %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
- ok(ret > 123, "Unexpected user data %#x.\n", ret);
+ ok(ret > 123, "Unexpected user data %#lx.\n", ret);
ret = GetWindowWord(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = SetWindowWord(hwnd, GWLP_USERDATA, 124);
todo_wine
- ok(ret == 123, "Unexpected user data %#x.\n", ret);
+ ok(ret == 123, "Unexpected user data %#lx.\n", ret);
ret = GetWindowWord(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == 124, "Unexpected user data %#x.\n", ret);
+ ok(ret == 124, "Unexpected user data %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_USERDATA);
todo_wine
- ok(ret == ((1 << 16) | 124), "Unexpected user data %#x.\n", ret);
+ ok(ret == ((1 << 16) | 124), "Unexpected user data %#lx.\n", ret);
/* GWLP_ID */
ret = SetWindowLongA(hwnd, GWLP_ID, 1);
- ok(!ret, "Unexpected id %#x.\n", ret);
+ ok(!ret, "Unexpected id %#lx.\n", ret);
ret = GetWindowLongA(hwnd, GWLP_ID);
- ok(ret == 1, "Unexpected id %#x.\n", ret);
+ ok(ret == 1, "Unexpected id %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_ID);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowWord(hwnd, GWLP_ID, 2);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected id %#lx.\n", ret);
/* GWLP_HINSTANCE */
retval = GetWindowLongPtrA(hwnd, GWLP_HINSTANCE);
- ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#lx.\n", retval);
+ ok(retval == (LONG_PTR)GetModuleHandleA(NULL), "Unexpected instance %#Ix.\n", retval);
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_HINSTANCE);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = SetWindowWord(hwnd, GWLP_HINSTANCE, 0xdead);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected instance %#lx.\n", ret);
/* GWLP_HWNDPARENT */
retval = GetWindowLongPtrA(hwnd, GWLP_HWNDPARENT);
- ok(!!retval, "Unexpected parent window %#x.\n", ret);
+ ok(!!retval, "Unexpected parent window %#lx.\n", ret);
SetLastError(0xdeadbeef);
ret = GetWindowWord(hwnd, GWLP_HWNDPARENT);
todo_wine
- ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#x.\n", ret);
+ ok(!ret && GetLastError() == ERROR_INVALID_INDEX, "Unexpected parent window %#lx.\n", ret);
DestroyWindow(hwnd);
}
@@ -7282,24 +7283,24 @@ static void test_SetWindowLong(void)
SetLastError(0xdeadbeef);
retval = SetWindowLongPtrA(NULL, GWLP_WNDPROC, 0);
- ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%lx\n", retval);
+ ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%Ix\n", retval);
ok(check_error(GetLastError(), ERROR_INVALID_WINDOW_HANDLE),
- "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %d\n", GetLastError());
+ "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %ld\n", GetLastError());
SetLastError(0xdeadbeef);
retval = SetWindowLongPtrA(hwndMain, 0xdeadbeef, 0);
- ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%lx\n", retval);
+ ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%Ix\n", retval);
ok(check_error(GetLastError(), ERROR_INVALID_INDEX),
- "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %d\n", GetLastError());
+ "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %ld\n", GetLastError());
SetLastError(0xdeadbeef);
retval = SetWindowLongPtrA(hwndMain, GWLP_WNDPROC, 0);
ok((WNDPROC)retval == main_window_procA,
- "SetWindowLongPtr on invalid window proc should have returned address of main_window_procA instead of 0x%lx\n", retval);
- ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %d\n", GetLastError());
+ "SetWindowLongPtr on invalid window proc should have returned address of main_window_procA instead of 0x%Ix\n", retval);
+ ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %ld\n", GetLastError());
retval = GetWindowLongPtrA(hwndMain, GWLP_WNDPROC);
ok((WNDPROC)retval == main_window_procA,
- "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%lx\n", retval);
+ "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%Ix\n", retval);
ok(!IsWindowUnicode(hwndMain), "hwndMain shouldn't be Unicode\n");
old_window_procW = (WNDPROC)GetWindowLongPtrW(hwndMain, GWLP_WNDPROC);
@@ -7307,10 +7308,10 @@ static void test_SetWindowLong(void)
retval = SetWindowLongPtrW(hwndMain, GWLP_WNDPROC, 0);
if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
{
- ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %d\n", GetLastError());
- ok(retval != 0, "SetWindowLongPtr error %d\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %ld\n", GetLastError());
+ ok(retval != 0, "SetWindowLongPtr error %ld\n", GetLastError());
ok((WNDPROC)retval == old_window_procW,
- "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%lx\n", retval);
+ "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%Ix\n", retval);
ok(IsWindowUnicode(hwndMain), "hwndMain should now be Unicode\n");
/* set it back to ANSI */
@@ -7328,16 +7329,16 @@ static LRESULT WINAPI check_style_wnd_proc(HWND hwnd, UINT message, WPARAM wPara
if (message == WM_STYLECHANGING && wParam == GWL_STYLE)
{
- ok(got->styleOld == expected[0].styleOld, "expected old style %#x, got %#x\n",
+ ok(got->styleOld == expected[0].styleOld, "expected old style %#lx, got %#lx\n",
expected[0].styleOld, got->styleOld);
- ok(got->styleNew == expected[0].styleNew, "expected new style %#x, got %#x\n",
+ ok(got->styleNew == expected[0].styleNew, "expected new style %#lx, got %#lx\n",
expected[0].styleNew, got->styleNew);
}
else if (message == WM_STYLECHANGED && wParam == GWL_STYLE)
{
- ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
+ ok(got->styleOld == expected[1].styleOld, "expected old style %#lx, got %#lx\n",
expected[1].styleOld, got->styleOld);
- ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
+ ok(got->styleNew == expected[1].styleNew, "expected new style %#lx, got %#lx\n",
expected[1].styleNew, got->styleNew);
}
@@ -7400,10 +7401,10 @@ static void test_set_window_style(void)
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)&expected_stylestruct);
old_style = SetWindowLongA(hwnd, GWL_STYLE, tests[i].style);
- ok(old_style == tests[i].creation_style, "expected old style %#x, got %#x\n",
+ ok(old_style == tests[i].creation_style, "expected old style %#lx, got %#lx\n",
tests[i].creation_style, old_style);
new_style = GetWindowLongA(hwnd, GWL_STYLE);
- ok(new_style == expected_style, "expected new style %#x, got %#x\n",
+ ok(new_style == expected_style, "expected new style %#lx, got %#lx\n",
expected_style, new_style);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0);
@@ -7471,7 +7472,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_SHOW);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7485,7 +7486,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_MINIMIZE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7502,7 +7503,7 @@ static void test_ShowWindow(void)
(rcMinimized.right - rcMinimized.left) * 2,
(rcMinimized.bottom - rcMinimized.top) * 2,
SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
GetWindowRect(hwnd, &rc);
ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n",
wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
@@ -7512,7 +7513,7 @@ static void test_ShowWindow(void)
/* SetWindowPos shouldn't affect the client rect */
ret = SetWindowPos(hwnd, 0, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
GetWindowRect(hwnd, &rc);
ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n",
wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
@@ -7523,12 +7524,12 @@ static void test_ShowWindow(void)
GetWindowRect(hwnd, &rc);
SetRect(&rcNonClient, rc.left, rc.top, rc.left, rc.top);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&rc, &rcNonClient), "expected %s, got %s\n",
wine_dbgstr_rect(&rcNonClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7542,7 +7543,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_MAXIMIZE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7553,14 +7554,14 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcMaximized), wine_dbgstr_rect(&rc));
/* maximized windows can be resized */
ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
SetRect(&rcResized, 300, 300, 500, 500);
GetWindowRect(hwnd, &rc);
ok(EqualRect(&rcResized, &rc), "expected %s, got %s\n",
wine_dbgstr_rect(&rcResized), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7571,12 +7572,12 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rc));
ret = EnableWindow(hwnd, FALSE);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7590,7 +7591,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7604,7 +7605,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_MINIMIZE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7618,7 +7619,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7632,7 +7633,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_DISABLED, "window should be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7646,14 +7647,14 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
ok(IsWindow(hwnd), "window should exist\n");
ret = EnableWindow(hwnd, TRUE);
- ok(ret, "not expected ret: %lu\n", ret);
+ ok(ret, "not expected ret: %Iu\n", ret);
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
- ok(!ret, "not expected ret: %lu\n", ret);
+ ok(!ret, "not expected ret: %Iu\n", ret);
ok(!IsWindow(hwnd), "window should not exist\n");
hwnd = CreateWindowExA(0, "MainWindowClass", NULL,
@@ -7662,7 +7663,7 @@ static void test_ShowWindow(void)
rcMain.left, rcMain.top,
rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
0, 0, 0, NULL);
- ok(hwnd != NULL, "failed to create window with error %u\n", GetLastError());
+ ok(hwnd != NULL, "failed to create window with error %lu\n", GetLastError());
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_MINIMIZE, "window should be minimized\n");
GetWindowRect(hwnd, &rc);
@@ -7680,7 +7681,7 @@ static void test_ShowWindow(void)
rcMain.left, rcMain.top,
rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
0, 0, 0, NULL);
- ok(hwnd != NULL, "failed to create window with error %u\n", GetLastError());
+ ok(hwnd != NULL, "failed to create window with error %lu\n", GetLastError());
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_MINIMIZE, "window should be minimized\n");
GetWindowRect(hwnd, &rc);
@@ -7703,7 +7704,7 @@ static void test_ShowWindow(void)
rcMain.left, rcMain.top,
rcMain.right - rcMain.left, rcMain.bottom - rcMain.top,
0, 0, 0, NULL);
- ok(hwnd != NULL, "Test %u: failed to create window with error %u\n", i, GetLastError());
+ ok(hwnd != NULL, "Test %u: failed to create window with error %lu\n", i, GetLastError());
GetWindowRect(hwnd, &rcMain);
ok(rcMain.left > mon_info.rcMonitor.left &&
@@ -7717,7 +7718,7 @@ static void test_ShowWindow(void)
0, GetWindowLongA(hwnd, GWL_EXSTYLE));
ret = ShowWindow(hwnd, SW_MAXIMIZE);
- ok(ret, "unexpected ret: %lu\n", ret);
+ ok(ret, "unexpected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(style & WS_MAXIMIZE, "Test %u: window should be maximized\n", i);
GetWindowRect(hwnd, &rc);
@@ -7734,7 +7735,7 @@ static void test_ShowWindow(void)
wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "unexpected ret: %lu\n", ret);
+ ok(ret, "unexpected ret: %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_MAXIMIZE), "Test %u: window should not be maximized\n", i);
GetWindowRect(hwnd, &rc);
@@ -7761,12 +7762,12 @@ static void test_ShowWindow_owned(HWND hwndMain)
WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, hwndMain, 0, 0, NULL);
- ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
hwnd2 = CreateWindowA("MainWindowClass", "owned2", WS_CAPTION | WS_SYSMENU |
WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, hwndMain, 0, 0, NULL);
- ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
@@ -7778,7 +7779,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_SHOW);
- ok(!ret, "wrong ret %lu\n", ret);
+ ok(!ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7789,7 +7790,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7803,7 +7804,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* shouldn't be able to resize minimized windows */
ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
todo_wine
ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
@@ -7812,7 +7813,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
GetWindowRect(hwnd, &rect);
SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
@@ -7820,7 +7821,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
* on top of each other) */
OffsetRect(&expect, GetSystemMetrics(SM_CXMINIMIZED), 0);
ret = ShowWindow(hwnd2, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd2, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7832,7 +7833,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7843,7 +7844,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MAXIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7857,14 +7858,14 @@ static void test_ShowWindow_owned(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* maximized windows can be resized */
ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
SetRect(&expect, 300, 300, 500, 500);
ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7891,12 +7892,12 @@ static void test_ShowWindow_child(HWND hwndMain)
WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, hwndMain, 0, 0, NULL);
- ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
hwnd2 = CreateWindowA("MainWindowClass", "child2", WS_CAPTION | WS_SYSMENU |
WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD | WS_VISIBLE,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, hwndMain, 0, 0, NULL);
- ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
ClientToScreen(hwndMain, &pt);
OffsetRect(&orig, pt.x, pt.y);
@@ -7911,7 +7912,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_SHOW);
- ok(!ret, "wrong ret %lu\n", ret);
+ ok(!ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7922,7 +7923,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7937,7 +7938,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* shouldn't be able to resize minimized windows */
ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -7945,7 +7946,7 @@ static void test_ShowWindow_child(HWND hwndMain)
GetWindowRect(hwnd, &rect);
SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
@@ -7953,7 +7954,7 @@ static void test_ShowWindow_child(HWND hwndMain)
* fit more than one per row */
OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
ret = ShowWindow(hwnd2, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd2, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7964,7 +7965,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7975,7 +7976,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MAXIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -7990,7 +7991,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* maximized windows can be resized */
ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
SetRect(&expect, 300, 300, 500, 500);
OffsetRect(&expect, pt.x, pt.y);
@@ -7998,7 +7999,7 @@ static void test_ShowWindow_child(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8026,17 +8027,17 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
mdiclient = CreateWindowA("mdiclient", "MDI client", WS_CHILD,
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
hwndMain, 0, 0, &mdi_client_cs);
- ok(!!mdiclient, "failed to create window, error %u\n", GetLastError());
+ ok(!!mdiclient, "failed to create window, error %lu\n", GetLastError());
hwnd = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child",
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, mdiclient, 0, 0, NULL);
- ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
hwnd2 = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child 2",
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, mdiclient, 0, 0, NULL);
- ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd2, "failed to create window, error %lu\n", GetLastError());
ClientToScreen(hwndMain, &pt);
OffsetRect(&orig, pt.x, pt.y);
@@ -8051,7 +8052,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8066,7 +8067,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* shouldn't be able to resize minimized windows */
ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -8074,7 +8075,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
GetWindowRect(hwnd, &rect);
SetRect(&nc, rect.left, rect.top, rect.left, rect.top);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&rect, &nc), "expected %s, got %s\n",
wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
@@ -8082,7 +8083,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
* fit more than one per row */
OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
ret = ShowWindow(hwnd2, SW_MINIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd2, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8093,7 +8094,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8104,7 +8105,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_MAXIMIZE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8119,7 +8120,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
/* maximized windows can be resized */
ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
GetWindowRect(hwnd, &rect);
SetRect(&expect, 300, 300, 500, 500);
OffsetRect(&expect, pt.x, pt.y);
@@ -8127,7 +8128,7 @@ static void test_ShowWindow_mdichild(HWND hwndMain)
wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
ret = ShowWindow(hwnd, SW_RESTORE);
- ok(ret, "wrong ret %lu\n", ret);
+ ok(ret, "wrong ret %Iu\n", ret);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok(!(style & WS_DISABLED), "window should not be disabled\n");
ok(style & WS_VISIBLE, "window should be visible\n");
@@ -8231,7 +8232,7 @@ static DWORD CALLBACK gettext_msg_thread( LPVOID arg )
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
return 0;
}
@@ -8245,7 +8246,7 @@ static DWORD CALLBACK settext_msg_thread( LPVOID arg )
num_settext_msgs = 0;
success = SetWindowTextA( hwnd, "thread_caption" );
ok( success, "SetWindowTextA failed\n" );
- ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+ ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
return 0;
}
@@ -8264,7 +8265,7 @@ static void test_gettext(void)
MSG msg;
hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
/* test GetWindowTextA */
num_gettext_msgs = 0;
@@ -8272,7 +8273,7 @@ static void test_gettext(void)
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
/* other process window */
strcpy( buf, "a" );
@@ -8298,7 +8299,7 @@ static void test_gettext(void)
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len == 0, "got %d\n", buf_len );
ok( *buf == 0, "got %x\n", *buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
strcpy( buf, "blah" );
@@ -8306,7 +8307,7 @@ static void test_gettext(void)
buf_len = GetWindowTextA( hwnd, buf, 0 );
ok( buf_len == 0, "got %d\n", buf_len );
ok( !strcmp(buf, "blah"), "got %s\n", buf );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
bufW[0] = 0xcc;
buf_len = InternalGetWindowText( hwnd, bufW, ARRAYSIZE(bufW) );
@@ -8317,7 +8318,7 @@ static void test_gettext(void)
/* same for W window */
hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd2 != 0, "CreateWindowExA error %ld\n", GetLastError() );
g_wm_gettext_override.enabled = TRUE;
@@ -8327,7 +8328,7 @@ static void test_gettext(void)
buf_len = GetWindowTextW( hwnd2, bufW, ARRAY_SIZE(bufW));
ok( buf_len == 0, "got %d\n", buf_len );
ok( *bufW == 0, "got %x\n", *bufW );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
memset( bufW, 0xcc, sizeof(bufW) );
@@ -8335,7 +8336,7 @@ static void test_gettext(void)
buf_len = GetWindowTextW( hwnd2, bufW, 0 );
ok( buf_len == 0, "got %d\n", buf_len );
ok( *bufW == 0xcccc, "got %x\n", *bufW );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
g_wm_gettext_override.enabled = FALSE;
@@ -8347,33 +8348,33 @@ static void test_gettext(void)
r = SendMessageA( hwnd, WM_GETTEXT, sizeof(buf), (LONG_PTR)buf );
ok( r != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
/* test SetWindowTextA */
num_settext_msgs = 0;
success = SetWindowTextA( hwnd, "new_caption" );
ok( success, "SetWindowTextA failed\n" );
- ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+ ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
num_gettext_msgs = 0;
memset( buf, 0, sizeof(buf) );
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "new_caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
/* test WM_SETTEXT */
num_settext_msgs = 0;
r = SendMessageA( hwnd, WM_SETTEXT, 0, (ULONG_PTR)"another_caption" );
ok( r != 0, "WM_SETTEXT failed\n" );
- ok( num_settext_msgs == 1, "got %u WM_SETTEXT messages\n", num_settext_msgs );
+ ok( num_settext_msgs == 1, "got %lu WM_SETTEXT messages\n", num_settext_msgs );
num_gettext_msgs = 0;
memset( buf, 0, sizeof(buf) );
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
DispatchMessageA( &msg );
@@ -8381,7 +8382,7 @@ static void test_gettext(void)
/* test interthread GetWindowTextA */
num_msgs = 0;
thread = CreateThread( NULL, 0, gettext_msg_thread, hwnd, 0, &tid );
- ok(thread != NULL, "CreateThread failed, error %d\n", GetLastError());
+ ok(thread != NULL, "CreateThread failed, error %ld\n", GetLastError());
while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_SENDMESSAGE ) != WAIT_OBJECT_0)
{
while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
@@ -8389,12 +8390,12 @@ static void test_gettext(void)
num_msgs++;
}
CloseHandle( thread );
- ok( num_msgs >= 1, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs );
+ ok( num_msgs >= 1, "got %lu wakeups from MsgWaitForMultipleObjects\n", num_msgs );
/* test interthread SetWindowText */
num_msgs = 0;
thread = CreateThread( NULL, 0, settext_msg_thread, hwnd, 0, &tid );
- ok(thread != NULL, "CreateThread failed, error %d\n", GetLastError());
+ ok(thread != NULL, "CreateThread failed, error %ld\n", GetLastError());
while (MsgWaitForMultipleObjects( 1, &thread, FALSE, INFINITE, QS_SENDMESSAGE ) != WAIT_OBJECT_0)
{
while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE ))
@@ -8402,14 +8403,14 @@ static void test_gettext(void)
num_msgs++;
}
CloseHandle( thread );
- ok( num_msgs >= 1, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs );
+ ok( num_msgs >= 1, "got %lu wakeups from MsgWaitForMultipleObjects\n", num_msgs );
num_gettext_msgs = 0;
memset( buf, 0, sizeof(buf) );
buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
ok( buf_len != 0, "expected a nonempty window text\n" );
ok( !strcmp(buf, "thread_caption"), "got wrong window text '%s'\n", buf );
- ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 1, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
/* WM_GETTEXT does not terminate returned string */
memset( buf, 0x1c, sizeof(buf) );
@@ -8429,7 +8430,7 @@ static void test_gettext(void)
g_wm_gettext_override.dont_terminate = FALSE;
hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd2 != 0, "CreateWindowExA error %ld\n", GetLastError() );
memset( buf, 0x1c, sizeof(buf) );
g_wm_gettext_override.dont_terminate = TRUE;
@@ -8453,36 +8454,36 @@ static void test_gettext(void)
if (0)
{
r = SendMessageA( hwnd, WM_GETTEXT, 0x10, 0x1000);
- ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+ ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
r = SendMessageA( hwnd, WM_GETTEXT, 0x10000, 0);
- ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+ ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
r = SendMessageA( hwnd, WM_GETTEXT, 0xff000000, 0x1000);
- ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+ ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
r = SendMessageA( hwnd, WM_GETTEXT, 0x1000, 0xff000000);
- ok( r == 0, "WM_GETTEXT should return zero (%ld)\n", r );
+ ok( r == 0, "WM_GETTEXT should return zero (%Id)\n", r );
}
/* GetWindowText doesn't crash */
r = GetWindowTextA( hwnd, (LPSTR)0x10, 0x1000 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextA( hwnd, (LPSTR)0x10000, 0 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextA( hwnd, (LPSTR)0xff000000, 0x1000 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextA( hwnd, (LPSTR)0x1000, 0xff000000 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextW( hwnd, (LPWSTR)0x10, 0x1000 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextW( hwnd, (LPWSTR)0x10000, 0 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextW( hwnd, (LPWSTR)0xff000000, 0x1000 );
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
r = GetWindowTextW( hwnd, (LPWSTR)0x1000, 0xff000000);
- ok( r == 0, "GetWindowText should return zero (%ld)\n", r );
+ ok( r == 0, "GetWindowText should return zero (%Id)\n", r );
DestroyWindow(hwnd);
}
@@ -8741,12 +8742,12 @@ static void test_GetWindowModuleFileName(void)
buf1[0] = 0;
SetLastError(0xdeadbeef);
ret1 = GetModuleFileNameA(hinst, buf1, sizeof(buf1));
- ok(ret1, "GetModuleFileName error %u\n", GetLastError());
+ ok(ret1, "GetModuleFileName error %lu\n", GetLastError());
buf2[0] = 0;
SetLastError(0xdeadbeef);
ret2 = pGetWindowModuleFileNameA(hwnd, buf2, sizeof(buf2));
- ok(ret2, "GetWindowModuleFileNameA error %u\n", GetLastError());
+ ok(ret2, "GetWindowModuleFileNameA error %lu\n", GetLastError());
if (ret2)
{
@@ -8760,28 +8761,28 @@ static void test_GetWindowModuleFileName(void)
ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
ok(GetLastError() == 0xdeadbeef /* XP */ ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
- "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+ "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret2 = GetModuleFileNameA(hinst, buf2, 0);
ok(!ret2, "GetModuleFileName should return 0\n");
ok(GetLastError() == 0xdeadbeef /* XP */ ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
- "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+ "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret2 = pGetWindowModuleFileNameA(hwnd, buf2, ret1 - 2);
ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
ok(GetLastError() == 0xdeadbeef /* XP */ ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
- "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+ "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret2 = pGetWindowModuleFileNameA(hwnd, buf2, 0);
ok(!ret2, "expected 0, got %u\n", ret2);
ok(GetLastError() == 0xdeadbeef /* XP */ ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */
- "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
+ "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
DestroyWindow(hwnd);
@@ -8791,7 +8792,7 @@ static void test_GetWindowModuleFileName(void)
ret1 = pGetWindowModuleFileNameA(hwnd, buf1, sizeof(buf1));
ok(!ret1, "expected 0, got %u\n", ret1);
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
- "expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+ "expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
hwnd = FindWindowA("Shell_TrayWnd", NULL);
ok(IsWindow(hwnd) || broken(!hwnd), "got invalid tray window %p\n", hwnd);
@@ -8865,7 +8866,7 @@ static void test_hwnd_message(void)
SetLastError(0xdeadbeef);
found = FindWindowExA( GetDesktopWindow(), 0, 0, "message window" );
ok( found == 0, "found message window %p/%p\n", found, hwnd );
- ok( GetLastError() == 0xdeadbeef, "expected deadbeef, got %d\n", GetLastError() );
+ ok( GetLastError() == 0xdeadbeef, "expected deadbeef, got %ld\n", GetLastError() );
if (parent)
{
found = FindWindowExA( parent, 0, 0, "message window" );
@@ -8886,13 +8887,13 @@ static void test_hwnd_message(void)
{
SetLastError( 0xdeadbeef );
result = GetWindowLongPtrW( parent, tests[i].offset );
- ok( result == tests[i].expect, "offset %d, got %08lx expect %08lx\n",
+ ok( result == tests[i].expect, "offset %d, got %08Ix expect %08Ix\n",
tests[i].offset, result, tests[i].expect );
if (tests[i].error)
- ok( GetLastError() == tests[i].error, "offset %d: error %d expect %d\n",
+ ok( GetLastError() == tests[i].error, "offset %d: error %ld expect %ld\n",
tests[i].offset, GetLastError(), tests[i].error );
else
- ok( GetLastError() == 0xdeadbeef, "offset %d: error %d expect unchanged\n",
+ ok( GetLastError() == 0xdeadbeef, "offset %d: error %ld expect unchanged\n",
tests[i].offset, GetLastError() );
}
@@ -8928,7 +8929,7 @@ static void test_layered_window(void)
SetLastError( 0xdeadbeef );
ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( !ret, "GetLayeredWindowAttributes should fail on non-layered window\n" );
ret = pSetLayeredWindowAttributes( hwnd, 0, 0, LWA_ALPHA );
@@ -8944,13 +8945,13 @@ static void test_layered_window(void)
ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
- ok( key == 0x123456 || key == 0, "wrong color key %x\n", key );
+ ok( key == 0x123456 || key == 0, "wrong color key %lx\n", key );
ok( alpha == 44, "wrong alpha %u\n", alpha );
- ok( flags == LWA_ALPHA, "wrong flags %x\n", flags );
+ ok( flags == LWA_ALPHA, "wrong flags %lx\n", flags );
SetLastError( 0xdeadbeef );
ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
/* clearing WS_EX_LAYERED resets attributes */
SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
@@ -8966,7 +8967,7 @@ static void test_layered_window(void)
ok( ret, "UpdateLayeredWindow should succeed on layered window\n" );
ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE | ULW_EX_NORESIZE );
ok( !ret, "UpdateLayeredWindow should fail with ex flag\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
if (pUpdateLayeredWindowIndirect)
{
UPDATELAYEREDWINDOWINFO info;
@@ -8988,7 +8989,7 @@ static void test_layered_window(void)
ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
/* particular error code differs from version to version, could be ERROR_INCORRECT_SIZE,
ERROR_MR_MID_NOT_FOUND or ERROR_GEN_FAILURE (Win8/Win10) */
- ok( GetLastError() != 0, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() != 0, "wrong error %lu\n", GetLastError() );
info.dwFlags = ULW_OPAQUE;
ret = pUpdateLayeredWindowIndirect( hwnd, &info );
ok( ret, "UpdateLayeredWindowIndirect should succeed on layered window\n" );
@@ -8996,38 +8997,38 @@ static void test_layered_window(void)
info.dwFlags = ULW_OPAQUE | 0xf00;
ret = pUpdateLayeredWindowIndirect( hwnd, &info );
ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
info.cbSize--;
info.dwFlags = ULW_OPAQUE;
ret = pUpdateLayeredWindowIndirect( hwnd, &info );
ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
ret = pUpdateLayeredWindowIndirect( hwnd, NULL );
ok( !ret, "UpdateLayeredWindowIndirect should fail\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
}
ret = pSetLayeredWindowAttributes( hwnd, 0x654321, 22, LWA_COLORKEY | LWA_ALPHA );
ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
- ok( key == 0x654321, "wrong color key %x\n", key );
+ ok( key == 0x654321, "wrong color key %lx\n", key );
ok( alpha == 22, "wrong alpha %u\n", alpha );
- ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %x\n", flags );
+ ok( flags == (LWA_COLORKEY | LWA_ALPHA), "wrong flags %lx\n", flags );
SetLastError( 0xdeadbeef );
ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE );
ok( !ret, "UpdateLayeredWindow should fail on layered but initialized window\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
ret = pSetLayeredWindowAttributes( hwnd, 0x888888, 33, LWA_COLORKEY );
ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
alpha = 0;
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
- ok( key == 0x888888, "wrong color key %x\n", key );
+ ok( key == 0x888888, "wrong color key %lx\n", key );
/* alpha not changed on vista if LWA_ALPHA is not set */
ok( alpha == 22 || alpha == 33, "wrong alpha %u\n", alpha );
- ok( flags == LWA_COLORKEY, "wrong flags %x\n", flags );
+ ok( flags == LWA_COLORKEY, "wrong flags %lx\n", flags );
/* color key may or may not be changed without LWA_COLORKEY */
ret = pSetLayeredWindowAttributes( hwnd, 0x999999, 44, 0 );
@@ -9035,9 +9036,9 @@ static void test_layered_window(void)
alpha = 0;
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
- ok( key == 0x888888 || key == 0x999999, "wrong color key %x\n", key );
+ ok( key == 0x888888 || key == 0x999999, "wrong color key %lx\n", key );
ok( alpha == 22 || alpha == 44, "wrong alpha %u\n", alpha );
- ok( flags == 0, "wrong flags %x\n", flags );
+ ok( flags == 0, "wrong flags %lx\n", flags );
/* default alpha and color key is 0 */
SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED );
@@ -9046,9 +9047,9 @@ static void test_layered_window(void)
ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" );
ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags );
ok( ret, "GetLayeredWindowAttributes should succeed on layered window\n" );
- ok( key == 0 || key == 0x222222, "wrong color key %x\n", key );
+ ok( key == 0 || key == 0x222222, "wrong color key %lx\n", key );
ok( alpha == 0 || alpha == 55, "wrong alpha %u\n", alpha );
- ok( flags == 0, "wrong flags %x\n", flags );
+ ok( flags == 0, "wrong flags %lx\n", flags );
/* test layered window with WS_CLIPCHILDREN flag */
SetWindowLongA( hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_CLIPCHILDREN );
@@ -9056,7 +9057,7 @@ static void test_layered_window(void)
SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
child = CreateWindowExA( 0, "button", "button", WS_VISIBLE | WS_CHILD,
0, 0, 50, 50, hwnd, 0, 0, NULL );
- ok( child != NULL, "CreateWindowEx error %u\n", GetLastError() );
+ ok( child != NULL, "CreateWindowEx error %lu\n", GetLastError() );
ShowWindow( hwnd, SW_SHOW );
ret = pSetLayeredWindowAttributes( hwnd, 0, 255, LWA_ALPHA );
@@ -9107,16 +9108,16 @@ static LRESULT CALLBACK fullscreen_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPAR
case WM_GETMINMAXINFO:
{
MINMAXINFO *minmax = (MINMAXINFO *)lp;
- ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%d <= %d\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
- ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%d <= %d\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
- ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%d >= %d\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
- ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%d >= %d\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
+ ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%ld <= %ld\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
+ ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%ld <= %ld\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
+ ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%ld >= %ld\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
+ ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%ld >= %ld\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
break;
}
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wp, lp);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wp, lp);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wp, lp);
return ret;
}
}
@@ -9143,12 +9144,12 @@ static void test_fullscreen(void)
pt.x = pt.y = 0;
SetLastError(0xdeadbeef);
hmon = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
- ok(hmon != 0, "MonitorFromPoint error %u\n", GetLastError());
+ ok(hmon != 0, "MonitorFromPoint error %lu\n", GetLastError());
mi.cbSize = sizeof(mi);
SetLastError(0xdeadbeef);
ret = GetMonitorInfoA(hmon, &mi);
- ok(ret, "GetMonitorInfo error %u\n", GetLastError());
+ ok(ret, "GetMonitorInfo error %lu\n", GetLastError());
trace("monitor %s, work %s\n", wine_dbgstr_rect(&mi.rcMonitor), wine_dbgstr_rect(&mi.rcWork));
cls.style = 0;
@@ -9180,58 +9181,58 @@ static void test_fullscreen(void)
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
DestroyWindow(hwnd);
style = t_style[i] | WS_MAXIMIZE;
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
DestroyWindow(hwnd);
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION;
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
DestroyWindow(hwnd);
style = t_style[i] | WS_CAPTION | WS_MAXIMIZEBOX;
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
DestroyWindow(hwnd);
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION | WS_MAXIMIZEBOX;
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
/* Windows makes a maximized window slightly larger (to hide the borders?) */
fixup = min(abs(rc.left), abs(rc.top));
InflateRect(&rc, -fixup, -fixup);
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s must be in %s\n", ex_style, style, wine_dbgstr_rect(&rc),
+ "%#lx/%#lx: window rect %s must be in %s\n", ex_style, style, wine_dbgstr_rect(&rc),
wine_dbgstr_rect(&mi.rcMonitor));
DestroyWindow(hwnd);
@@ -9239,7 +9240,7 @@ static void test_fullscreen(void)
hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style,
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
+ ok(hwnd != 0, "%d: CreateWindowExA(%#lx/%#lx) failed\n", i, ex_style, style);
GetWindowRect(hwnd, &rc);
/* Windows makes a maximized window slightly larger (to hide the borders?) */
fixup = min(abs(rc.left), abs(rc.top));
@@ -9247,11 +9248,11 @@ static void test_fullscreen(void)
if (style & (WS_CHILD | WS_POPUP))
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
else
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
- "%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
+ "%#lx/%#lx: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
DestroyWindow(hwnd);
}
}
@@ -9260,7 +9261,7 @@ static void test_fullscreen(void)
/* Add WS_THICKFRAME style later so that the window can cover the entire monitor */
hwnd = CreateWindowA("fullscreen_class", NULL, WS_POPUP | WS_VISIBLE, 0, 0, mi.rcMonitor.right,
mi.rcMonitor.bottom, NULL, NULL, GetModuleHandleA(NULL), NULL);
- ok(!!hwnd, "CreateWindow failed, error %#x.\n", GetLastError());
+ ok(!!hwnd, "CreateWindow failed, error %#lx.\n", GetLastError());
flush_events(TRUE);
/* Add WS_THICKFRAME and exit full screen */
@@ -9278,8 +9279,8 @@ static void test_fullscreen(void)
if (rc.right - rc.left == 100 && rc.bottom - rc.top == 100)
break;
}
- ok(rc.right - rc.left == 100, "Expect width %d, got %d.\n", 100, rc.right - rc.left);
- ok(rc.bottom - rc.top == 100, "Expect height %d, got %d.\n", 100, rc.bottom - rc.top);
+ ok(rc.right - rc.left == 100, "Expect width %d, got %ld.\n", 100, rc.right - rc.left);
+ ok(rc.bottom - rc.top == 100, "Expect height %d, got %ld.\n", 100, rc.bottom - rc.top);
DestroyWindow(hwnd);
UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL));
@@ -9318,7 +9319,7 @@ static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM
minmax = (MINMAXINFO *)lparam;
if (winetest_debug > 1)
{
- trace("hwnd %p, WM_GETMINMAXINFO, %08lx, %08lx\n", hwnd, wparam, lparam);
+ trace("hwnd %p, WM_GETMINMAXINFO, %08Ix, %08Ix\n", hwnd, wparam, lparam);
dump_minmax_info( minmax );
}
test_thick_child_got_minmax = TRUE;
@@ -9382,7 +9383,7 @@ static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM
case WM_NCCALCSIZE:
{
LRESULT ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, wparam, lparam);
- ok(!ret, "got %08lx (%08lx %08lx)\n", ret, wparam, lparam);
+ ok(!ret, "got %08Ix (%08Ix %08Ix)\n", ret, wparam, lparam);
return ret;
}
}
@@ -9473,7 +9474,7 @@ static void test_thick_child_size(HWND parentWindow)
cls.lpszClassName = className;
SetLastError(0xdeadbeef);
success = RegisterClassA(&cls);
- ok(success,"RegisterClassA failed, error: %u\n", GetLastError());
+ ok(success,"RegisterClassA failed, error: %lu\n", GetLastError());
for(i = 0; i < NUMBER_OF_THICK_CHILD_TESTS; i++)
{
@@ -9484,13 +9485,13 @@ static void test_thick_child_size(HWND parentWindow)
SetLastError(0xdeadbeef);
childWindow = CreateWindowExA( exStyles[i], className, "", styles[i], 0, 0, 0, 0, parentWindow, 0, GetModuleHandleA(0), NULL );
- ok(childWindow != NULL, "Failed to create child window, error: %u\n", GetLastError());
+ ok(childWindow != NULL, "Failed to create child window, error: %lu\n", GetLastError());
ok(test_thick_child_got_minmax, "Got no WM_GETMINMAXINFO\n");
SetLastError(0xdeadbeef);
success = GetWindowRect(childWindow, &childRect);
- ok(success,"GetWindowRect call failed, error: %u\n", GetLastError());
+ ok(success,"GetWindowRect call failed, error: %lu\n", GetLastError());
childWidth = childRect.right - childRect.left;
childHeight = childRect.bottom - childRect.top;
@@ -9513,12 +9514,12 @@ static void test_thick_child_size(HWND parentWindow)
}
ok((childWidth == expectedWidth) && (childHeight == expectedHeight),
- "size of window (%s) is wrong: expected size %dx%d != actual size %dx%d\n",
+ "size of window (%s) is wrong: expected size %ldx%ld != actual size %ldx%ld\n",
test_thick_child_name, expectedWidth, expectedHeight, childWidth, childHeight);
SetLastError(0xdeadbeef);
success = DestroyWindow(childWindow);
- ok(success,"DestroyWindow call failed, error: %u\n", GetLastError());
+ ok(success,"DestroyWindow call failed, error: %lu\n", GetLastError());
}
ok(UnregisterClassA(className, GetModuleHandleA(NULL)),"UnregisterClass call failed\n");
}
@@ -9531,7 +9532,7 @@ static void test_handles( HWND full_hwnd )
SetLastError( 0xdeadbeef );
ret = GetWindowRect( hwnd, &rect );
- ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+ ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
#ifdef _WIN64
if ((ULONG_PTR)full_hwnd >> 32)
@@ -9540,24 +9541,24 @@ static void test_handles( HWND full_hwnd )
hwnd = (HWND)((ULONG_PTR)full_hwnd | ((ULONG_PTR)~0u << 32));
SetLastError( 0xdeadbeef );
ret = GetWindowRect( hwnd, &rect );
- ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+ ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
hwnd = (HWND)(((ULONG_PTR)full_hwnd & ~0u) | ((ULONG_PTR)0x1234 << 32));
SetLastError( 0xdeadbeef );
ret = GetWindowRect( hwnd, &rect );
- ok( ret, "GetWindowRect failed for %p err %u\n", hwnd, GetLastError() );
+ ok( ret, "GetWindowRect failed for %p err %lu\n", hwnd, GetLastError() );
hwnd = (HWND)(((ULONG_PTR)full_hwnd & 0xffff) | ((ULONG_PTR)0x9876 << 16));
SetLastError( 0xdeadbeef );
ret = GetWindowRect( hwnd, &rect );
ok( !ret, "GetWindowRect succeeded for %p\n", hwnd );
- ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError() );
hwnd = (HWND)(((ULONG_PTR)full_hwnd & 0xffff) | ((ULONG_PTR)0x12345678 << 16));
SetLastError( 0xdeadbeef );
ret = GetWindowRect( hwnd, &rect );
ok( !ret, "GetWindowRect succeeded for %p\n", hwnd );
- ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError() );
#endif
}
@@ -9579,7 +9580,7 @@ static void test_winregion(void)
SetLastError(0xdeadbeef);
ret = pGetWindowRgnBox(hwnd, NULL);
ok( ret == ERROR, "Expected ERROR, got %d\n", ret);
- ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError());
+ ok( GetLastError() == 0xdeadbeef, "Expected , got %ld\n", GetLastError());
hrgn = CreateRectRgn(2, 3, 10, 15);
ok( hrgn != NULL, "Region creation failed\n");
@@ -9590,7 +9591,7 @@ static void test_winregion(void)
SetLastError(0xdeadbeef);
ret = pGetWindowRgnBox(hwnd, NULL);
ok( ret == ERROR, "Expected ERROR, got %d\n", ret);
- ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError());
+ ok( GetLastError() == 0xdeadbeef, "Expected , got %ld\n", GetLastError());
SetRectEmpty(&r);
ret = pGetWindowRgnBox(hwnd, &r);
@@ -9649,7 +9650,7 @@ static void test_rtl_layout(void)
ok( r.left == 30 && r.right == 10, "wrong rect %s\n", wine_dbgstr_rect( &r ));
pt.x = pt.y = 12;
MapWindowPoints( child, parent, &pt, 1 );
- ok( pt.x == 22 && pt.y == 22, "wrong point %d,%d\n", pt.x, pt.y );
+ ok( pt.x == 22 && pt.y == 22, "wrong point %ld,%ld\n", pt.x, pt.y );
SetWindowPos( parent, 0, 0, 0, 250, 250, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
GetWindowRect( parent, &r );
ok( r.left == 100 && r.right == 350, "wrong rect %s\n", wine_dbgstr_rect( &r ));
@@ -9686,13 +9687,13 @@ static void test_FlashWindow(void)
hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP,
0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = pFlashWindow( NULL, TRUE );
ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
- "FlashWindow returned with %d\n", GetLastError() );
+ "FlashWindow returned with %ld\n", GetLastError() );
DestroyWindow( hwnd );
@@ -9700,7 +9701,7 @@ static void test_FlashWindow(void)
ret = pFlashWindow( hwnd, TRUE );
ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
- "FlashWindow returned with %d\n", GetLastError() );
+ "FlashWindow returned with %ld\n", GetLastError() );
}
static void test_FlashWindowEx(void)
@@ -9717,7 +9718,7 @@ static void test_FlashWindowEx(void)
hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP,
0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
finfo.cbSize = sizeof(FLASHWINFO);
finfo.dwFlags = FLASHW_TIMER;
@@ -9728,13 +9729,13 @@ static void test_FlashWindowEx(void)
ret = pFlashWindowEx(&finfo);
ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
- "FlashWindowEx returned with %d\n", GetLastError());
+ "FlashWindowEx returned with %ld\n", GetLastError());
finfo.hwnd = hwnd;
SetLastError(0xdeadbeef);
ret = pFlashWindowEx(NULL);
ok(!ret && GetLastError() == ERROR_NOACCESS,
- "FlashWindowEx returned with %d\n", GetLastError());
+ "FlashWindowEx returned with %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pFlashWindowEx(&finfo);
@@ -9759,32 +9760,32 @@ static void test_FlashWindowEx(void)
ret = pFlashWindowEx(&finfo);
ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_WINDOW_HANDLE),
- "FlashWindowEx returned with %d\n", GetLastError());
+ "FlashWindowEx returned with %ld\n", GetLastError());
ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize);
ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd);
- ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags);
+ ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %lx\n", finfo.dwFlags);
ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount);
- ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout);
+ ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %lx\n", finfo.dwTimeout);
hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_VISIBLE | WS_POPUPWINDOW,
0, 0, 0, 0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
finfo.hwnd = hwnd;
SetLastError(0xdeadbeef);
ret = pFlashWindowEx(NULL);
ok(!ret && GetLastError() == ERROR_NOACCESS,
- "FlashWindowEx returned with %d\n", GetLastError());
+ "FlashWindowEx returned with %ld\n", GetLastError());
SetLastError(0xdeadbeef);
prev = pFlashWindowEx(&finfo);
ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize);
ok(finfo.hwnd == hwnd, "FlashWindowEx modified hwnd to %p\n", finfo.hwnd);
- ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %x\n", finfo.dwFlags);
+ ok(finfo.dwFlags == FLASHW_TIMER, "FlashWindowEx modified dwFlags to %lx\n", finfo.dwFlags);
ok(finfo.uCount == 3, "FlashWindowEx modified uCount to %x\n", finfo.uCount);
- ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %x\n", finfo.dwTimeout);
+ ok(finfo.dwTimeout == 200, "FlashWindowEx modified dwTimeout to %lx\n", finfo.dwTimeout);
finfo.dwFlags = FLASHW_STOP;
SetLastError(0xdeadbeef);
@@ -9799,47 +9800,47 @@ static void test_FindWindowEx(void)
HWND hwnd, found;
hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "ClassThatDoesntExist", "" );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "ClassThatDoesntExist", NULL );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "caption" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd );
hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", "" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowExA( 0, 0, "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd );
@@ -9855,47 +9856,47 @@ static void test_FindWindow(void)
HWND hwnd, found;
hwnd = CreateWindowExA( 0, "MainWindowClass", "caption", WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowA( "ClassThatDoesntExist", "" );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowA( "ClassThatDoesntExist", NULL );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowA( "MainWindowClass", "" );
ok( found == NULL, "expected a NULL hwnd\n" );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowA( "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowA( "MainWindowClass", "caption" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd );
hwnd = CreateWindowExA( 0, "MainWindowClass", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL );
- ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() );
+ ok( hwnd != 0, "CreateWindowExA error %ld\n", GetLastError() );
num_gettext_msgs = 0;
found = FindWindowA( "MainWindowClass", "" );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
num_gettext_msgs = 0;
found = FindWindowA( "MainWindowClass", NULL );
ok( found == hwnd, "found is %p, expected a valid hwnd\n", found );
- ok( num_gettext_msgs == 0, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
+ ok( num_gettext_msgs == 0, "got %lu WM_GETTEXT messages\n", num_gettext_msgs );
DestroyWindow( hwnd );
@@ -10238,7 +10239,7 @@ static void window_from_point_proc(HWND parent)
ok(got_click, "button under static window didn't get WM_LBUTTONUP\n");
ret = WaitForSingleObject(end_event, 5000);
- ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret);
CloseHandle(start_event);
CloseHandle(end_event);
@@ -10341,15 +10342,15 @@ static void test_map_points(void)
/* Verify window rect and client rect (they should have the same width and height) */
GetWindowRect(wnd, &window_rect);
- ok(window_rect.left == pos.x, "left is %d instead of %d\n", window_rect.left, pos.x);
- ok(window_rect.top == pos.y, "top is %d instead of %d\n", window_rect.top, pos.y);
- ok(window_rect.right == pos.x + width, "right is %d instead of %d\n", window_rect.right, pos.x + width);
- ok(window_rect.bottom == pos.y + height, "bottom is %d instead of %d\n", window_rect.bottom, pos.y + height);
+ ok(window_rect.left == pos.x, "left is %ld instead of %ld\n", window_rect.left, pos.x);
+ ok(window_rect.top == pos.y, "top is %ld instead of %ld\n", window_rect.top, pos.y);
+ ok(window_rect.right == pos.x + width, "right is %ld instead of %ld\n", window_rect.right, pos.x + width);
+ ok(window_rect.bottom == pos.y + height, "bottom is %ld instead of %ld\n", window_rect.bottom, pos.y + height);
GetClientRect(wnd, &client_rect);
- ok(client_rect.left == 0, "left is %d instead of 0\n", client_rect.left);
- ok(client_rect.top == 0, "top is %d instead of 0\n", client_rect.top);
- ok(client_rect.right == width, "right is %d instead of %d\n", client_rect.right, width);
- ok(client_rect.bottom == height, "bottom is %d instead of %d\n", client_rect.bottom, height);
+ ok(client_rect.left == 0, "left is %ld instead of 0\n", client_rect.left);
+ ok(client_rect.top == 0, "top is %ld instead of 0\n", client_rect.top);
+ ok(client_rect.right == width, "right is %ld instead of %d\n", client_rect.right, width);
+ ok(client_rect.bottom == height, "bottom is %ld instead of %d\n", client_rect.bottom, height);
/* Test MapWindowPoints */
@@ -10359,20 +10360,20 @@ static void test_map_points(void)
n = MapWindowPoints(NULL, NULL, NULL, 0);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
SetLastError(0xdeadbeef);
n = MapWindowPoints(wnd, wnd, NULL, 0);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
n = MapWindowPoints(wnd, NULL, NULL, 0);
- ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %x\n",
+ ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %lx\n",
n, MAKELONG(window_rect.left, window_rect.top));
n = MapWindowPoints(NULL, wnd, NULL, 0);
- ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %x\n",
+ ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %lx\n",
n, MAKELONG(-window_rect.left, -window_rect.top));
SetLastError(0xdeadbeef);
@@ -10380,69 +10381,69 @@ static void test_map_points(void)
n = MapWindowPoints(dwnd, NULL, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(dwnd, wnd, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(NULL, dwnd, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(wnd, dwnd, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(dwnd, dwnd, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(NULL, NULL, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(wnd, wnd, &p, 1);
err = GetLastError();
ok(n == 0, "Got %d, expected %d\n", n, 0);
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
p.x = p.y = 100;
n = MapWindowPoints(wnd, NULL, &p, 1);
- ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %x\n",
+ ok(n == MAKELONG(window_rect.left, window_rect.top), "Got %x, expected %lx\n",
n, MAKELONG(window_rect.left, window_rect.top));
- ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+ ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
p.x, p.y, window_rect.left + 100, window_rect.top + 100);
p.x = p.y = 100;
n = MapWindowPoints(NULL, wnd, &p, 1);
- ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %x\n",
+ ok(n == MAKELONG(-window_rect.left, -window_rect.top), "Got %x, expected %lx\n",
n, MAKELONG(-window_rect.left, -window_rect.top));
- ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+ ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
p.x, p.y, -window_rect.left + 100, -window_rect.top + 100);
SetLastError(0xdeadbeef);
@@ -10450,16 +10451,16 @@ static void test_map_points(void)
n = MapWindowPoints(wnd0, NULL, &p, 1);
err = GetLastError();
ok(n == 0, "Got %x, expected 0\n", n);
- ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
SetLastError(0xdeadbeef);
p.x = p.y = 0;
n = MapWindowPoints(NULL, wnd0, &p, 1);
err = GetLastError();
ok(n == 0, "Got %x, expected 0\n", n);
- ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
- ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
+ ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
+ ok(err == 0xdeadbeef, "Got %lx, expected %x\n", err, 0xdeadbeef);
/* Test ClientToScreen */
@@ -10469,34 +10470,34 @@ static void test_map_points(void)
ret = ClientToScreen(NULL, NULL);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
ret = ClientToScreen(NULL, &p);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
ret = ClientToScreen(dwnd, &p);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
p.x = p.y = 100;
ret = ClientToScreen(wnd, &p);
- ok(ret, "Failed with error %u\n", GetLastError());
- ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%d, %d), expected (%d, %d)\n",
+ ok(ret, "Failed with error %lu\n", GetLastError());
+ ok((p.x == (window_rect.left + 100)) && (p.y == (window_rect.top + 100)), "Failed got (%ld, %ld), expected (%ld, %ld)\n",
p.x, p.y, window_rect.left + 100, window_rect.top + 100);
p.x = p.y = 0;
ret = ClientToScreen(wnd0, &p);
- ok(ret, "Failed with error %u\n", GetLastError());
- ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
+ ok(ret, "Failed with error %lu\n", GetLastError());
+ ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
/* Test ScreenToClient */
@@ -10506,34 +10507,34 @@ static void test_map_points(void)
ret = ScreenToClient(NULL, NULL);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
ret = ScreenToClient(NULL, &p);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
SetLastError(0xdeadbeef);
p.x = p.y = 100;
ret = ScreenToClient(dwnd, &p);
err = GetLastError();
ok(!ret, "Should fail\n");
- ok(p.x == 100 && p.y == 100, "Failed got(%d, %d), expected (%d, %d)\n", p.x, p.y, 100, 100);
- ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %x, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
+ ok(p.x == 100 && p.y == 100, "Failed got(%ld, %ld), expected (%d, %d)\n", p.x, p.y, 100, 100);
+ ok(err == ERROR_INVALID_WINDOW_HANDLE, "Got %lx, expected %x\n", err, ERROR_INVALID_WINDOW_HANDLE);
p.x = p.y = 100;
ret = ScreenToClient(wnd, &p);
- ok(ret, "Failed with error %u\n", GetLastError());
- ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got(%d, %d), expected (%d, %d)\n",
+ ok(ret, "Failed with error %lu\n", GetLastError());
+ ok((p.x == (-window_rect.left + 100)) && (p.y == (-window_rect.top + 100)), "Failed got(%ld, %ld), expected (%ld, %ld)\n",
p.x, p.y, -window_rect.left + 100, -window_rect.top + 100);
p.x = p.y = 0;
ret = ScreenToClient(wnd0, &p);
- ok(ret, "Failed with error %u\n", GetLastError());
- ok((p.x == 0) && (p.y == 0), "Failed got (%d, %d), expected (0, 0)\n", p.x, p.y);
+ ok(ret, "Failed with error %lu\n", GetLastError());
+ ok((p.x == 0) && (p.y == 0), "Failed got (%ld, %ld), expected (0, 0)\n", p.x, p.y);
DestroyWindow(wnd);
DestroyWindow(wnd0);
@@ -10673,7 +10674,7 @@ static LRESULT WINAPI smresult_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
/* Send another message while we have a reply queued for the current one. */
res = SendMessageA(data->thread_hwnd, WM_APP+2, 0, lparam);
- ok(res == 0x449b0190, "unexpected result %lx\n", res);
+ ok(res == 0x449b0190, "unexpected result %Ix\n", res);
return 0;
}
@@ -10771,12 +10772,12 @@ static void test_smresult(void)
100, 100, 200, 200, 0, 0, 0, NULL);
hThread = CreateThread(NULL, 0, smresult_thread_proc, &data, 0, &tid);
- ok(hThread != NULL, "CreateThread failed, error %d\n", GetLastError());
+ ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
ok(WaitForSingleObject(data.thread_started, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
res = SendMessageA(data.thread_hwnd, WM_APP, 0, (LPARAM)&data);
- ok(res == 0x240408ea, "unexpected result %lx\n", res);
+ ok(res == 0x240408ea, "unexpected result %Ix\n", res);
SendMessageA(data.thread_hwnd, WM_CLOSE, 0, 0);
@@ -10804,42 +10805,42 @@ static void test_GetMessagePos(void)
SetCursorPos(120, 140);
flush_events(TRUE);
pos = GetMessagePos();
- ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
SetCursorPos(340, 320);
pos = GetMessagePos();
- ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
SendMessageW(button, WM_APP, 0, 0);
pos = GetMessagePos();
- ok(pos == MAKELONG(120, 140), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(120, 140), "pos = %08lx\n", pos);
PostMessageA(button, WM_APP, 0, 0);
GetMessageA(&msg, button, 0, 0);
ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
pos = GetMessagePos();
- ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
PostMessageA(button, WM_APP, 0, 0);
SetCursorPos(350, 330);
GetMessageA(&msg, button, 0, 0);
ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
pos = GetMessagePos();
- ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
PostMessageA(button, WM_APP, 0, 0);
SetCursorPos(320, 340);
PostMessageA(button, WM_APP+1, 0, 0);
pos = GetMessagePos();
- ok(pos == MAKELONG(340, 320), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(340, 320), "pos = %08lx\n", pos);
GetMessageA(&msg, button, 0, 0);
ok(msg.message == WM_APP, "msg.message = %x\n", msg.message);
pos = GetMessagePos();
- ok(pos == MAKELONG(350, 330), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(350, 330), "pos = %08lx\n", pos);
GetMessageA(&msg, button, 0, 0);
ok(msg.message == WM_APP+1, "msg.message = %x\n", msg.message);
pos = GetMessagePos();
- ok(pos == MAKELONG(320, 340), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(320, 340), "pos = %08lx\n", pos);
SetTimer(button, 1, 250, NULL);
SetCursorPos(330, 350);
@@ -10851,7 +10852,7 @@ static void test_GetMessagePos(void)
}
ok(msg.message == WM_TIMER, "msg.message = %x\n", msg.message);
pos = GetMessagePos();
- ok(pos == MAKELONG(330, 350), "pos = %08x\n", pos);
+ ok(pos == MAKELONG(330, 350), "pos = %08lx\n", pos);
KillTimer(button, 1);
DestroyWindow(button);
@@ -11090,7 +11091,7 @@ static LRESULT WINAPI winproc_convA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
{
const char *text = (const char*)lparam;
- ok(!wparam, "wparam = %08lx\n", wparam);
+ ok(!wparam, "wparam = %08Ix\n", wparam);
ok(!strcmp(text, "text"), "WM_SETTEXT lparam = %s\n", text);
return 1;
}
@@ -11104,7 +11105,7 @@ static LRESULT WINAPI winproc_convW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
{
const WCHAR *text = (const WCHAR*)lparam;
- ok(!wparam, "wparam = %08lx\n", wparam);
+ ok(!wparam, "wparam = %08Ix\n", wparam);
ok(!lstrcmpW(text, textW), "WM_SETTEXT lparam = %s\n", wine_dbgstr_w(text));
return 1;
}
@@ -11127,10 +11128,10 @@ static void test_winproc_handles(const char *argv0)
wnd_classA.lpszClassName = "winproc_test";
wnd_classA.lpfnWndProc = winproc;
ret = RegisterClassA(&wnd_classA);
- ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+ ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
ret = GetClassInfoW(hinst, winproc_testW, &wnd_classW);
- ok(ret, "GetClassInfoW failed with error %d\n", GetLastError());
+ ok(ret, "GetClassInfoW failed with error %ld\n", GetLastError());
ok(wnd_classA.lpfnWndProc != wnd_classW.lpfnWndProc,
"winproc pointers should not be identical\n");
@@ -11142,7 +11143,7 @@ static void test_winproc_handles(const char *argv0)
ok(count == 1, "winproc should be called once (%d)\n", count);
ret = UnregisterClassW(winproc_testW, hinst);
- ok(ret, "UnregisterClass failed with error %d\n", GetLastError());
+ ok(ret, "UnregisterClass failed with error %ld\n", GetLastError());
/* crashes on 64-bit windows because lpfnWndProc handle is already freed */
if (sizeof(void*) == 4)
@@ -11189,12 +11190,12 @@ static void test_winproc_limit(void)
ok(i != 0xffff, "unable to run out of winproc slots\n");
ret = SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convA);
- ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError());
+ ok(ret, "SetWindowLongPtr failed with error %ld\n", GetLastError());
ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n");
ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n");
ret = SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convW);
- ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError());
+ ok(ret, "SetWindowLongPtr failed with error %ld\n", GetLastError());
ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n");
ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n");
@@ -11236,21 +11237,21 @@ static void test_deferwindowpos(void)
hdwp2 = DeferWindowPos(NULL, NULL, NULL, 0, 0, 10, 10, 0);
todo_wine
ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) ||
- broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError());
+ broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %ld\n", hdwp2, GetLastError());
hdwp2 = DeferWindowPos((HDWP)0xdead, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0);
todo_wine
ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) ||
- broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError());
+ broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %ld\n", hdwp2, GetLastError());
hdwp2 = DeferWindowPos(hdwp, NULL, NULL, 0, 0, 10, 10, 0);
- ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+ ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
hdwp2 = DeferWindowPos(hdwp, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0);
- ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+ ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
hdwp2 = DeferWindowPos(hdwp, (HWND)0xdead, NULL, 0, 0, 10, 10, 0);
- ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError());
+ ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %ld\n", hdwp2, GetLastError());
ret = EndDeferWindowPos(hdwp);
ok(ret, "got %d\n", ret);
@@ -11259,7 +11260,7 @@ static void test_deferwindowpos(void)
hwnd = create_tool_window(WS_POPUP, 0);
hdwp2 = DeferWindowPos(hdwp, hwnd, NULL, 0, 0, 10, 10, 0);
- ok(hdwp2 != NULL, "got %p, error %d\n", hdwp2, GetLastError());
+ ok(hdwp2 != NULL, "got %p, error %ld\n", hdwp2, GetLastError());
DestroyWindow(hwnd);
ret = EndDeferWindowPos(hdwp);
@@ -11314,7 +11315,7 @@ static void test_LockWindowUpdate(HWND parent)
COLORREF c = GetPixel(hdc, p.x, p.y); \
COLORREF e = tests[i].expect_valid ? (c_valid) : (c_invalid); \
todo_wine_if(!tests[i].expect_valid) \
- ok(c == e, "%u: GetPixel: got %08x, expected %08x\n", i, c, e); \
+ ok(c == e, "%u: GetPixel: got %08lx, expected %08lx\n", i, c, e); \
} while (0)
SetPixel(hdc, p.x, p.y, c1);
@@ -11568,13 +11569,13 @@ static void test_desktop( void )
{
SetLastError( 0xdeadbeef );
result = GetWindowLongPtrW( desktop, tests[i].offset );
- ok( result == tests[i].expect, "offset %d, got %08lx expect %08lx\n",
+ ok( result == tests[i].expect, "offset %d, got %08Ix expect %08Ix\n",
tests[i].offset, result, tests[i].expect );
if (tests[i].error)
- ok( GetLastError() == tests[i].error, "offset %d: error %d expect %d\n",
+ ok( GetLastError() == tests[i].error, "offset %d: error %ld expect %ld\n",
tests[i].offset, GetLastError(), tests[i].error );
else
- ok( GetLastError() == 0xdeadbeef, "offset %d: error %d expect unchanged\n",
+ ok( GetLastError() == 0xdeadbeef, "offset %d: error %ld expect unchanged\n",
tests[i].offset, GetLastError() );
}
}
@@ -11616,7 +11617,7 @@ static void test_topmost(void)
owner = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, 0);
- ok(owner != 0, "Failed to create owner window (%d)\n", GetLastError());
+ ok(owner != 0, "Failed to create owner window (%ld)\n", GetLastError());
/* Give current thread foreground state otherwise the tests may fail. */
if (!SetForegroundWindow(owner))
@@ -11628,10 +11629,10 @@ static void test_topmost(void)
hwnd = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, owner);
- ok(hwnd != 0, "Failed to create popup window (%d)\n", GetLastError());
+ ok(hwnd != 0, "Failed to create popup window (%ld)\n", GetLastError());
hwnd2 = create_tool_window(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, owner);
- ok(hwnd2 != 0, "Failed to create popup window (%d)\n", GetLastError());
+ ok(hwnd2 != 0, "Failed to create popup window (%ld)\n", GetLastError());
flush_events( TRUE );
@@ -11738,11 +11739,11 @@ static void test_topmost(void)
reset_window_state(state, ARRAY_SIZE(state));
hwnd_child2 = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd);
- ok(hwnd_child2 != 0, "Failed to create popup window (%d)\n", GetLastError());
+ ok(hwnd_child2 != 0, "Failed to create popup window (%ld)\n", GetLastError());
hwnd_child = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd);
- ok(hwnd_child != 0, "Failed to create popup window (%d)\n", GetLastError());
+ ok(hwnd_child != 0, "Failed to create popup window (%ld)\n", GetLastError());
hwnd_grandchild = create_tool_window(WS_VISIBLE|WS_POPUP, hwnd_child);
- ok(hwnd_grandchild != 0, "Failed to create popup window (%d)\n", GetLastError());
+ ok(hwnd_grandchild != 0, "Failed to create popup window (%ld)\n", GetLastError());
flush_events( TRUE );
@@ -11983,70 +11984,70 @@ static void test_display_affinity( HWND win )
ret = pGetWindowDisplayAffinity(NULL, NULL);
ok(!ret, "GetWindowDisplayAffinity succeeded\n");
- ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
ret = pGetWindowDisplayAffinity(NULL, &affinity);
ok(!ret, "GetWindowDisplayAffinity succeeded\n");
- ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "Expected ERROR_INVALID_WINDOW_HANDLE, got %lu\n", GetLastError());
ret = pGetWindowDisplayAffinity(win, NULL);
ok(!ret, "GetWindowDisplayAffinity succeeded\n");
- ok(GetLastError() == ERROR_NOACCESS, "Expected ERROR_NOACCESS, got %u\n", GetLastError());
+ ok(GetLastError() == ERROR_NOACCESS, "Expected ERROR_NOACCESS, got %lu\n", GetLastError());
styleex = GetWindowLongW(win, GWL_EXSTYLE);
SetWindowLongW(win, GWL_EXSTYLE, styleex & ~WS_EX_LAYERED);
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
/* Windows 7 fails with ERROR_NOT_ENOUGH_MEMORY when dwm compositing is disabled */
ret = pSetWindowDisplayAffinity(win, WDA_MONITOR);
ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
- "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+ "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
dwm = ret;
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%x\n", affinity);
- else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%lx\n", affinity);
+ else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
ret = pSetWindowDisplayAffinity(win, WDA_NONE);
ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
- "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+ "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
SetWindowLongW(win, GWL_EXSTYLE, styleex | WS_EX_LAYERED);
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
ret = pSetWindowDisplayAffinity(win, WDA_MONITOR);
ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
- "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+ "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%x\n", affinity);
- else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ if (dwm) ok(affinity == WDA_MONITOR, "Expected WDA_MONITOR, got 0x%lx\n", affinity);
+ else ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
ret = pSetWindowDisplayAffinity(win, WDA_NONE);
ok(ret || GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
- "SetWindowDisplayAffinity failed with %u\n", GetLastError());
+ "SetWindowDisplayAffinity failed with %lu\n", GetLastError());
affinity = 0xdeadbeef;
ret = pGetWindowDisplayAffinity(win, &affinity);
- ok(ret, "GetWindowDisplayAffinity failed with %u\n", GetLastError());
- ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%x\n", affinity);
+ ok(ret, "GetWindowDisplayAffinity failed with %lu\n", GetLastError());
+ ok(affinity == WDA_NONE, "Expected WDA_NONE, got 0x%lx\n", affinity);
SetWindowLongW(win, GWL_EXSTYLE, styleex);
}
@@ -12114,7 +12115,7 @@ static DWORD CALLBACK destroy_thread1(void *user)
destroy_data.thread1_wnd = CreateWindowExA(0, "destroy_test_thread1",
"destroy test thread", WS_CHILD, 100, 100, 100, 100,
destroy_data.main_wnd, 0, GetModuleHandleA(NULL), NULL);
- ok(destroy_data.thread1_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+ ok(destroy_data.thread1_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
PostThreadMessageW(destroy_data.main_tid, WM_USER, 0, 0);
while (GetMessageA(&msg, 0, 0, 0))
@@ -12135,7 +12136,7 @@ static DWORD CALLBACK destroy_thread2(void *user)
destroy_data.thread2_wnd = CreateWindowExA(0, "destroy_test_thread2",
"destroy test thread", WS_CHILD, 100, 100, 100, 100,
destroy_data.main_wnd, 0, GetModuleHandleA(NULL), NULL);
- ok(destroy_data.thread2_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+ ok(destroy_data.thread2_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
PostThreadMessageW(destroy_data.main_tid, WM_USER + 1, 0, 0);
Sleep( 100 );
@@ -12165,22 +12166,22 @@ static void test_destroy_quit(void)
wnd_classA.lpszClassName = "destroy_test_main";
wnd_classA.lpfnWndProc = destroy_main_wndproc;
ret = RegisterClassA(&wnd_classA);
- ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+ ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
wnd_classA.lpszClassName = "destroy_test_thread1";
wnd_classA.lpfnWndProc = destroy_thread1_wndproc;
ret = RegisterClassA(&wnd_classA);
- ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+ ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
wnd_classA.lpszClassName = "destroy_test_thread2";
wnd_classA.lpfnWndProc = destroy_thread2_wndproc;
ret = RegisterClassA(&wnd_classA);
- ok(ret, "RegisterClass failed with error %d\n", GetLastError());
+ ok(ret, "RegisterClass failed with error %ld\n", GetLastError());
destroy_data.main_wnd = CreateWindowExA(0, "destroy_test_main",
"destroy test main", WS_OVERLAPPED | WS_CAPTION, 100, 100, 100, 100,
0, 0, GetModuleHandleA(NULL), NULL);
- ok(destroy_data.main_wnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
+ ok(destroy_data.main_wnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
if (!destroy_data.main_wnd)
{
CloseHandle(destroy_data.evt);
@@ -12248,141 +12249,141 @@ static void test_window_placement(void)
hwnd = CreateWindowA("MainWindowClass", "wp", WS_OVERLAPPEDWINDOW,
orig.left, orig.top, orig.right - orig.left, orig.bottom - orig.top, 0, 0, 0, 0);
- ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
+ ok(!!hwnd, "failed to create window, error %lu\n", GetLastError());
mon_info.cbSize = sizeof(mon_info);
GetMonitorInfoW(MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY), &mon_info);
work_rect = mon_info.rcWork;
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -1 && wp.ptMinPosition.y == -1,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_MINIMIZE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(!wp.flags, "got flags %#x\n", wp.flags);
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_RESTORE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_MAXIMIZE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
SetWindowPos(hwnd, 0, 100, 100, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == 100 && wp.ptMaxPosition.y == 100,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left,
work_rect.bottom - work_rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left - 1,
work_rect.bottom - work_rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == work_rect.left && wp.ptMaxPosition.y == work_rect.top,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
SetWindowPos(hwnd, 0, work_rect.left, work_rect.top, work_rect.right - work_rect.left,
work_rect.bottom - work_rect.top - 1, SWP_NOZORDER | SWP_NOACTIVATE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == work_rect.left && wp.ptMaxPosition.y == work_rect.top,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_MINIMIZE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.flags == WPF_RESTORETOMAXIMIZED, "got flags %#x\n", wp.flags);
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_RESTORE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ShowWindow(hwnd, SW_RESTORE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
@@ -12391,15 +12392,15 @@ static void test_window_placement(void)
wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
wp.rcNormalPosition = orig2;
ret = SetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to set window placement, error %u\n", GetLastError());
+ ok(ret, "failed to set window placement, error %lu\n", GetLastError());
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
GetWindowRect(hwnd, &rect);
@@ -12408,13 +12409,13 @@ static void test_window_placement(void)
ShowWindow(hwnd, SW_MINIMIZE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(!wp.flags, "got flags %#x\n", wp.flags);
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
@@ -12426,16 +12427,16 @@ static void test_window_placement(void)
wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
wp.rcNormalPosition = orig;
ret = SetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to set window placement, error %u\n", GetLastError());
+ ok(ret, "failed to set window placement, error %lu\n", GetLastError());
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(!wp.flags, "got flags %#x\n", wp.flags);
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
@@ -12447,15 +12448,15 @@ static void test_window_placement(void)
wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
wp.rcNormalPosition = orig;
ret = SetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to set window placement, error %u\n", GetLastError());
+ ok(ret, "failed to set window placement, error %lu\n", GetLastError());
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
@@ -12465,30 +12466,30 @@ static void test_window_placement(void)
wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
wp.rcNormalPosition = orig;
ret = SetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to set window placement, error %u\n", GetLastError());
+ ok(ret, "failed to set window placement, error %lu\n", GetLastError());
ShowWindow(hwnd, SW_MINIMIZE);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
ret = SetWindowPos(hwnd, NULL, 100, 100, 151, 151, SWP_NOACTIVATE | SWP_NOZORDER);
- ok(ret, "failed to set window pos, error %u\n", GetLastError());
+ ok(ret, "failed to set window pos, error %lu\n", GetLastError());
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
GetWindowRect(hwnd, &rect);
@@ -12497,12 +12498,12 @@ static void test_window_placement(void)
ShowWindow(hwnd, SW_SHOWNORMAL);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "failed to get window placement, error %u\n", GetLastError());
+ ok(ret, "failed to get window placement, error %lu\n", GetLastError());
ok(wp.showCmd == SW_NORMAL, "got show cmd %u\n", wp.showCmd);
ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
- "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
+ "got minimized pos (%ld,%ld)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
- "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
+ "got maximized pos (%ld,%ld)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
wine_dbgstr_rect(&wp.rcNormalPosition));
GetWindowRect(hwnd, &rect);
@@ -12522,7 +12523,7 @@ static void test_arrange_iconic_windows(void)
parent = CreateWindowA("MainWindowClass", "parent", WS_OVERLAPPEDWINDOW,
100, 200, 500, 300, NULL, 0, 0, NULL);
- ok(!!parent, "failed to create window, error %u\n", GetLastError());
+ ok(!!parent, "failed to create window, error %lu\n", GetLastError());
GetClientRect(parent, &parent_rect);
ClientToScreen(parent, &pt);
@@ -12533,25 +12534,25 @@ static void test_arrange_iconic_windows(void)
mm.iVertGap = 3;
mm.iArrange = ARW_TOPLEFT | ARW_RIGHT;
ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
- ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
+ ok(ret, "failed to set minimized metrics, error %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret = ArrangeIconicWindows(parent);
ok(!ret, "wrong ret %u\n", ret);
- ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
{
hwnds[i] = CreateWindowA("MainWindowClass", "child", WS_CHILD |
WS_OVERLAPPEDWINDOW, orig.left, orig.top, orig.right - orig.left,
orig.bottom - orig.top, parent, 0, 0, NULL);
- ok(!!hwnds[i], "failed to create window %u, error %u\n", i, GetLastError());
+ ok(!!hwnds[i], "failed to create window %u, error %lu\n", i, GetLastError());
}
SetLastError(0xdeadbeef);
ret = ArrangeIconicWindows(parent);
ok(!ret, "wrong ret %u\n", ret);
- ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
+ ok(GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
{
@@ -12568,7 +12569,7 @@ static void test_arrange_iconic_windows(void)
{
ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
- ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+ ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
}
ret = ArrangeIconicWindows(parent);
@@ -12595,7 +12596,7 @@ static void test_arrange_iconic_windows(void)
ShowWindow(hwnds[i], SW_MINIMIZE);
ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
- ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+ ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
}
ret = ArrangeIconicWindows(parent);
@@ -12624,13 +12625,13 @@ static void test_arrange_iconic_windows(void)
mm.iArrange = ARW_BOTTOMRIGHT | ARW_UP;
mm.iVertGap = 10;
ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
- ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
+ ok(ret, "failed to set minimized metrics, error %lu\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
{
ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
- ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
+ ok(ret, "hwnd %u: failed to move window, error %lu\n", i, GetLastError());
}
ret = ArrangeIconicWindows(parent);
@@ -12661,7 +12662,7 @@ static void test_arrange_iconic_windows(void)
DestroyWindow(parent);
ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0);
- ok(ret, "failed to restore minimized metrics, error %u\n", GetLastError());
+ ok(ret, "failed to restore minimized metrics, error %lu\n", GetLastError());
}
static void other_process_proc(HWND hwnd)
@@ -12677,36 +12678,36 @@ static void other_process_proc(HWND hwnd)
/* SW_SHOW */
ret = WaitForSingleObject(window_ready_event, 5000);
- ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+ ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "Unexpected ret %#x.\n", ret);
+ ok(ret, "Unexpected ret %#lx.\n", ret);
ok(wp.showCmd == SW_SHOWNORMAL, "Unexpected showCmd %#x.\n", wp.showCmd);
ok(!wp.flags, "Unexpected flags %#x.\n", wp.flags);
SetEvent(test_done_event);
/* SW_SHOWMAXIMIZED */
ret = WaitForSingleObject(window_ready_event, 5000);
- ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+ ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "Unexpected ret %#x.\n", ret);
+ ok(ret, "Unexpected ret %#lx.\n", ret);
ok(wp.showCmd == SW_SHOWMAXIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
SetEvent(test_done_event);
/* SW_SHOWMINIMIZED */
ret = WaitForSingleObject(window_ready_event, 5000);
- ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+ ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "Unexpected ret %#x.\n", ret);
+ ok(ret, "Unexpected ret %#lx.\n", ret);
ok(wp.showCmd == SW_SHOWMINIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
SetEvent(test_done_event);
/* SW_RESTORE */
ret = WaitForSingleObject(window_ready_event, 5000);
- ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
+ ok(ret == WAIT_OBJECT_0, "Unexpected ret %lx.\n", ret);
ret = GetWindowPlacement(hwnd, &wp);
- ok(ret, "Unexpected ret %#x.\n", ret);
+ ok(ret, "Unexpected ret %#lx.\n", ret);
ok(wp.showCmd == SW_SHOWMAXIMIZED, "Unexpected showCmd %#x.\n", wp.showCmd);
todo_wine ok(wp.flags == WPF_RESTORETOMAXIMIZED, "Unexpected flags %#x.\n", wp.flags);
SetEvent(test_done_event);
@@ -12726,10 +12727,10 @@ static void test_SC_SIZE(void)
ok(!!hwnd, "CreateWindowEx failed.\n");
GetWindowRect(hwnd, &rect);
- ok(rect.left == 100, "rect.left = %d\n", rect.left);
- ok(rect.top == 100, "rect.top = %d\n", rect.top);
- ok(rect.right == 200, "rect.right = %d\n", rect.right);
- ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
+ ok(rect.left == 100, "rect.left = %ld\n", rect.left);
+ ok(rect.top == 100, "rect.top = %ld\n", rect.top);
+ ok(rect.right == 200, "rect.right = %ld\n", rect.right);
+ ok(rect.bottom == 200, "rect.bottom = %ld\n", rect.bottom);
SetCursorPos(100, 100);
PostMessageA(hwnd, WM_SYSCOMMAND, SC_SIZE | 9, MAKELONG(100, 100));
@@ -12746,10 +12747,10 @@ static void test_SC_SIZE(void)
}
GetWindowRect(hwnd, &rect);
- ok(rect.left == 110, "rect.left = %d\n", rect.left);
- ok(rect.top == 100, "rect.top = %d\n", rect.top);
- ok(rect.right == 210, "rect.right = %d\n", rect.right);
- ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
+ ok(rect.left == 110, "rect.left = %ld\n", rect.left);
+ ok(rect.top == 100, "rect.top = %ld\n", rect.top);
+ ok(rect.right == 210, "rect.right = %ld\n", rect.right);
+ ok(rect.bottom == 200, "rect.bottom = %ld\n", rect.bottom);
DestroyWindow(hwnd);
}
@@ -12825,11 +12826,11 @@ static void test_cancel_mode(void)
ok(GetCapture() == hwnd1, "got capture %p\n", GetCapture());
ret = SendMessageA(hwnd2, WM_CANCELMODE, 0, 0);
- ok(!ret, "got %ld\n", ret);
+ ok(!ret, "got %Id\n", ret);
ok(GetCapture() == hwnd1, "got capture %p\n", GetCapture());
ret = SendMessageA(hwnd1, WM_CANCELMODE, 0, 0);
- ok(!ret, "got %ld\n", ret);
+ ok(!ret, "got %Id\n", ret);
ok(!GetCapture(), "got capture %p\n", GetCapture());
child = CreateWindowA("MainWindowClass", "child", WS_CHILD,
@@ -12839,15 +12840,15 @@ static void test_cancel_mode(void)
ok(GetCapture() == child, "got capture %p\n", GetCapture());
ret = SendMessageA(hwnd2, WM_CANCELMODE, 0, 0);
- ok(!ret, "got %ld\n", ret);
+ ok(!ret, "got %Id\n", ret);
ok(GetCapture() == child, "got capture %p\n", GetCapture());
ret = SendMessageA(hwnd1, WM_CANCELMODE, 0, 0);
- ok(!ret, "got %ld\n", ret);
+ ok(!ret, "got %Id\n", ret);
ok(GetCapture() == child, "got capture %p\n", GetCapture());
ret = SendMessageA(child, WM_CANCELMODE, 0, 0);
- ok(!ret, "got %ld\n", ret);
+ ok(!ret, "got %Id\n", ret);
ok(!GetCapture(), "got capture %p\n", GetCapture());
DestroyWindow(child);
@@ -12885,23 +12886,23 @@ static LRESULT WINAPI ncdestroy_test_proc( HWND hwnd, UINT msg, WPARAM wp, LPARA
todo_wine
ok( !ret, "SetWindowPos succeeded\n" );
todo_wine
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "SetWindowPos returned error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
parent = SetParent( hwnd, hwndMain );
ok( parent == 0, "SetParent returned %p\n", parent );
- ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() );
ret = GetWindowRect( hwnd, &rect );
- ok( ret, "GetWindowRect failed: %u\n", GetLastError() );
+ ok( ret, "GetWindowRect failed: %lu\n", GetLastError() );
SetRect( &exp, 10, 20, 110, 220 );
ok( EqualRect( &rect, &exp ), "unexpected rect %s, expected %s\n", wine_dbgstr_rect( &rect ),
wine_dbgstr_rect( &exp ));
ret = MoveWindow( hwnd, 11, 12, 20, 30, FALSE );
- ok( ret, "MoveWindow failed: %u\n", GetLastError() );
+ ok( ret, "MoveWindow failed: %lu\n", GetLastError() );
ret = GetWindowRect( hwnd, &rect );
- ok( ret, "GetWindowRect failed: %u\n", GetLastError() );
+ ok( ret, "GetWindowRect failed: %lu\n", GetLastError() );
SetRect( &exp, 11, 12, 31, 42 );
ok( EqualRect( &rect, &exp ), "unexpected rect %s, expected %s\n", wine_dbgstr_rect( &rect ),
wine_dbgstr_rect( &exp ));
@@ -12909,7 +12910,7 @@ static LRESULT WINAPI ncdestroy_test_proc( HWND hwnd, UINT msg, WPARAM wp, LPARA
child = CreateWindowExA( 0, "ToolWindowClass", "Tool window 1", WS_CHILD,
0, 0, 100, 100, hwnd, 0, 0, NULL );
ok( !child && GetLastError() == ERROR_INVALID_PARAMETER,
- "CreateWindowExA returned %p %u\n", child, GetLastError() );
+ "CreateWindowExA returned %p %lu\n", child, GetLastError() );
break;
}
@@ -12945,12 +12946,12 @@ static void test_WM_NCCALCSIZE(void)
cls.lpszMenuName = NULL;
cls.lpszClassName = "dummy_window_class";
ret = RegisterClassA(&cls);
- ok(ret, "RegisterClass error %u\n", GetLastError());
+ ok(ret, "RegisterClass error %lu\n", GetLastError());
hwnd = CreateWindowExA(0, "dummy_window_class", NULL,
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP,
100, 100, 200, 200, 0, 0, GetModuleHandleA(NULL), NULL);
- ok(hwnd != 0, "CreateWindowEx error %u\n", GetLastError());
+ ok(hwnd != 0, "CreateWindowEx error %lu\n", GetLastError());
GetWindowRect(hwnd, &window_rect);
params.rgrc[0] = window_rect;
@@ -12969,22 +12970,22 @@ static void test_WM_NCCALCSIZE(void)
params.lppos = &winpos;
ret = SendMessageW(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0]));
params.rgrc[0] = window_rect;
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0]));
GetWindowRect(hwnd, &window_rect);
ret = SendMessageW(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
GetWindowRect(hwnd, &window_rect);
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect);
- ok(!ret, "got %08lx\n", ret);
+ ok(!ret, "got %08Ix\n", ret);
ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
DestroyWindow(hwnd);
2
1
[PATCH] dlls/user32/tests/wsprintf.c: enable compilation with long types
by Eric Pouech March 17, 2022
by Eric Pouech March 17, 2022
March 17, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/user32/tests/wsprintf.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/wsprintf.c b/dlls/user32/tests/wsprintf.c
index 567ed2ff10b..7dfe46ed3bc 100644
--- a/dlls/user32/tests/wsprintf.c
+++ b/dlls/user32/tests/wsprintf.c
@@ -16,6 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
@@ -79,7 +80,7 @@ static void wsprintfATest(void)
int rc;
rc=wsprintfA(buf, "%010ld", -1);
- ok(rc == 10, "wsprintfA length failure: rc=%d error=%d\n",rc,GetLastError());
+ ok(rc == 10, "wsprintfA length failure: rc=%d error=%ld\n",rc,GetLastError());
ok((lstrcmpA(buf, "-000000001") == 0),
"wsprintfA zero padded negative value failure: buf=[%s]\n",buf);
rc = wsprintfA(buf, "%I64X", (ULONGLONG)0);
@@ -157,7 +158,7 @@ static void wsprintfWTest(void)
win_skip("wsprintfW is not implemented\n");
return;
}
- ok(rc == 10, "wsPrintfW length failure: rc=%d error=%d\n",rc,GetLastError());
+ ok(rc == 10, "wsPrintfW length failure: rc=%d error=%ld\n",rc,GetLastError());
ok((lstrcmpW(buf, L"-000000001") == 0),
"wsprintfW zero padded negative value failure\n");
rc = wsprintfW(buf, L"%I64x", (ULONGLONG)0 );
@@ -246,7 +247,7 @@ static void CharUpperTest(void)
break;
}
}
- ok(!failed,"CharUpper failed - 16bit input (0x%0lx) returned 32bit result (0x%0lx)\n",i,out);
+ ok(!failed,"CharUpper failed - 16bit input (0x%0Ix) returned 32bit result (0x%0Ix)\n",i,out);
}
static void CharLowerTest(void)
@@ -263,7 +264,7 @@ static void CharLowerTest(void)
break;
}
}
- ok(!failed,"CharLower failed - 16bit input (0x%0lx) returned 32bit result (0x%0lx)\n",i,out);
+ ok(!failed,"CharLower failed - 16bit input (0x%0Ix) returned 32bit result (0x%0Ix)\n",i,out);
}
1
0