Commit 894d728b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use a separate helper to send messages from win32u.

parent 439cdf49
......@@ -232,8 +232,8 @@ BOOL WINAPI NtUserEmptyClipboard(void)
TRACE( "owner %p\n", owner );
if (owner) send_message_timeout( owner, WM_DESTROYCLIPBOARD, 0, 0, SMTO_ABORTIFHUNG,
5000, NULL, FALSE );
if (owner)
send_message_timeout( owner, WM_DESTROYCLIPBOARD, 0, 0, SMTO_ABORTIFHUNG, 5000, FALSE );
pthread_mutex_lock( &clipboard_mutex );
......
......@@ -1636,7 +1636,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
/* send palette messages */
if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
SMTO_ABORTIFHUNG, 2000, NULL, FALSE );
SMTO_ABORTIFHUNG, 2000, FALSE );
if (!is_window(hwnd)) return FALSE;
}
......
......@@ -2609,11 +2609,11 @@ static BOOL broadcast_message( struct send_message_info *info, DWORD_PTR *res_pt
{
case MSG_UNICODE:
send_message_timeout( list[i], info->msg, info->wparam, info->lparam,
info->flags, info->timeout, NULL, FALSE );
info->flags, info->timeout, FALSE );
break;
case MSG_ASCII:
send_message_timeout( list[i], info->msg, info->wparam, info->lparam,
info->flags, info->timeout, NULL, TRUE );
info->flags, info->timeout, TRUE );
break;
case MSG_NOTIFY:
NtUserMessageCall( list[i], info->msg, info->wparam, info->lparam,
......@@ -2810,7 +2810,7 @@ static LRESULT send_window_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
}
/* see SendMessageTimeoutW */
LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
static LRESULT send_client_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, DWORD_PTR *res_ptr, BOOL ansi )
{
struct send_message_info info;
......@@ -2828,10 +2828,18 @@ LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
return process_message( &info, res_ptr, ansi );
}
LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, BOOL ansi )
{
DWORD_PTR res = 0;
send_client_message( hwnd, msg, wparam, lparam, flags, timeout, &res, ansi );
return res;
}
/* see SendMessageW */
LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
return send_window_message( hwnd, msg, wparam, lparam, NULL, FALSE );
return send_message_timeout( hwnd, msg, wparam, lparam, SMTO_NORMAL, 0, FALSE );
}
/* see SendNotifyMessageW */
......@@ -2971,7 +2979,7 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
{
struct send_message_timeout_params *params = (void *)result_info;
DWORD_PTR res = 0;
params->result = send_message_timeout( hwnd, msg, wparam, lparam, params->flags,
params->result = send_client_message( hwnd, msg, wparam, lparam, params->flags,
params->timeout, &res, ansi );
return res;
}
......
......@@ -584,7 +584,7 @@ UINT realize_palette( HDC hdc )
/* send palette change notification */
HWND hwnd = NtUserWindowFromDC( hdc );
if (hwnd) send_message_timeout( HWND_BROADCAST, WM_PALETTECHANGED, HandleToUlong(hwnd), 0,
SMTO_ABORTIFHUNG, 2000, NULL, FALSE );
SMTO_ABORTIFHUNG, 2000, FALSE );
}
return realized;
}
......
......@@ -4397,7 +4397,7 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w
static const WCHAR emptyW[1];
if (winini & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
send_message_timeout( HWND_BROADCAST, WM_SETTINGCHANGE, action, (LPARAM) emptyW,
SMTO_ABORTIFHUNG, 2000, NULL, FALSE );
SMTO_ABORTIFHUNG, 2000, FALSE );
}
TRACE( "(%u, %u, %p, %u) ret %d\n", action, val, ptr, winini, ret );
return ret;
......@@ -4840,7 +4840,7 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va
/* Send WM_SYSCOLORCHANGE message to all windows */
send_message_timeout( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 2000, NULL, FALSE );
SMTO_ABORTIFHUNG, 2000, FALSE );
/* Repaint affected portions of all visible windows */
NtUserRedrawWindow( 0, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN );
return TRUE;
......
......@@ -308,7 +308,7 @@ extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UI
PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, PDWORD_PTR res_ptr, BOOL ansi );
UINT flags, UINT timeout, BOOL ansi );
/* rawinput.c */
extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment