return FALSE;
}
-LONG FASTCALL
-co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
+static LONG
+co_IntSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi, BOOL bAlter)
{
PWND Window, Parent;
PWINSTATION_OBJECT WindowStation;
Style.styleNew &= ~WS_EX_WINDOWEDGE;
Window->ExStyle = (DWORD)Style.styleNew;
+
co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_EXSTYLE, (LPARAM) &Style);
break;
OldValue = (LONG) Window->style;
Style.styleOld = OldValue;
Style.styleNew = NewValue;
- co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style);
+
+ if (!bAlter)
+ co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style);
/* WS_CLIPSIBLINGS can't be reset on top-level windows */
if (Window->spwndParent == UserGetDesktopWindow()) Style.styleNew |= WS_CLIPSIBLINGS;
DceResetActiveDCEs( Window );
}
Window->style = (DWORD)Style.styleNew;
- co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style);
+
+ if (!bAlter)
+ co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style);
break;
case GWL_WNDPROC:
return( OldValue);
}
+
+LONG FASTCALL
+co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
+{
+ return co_IntSetWindowLong(hWnd, Index, NewValue, Ansi, FALSE);
+}
+
/*
* NtUserSetWindowLong
*
LONG APIENTRY
NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
{
- DECLARE_RETURN(LONG);
+ LONG ret;
- TRACE("Enter NtUserSetWindowLong\n");
UserEnterExclusive();
if (hWnd == IntGetDesktopWindow())
{
EngSetLastError(STATUS_ACCESS_DENIED);
- RETURN( 0);
+ UserLeave();
+ return 0;
}
- RETURN( co_UserSetWindowLong(hWnd, Index, NewValue, Ansi));
+ ret = co_IntSetWindowLong(hWnd, Index, NewValue, Ansi, FALSE);
-CLEANUP:
- TRACE("Leave NtUserSetWindowLong, ret=%i\n",_ret_);
UserLeave();
- END_CLEANUP;
+
+ return ret;
}
+DWORD APIENTRY
+NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
+{
+ LONG ret;
+
+ UserEnterExclusive();
+
+ if (hWnd == IntGetDesktopWindow())
+ {
+ EngSetLastError(STATUS_ACCESS_DENIED);
+ UserLeave();
+ return 0;
+ }
+
+ ret = co_IntSetWindowLong(hWnd, Index, NewValue, FALSE, TRUE);
+
+ UserLeave();
+
+ return ret;
+}
+
+
/*
* NtUserSetWindowWord
*
/* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
if (btn_type == BS_USERBUTTON )
{
-#ifdef __REACTOS__
style = (style & ~BS_TYPEMASK) | BS_PUSHBUTTON;
- SetWindowLongPtrW( hWnd, GWL_STYLE, style );
+#ifdef __REACTOS__
+ NtUserAlterWindowStyle(hWnd, GWL_STYLE, style );
#else
- style = (style & ~BS_TYPEMASK) | BS_PUSHBUTTON;
WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
#endif
}
if ((wParam & BS_TYPEMASK) >= MAX_BTN_TYPE) break;
btn_type = wParam & BS_TYPEMASK;
style = (style & ~BS_TYPEMASK) | btn_type;
- SetWindowLongPtrW( hWnd, GWL_STYLE, style );
- //WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
+#ifdef __REACTOS__
+ NtUserAlterWindowStyle(hWnd, GWL_STYLE, style );
+#else
+ WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
+#endif
/* Only redraw if lParam flag is set.*/
if (lParam)
#ifdef __REACTOS__
if (wParam) style |= WS_TABSTOP;
else style &= ~WS_TABSTOP;
- SetWindowLongPtrW( hWnd, GWL_STYLE, style );
+ NtUserAlterWindowStyle(hWnd, GWL_STYLE, style );
#else
if (wParam) WIN_SetStyle( hWnd, WS_TABSTOP, 0 );
else WIN_SetStyle( hWnd, 0, WS_TABSTOP );