From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/defwnd.c | 4 ++-- dlls/win32u/message.c | 2 +- dlls/win32u/scroll.c | 2 +- dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 27 +++++++++++---------------- 5 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index ce1afa398d9..4246b5d7653 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2542,11 +2542,11 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, return 0;
case WM_SETREDRAW: - if (wparam) set_window_style( hwnd, WS_VISIBLE, 0 ); + if (wparam) set_window_style_bits( hwnd, WS_VISIBLE, 0 ); else { NtUserRedrawWindow( hwnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE ); - set_window_style( hwnd, 0, WS_VISIBLE ); + set_window_style_bits( hwnd, 0, WS_VISIBLE ); } return 0;
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 1d527253fbd..2a824dbdab3 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2142,7 +2142,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR return set_window_long( hwnd, (short)LOWORD(wparam), HIWORD(wparam), lparam, FALSE ); case WM_WINE_SETSTYLE: if (is_desktop_window( hwnd )) return 0; - return set_window_style( hwnd, wparam, lparam ); + return set_window_style_bits( hwnd, wparam, lparam ); case WM_WINE_SETACTIVEWINDOW: { HWND prev; diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 7ada572b658..8db26fc8aa6 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -162,7 +162,7 @@ static BOOL show_scroll_bar( HWND hwnd, int bar, BOOL show_horz, BOOL show_vert return FALSE; /* Nothing to do! */ }
- old_style = set_window_style( hwnd, set_bits, clear_bits ); + old_style = set_window_style_bits( hwnd, set_bits, clear_bits ); if ((old_style & clear_bits) != 0 || (old_style & set_bits) != set_bits) { /* frame has been changed, let the window redraw itself */ diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index a7bee5bd93a..69e43ad5a5b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -274,7 +274,7 @@ extern BOOL screen_to_client( HWND hwnd, POINT *pt ); extern LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL ansi ); extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ); -extern ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ); +extern UINT set_window_style_bits( HWND hwnd, UINT set_bits, UINT clear_bits ); extern void update_window_state( HWND hwnd ); extern HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ); extern HWND get_shell_window(void); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 3b3a3ba5eac..1f59ac4c303 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -796,7 +796,7 @@ BOOL WINAPI NtUserEnableWindow( HWND hwnd, BOOL enable )
if (enable) { - ret = (set_window_style( hwnd, 0, WS_DISABLED ) & WS_DISABLED) != 0; + ret = (set_window_style_bits( hwnd, 0, WS_DISABLED ) & WS_DISABLED) != 0; if (ret) { NtUserNotifyWinEvent( EVENT_OBJECT_STATECHANGE, hwnd, OBJID_WINDOW, 0 ); @@ -808,7 +808,7 @@ BOOL WINAPI NtUserEnableWindow( HWND hwnd, BOOL enable ) { send_message( hwnd, WM_CANCELMODE, 0, 0 );
- ret = (set_window_style( hwnd, WS_DISABLED, 0 ) & WS_DISABLED) != 0; + ret = (set_window_style_bits( hwnd, WS_DISABLED, 0 ) & WS_DISABLED) != 0; if (!ret) { NtUserNotifyWinEvent( EVENT_OBJECT_STATECHANGE, hwnd, OBJID_WINDOW, 0 ); @@ -1116,12 +1116,7 @@ static WORD get_window_word( HWND hwnd, INT offset ) return get_window_long_size( hwnd, offset, sizeof(WORD), TRUE ); }
-/*********************************************************************** - * set_window_style - * - * Change the style of a window. - */ -ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) +UINT set_window_style_bits( HWND hwnd, UINT set_bits, UINT clear_bits ) { BOOL ok, made_visible = FALSE; STYLESTRUCT style; @@ -4426,7 +4421,7 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect ) NtUserSetFocus( 0 ); }
- old_style = set_window_style( hwnd, WS_MINIMIZE, WS_MAXIMIZE ); + old_style = set_window_style_bits( hwnd, WS_MINIMIZE, WS_MAXIMIZE );
wpl.ptMinPosition = get_minimized_pos( hwnd, wpl.ptMinPosition );
@@ -4443,7 +4438,7 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect )
minmax = get_min_max_info( hwnd );
- old_style = set_window_style( hwnd, WS_MAXIMIZE, WS_MINIMIZE ); + old_style = set_window_style_bits( hwnd, WS_MAXIMIZE, WS_MINIMIZE ); if (old_style & WS_MINIMIZE) win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
@@ -4459,14 +4454,14 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect ) case SW_SHOWNORMAL: case SW_RESTORE: case SW_SHOWDEFAULT: /* FIXME: should have its own handler */ - old_style = set_window_style( hwnd, 0, WS_MINIMIZE | WS_MAXIMIZE ); + old_style = set_window_style_bits( hwnd, 0, WS_MINIMIZE | WS_MAXIMIZE ); if (old_style & WS_MINIMIZE) { if (win_get_flags( hwnd ) & WIN_RESTORE_MAX) { /* Restore to maximized position */ minmax = get_min_max_info( hwnd ); - set_window_style( hwnd, WS_MAXIMIZE, 0 ); + set_window_style_bits( hwnd, WS_MAXIMIZE, 0 ); swp_flags |= SWP_STATECHANGED; SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y, minmax.ptMaxPosition.x + minmax.ptMaxSize.x, @@ -4663,8 +4658,8 @@ static BOOL show_window( HWND hwnd, INT cmd ) if (parent && !is_window_visible( parent ) && !(swp & SWP_STATECHANGED)) { /* if parent is not visible simply toggle WS_VISIBLE and return */ - if (show_flag) set_window_style( hwnd, WS_VISIBLE, 0 ); - else set_window_style( hwnd, 0, WS_VISIBLE ); + if (show_flag) set_window_style_bits( hwnd, WS_VISIBLE, 0 ); + else set_window_style_bits( hwnd, 0, WS_VISIBLE ); } else NtUserSetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top, @@ -5676,7 +5671,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
/* Show the window, maximizing or minimizing if needed */
- style = set_window_style( hwnd, 0, WS_MAXIMIZE | WS_MINIMIZE ); + style = set_window_style_bits( hwnd, 0, WS_MAXIMIZE | WS_MINIMIZE ); if (style & (WS_MINIMIZE | WS_MAXIMIZE)) { RECT new_pos; @@ -5959,7 +5954,7 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserSetWindowStyle: { STYLESTRUCT *style = (void *)param; - return set_window_style( hwnd, style->styleNew, style->styleOld ); + return set_window_style_bits( hwnd, style->styleNew, style->styleOld ); }
default: