2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
5 * FILE: subsys/win32k/ntuser/scrollbar.c
6 * PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
7 * Jason Filby (jasonfilby@yahoo.com)
9 * 16-11-2002 Jason Filby Created
11 /* INCLUDES ******************************************************************/
18 #define MINTRACKTHUMB 8 /* Minimum size of the rectangle between the arrows */
20 #define SBRG_SCROLLBAR 0 /* the scrollbar itself */
21 #define SBRG_TOPRIGHTBTN 1 /* the top or right button */
22 #define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
23 #define SBRG_SCROLLBOX 3 /* the scroll box */
24 #define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
25 #define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
27 #define CHANGERGSTATE(item, status) \
28 if(Info->rgstate[(item)] != (status)) \
30 Info->rgstate[(item)] = (status);
32 /* FUNCTIONS *****************************************************************/
34 /* Ported from WINE20020904 */
35 /* Compute the scroll bar rectangle, in drawing coordinates (i.e. client coords for SB_CTL, window coords for SB_VERT and
36 * SB_HORZ). 'arrowSize' returns the width or height of an arrow (depending on * the orientation of the scrollbar),
37 * 'thumbSize' returns the size of the thumb, and 'thumbPos' returns the position of the thumb relative to the left or to
38 * the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
41 IntGetScrollBarRect (PWINDOW_OBJECT Window
, INT nBar
, RECTL
*lprect
)
44 PWND Wnd
= Window
->Wnd
;
45 RECTL ClientRect
= Window
->Wnd
->rcClient
;
46 RECTL WindowRect
= Window
->Wnd
->rcWindow
;
51 lprect
->left
= ClientRect
.left
- WindowRect
.left
;
52 lprect
->top
= ClientRect
.bottom
- WindowRect
.top
;
53 lprect
->right
= ClientRect
.right
- WindowRect
.left
;
54 lprect
->bottom
= lprect
->top
+ UserGetSystemMetrics (SM_CYHSCROLL
);
59 if(Wnd
->ExStyle
& WS_EX_LEFTSCROLLBAR
)
61 lprect
->right
= ClientRect
.left
- WindowRect
.left
;
62 lprect
->left
= lprect
->right
- UserGetSystemMetrics(SM_CXVSCROLL
);
66 lprect
->left
= ClientRect
.right
- WindowRect
.left
;
67 lprect
->right
= lprect
->left
+ UserGetSystemMetrics(SM_CXVSCROLL
);
69 lprect
->top
= ClientRect
.top
- WindowRect
.top
;
70 lprect
->bottom
= ClientRect
.bottom
- WindowRect
.top
;
75 IntGetClientRect (Window
, lprect
);
76 vertical
= ((Wnd
->style
& SBS_VERT
) != 0);
87 IntCalculateThumb(PWINDOW_OBJECT Window
, LONG idObject
, PSCROLLBARINFO psbi
, LPSCROLLINFO psi
)
89 PWND Wnd
= Window
->Wnd
;
90 INT Thumb
, ThumbBox
, ThumbPos
, cxy
, mx
;
96 Thumb
= UserGetSystemMetrics(SM_CXHSCROLL
);
97 cxy
= psbi
->rcScrollBar
.right
- psbi
->rcScrollBar
.left
;
100 Thumb
= UserGetSystemMetrics(SM_CYVSCROLL
);
101 cxy
= psbi
->rcScrollBar
.bottom
- psbi
->rcScrollBar
.top
;
104 IntGetClientRect(Window
, &ClientRect
);
105 if(Wnd
->style
& SBS_VERT
)
107 Thumb
= UserGetSystemMetrics(SM_CYVSCROLL
);
108 cxy
= ClientRect
.bottom
- ClientRect
.top
;
112 Thumb
= UserGetSystemMetrics(SM_CXHSCROLL
);
113 cxy
= ClientRect
.right
- ClientRect
.left
;
121 /* calculate Thumb */
122 if(cxy
<= (2 * Thumb
))
125 psbi
->xyThumbTop
= 0;
126 psbi
->xyThumbBottom
= 0;
131 ThumbBox
= psi
->nPage
? MINTRACKTHUMB
: UserGetSystemMetrics(SM_CXHTHUMB
);
137 ThumbBox
= max(EngMulDiv(cxy
, psi
->nPage
, psi
->nMax
- psi
->nMin
+ 1), ThumbBox
);
142 mx
= psi
->nMax
- max(psi
->nPage
- 1, 0);
144 ThumbPos
= Thumb
+ EngMulDiv(cxy
- ThumbBox
, psi
->nPos
- psi
->nMin
, mx
- psi
->nMin
);
146 ThumbPos
= Thumb
+ ThumbBox
;
149 psbi
->xyThumbTop
= ThumbPos
;
150 psbi
->xyThumbBottom
= ThumbPos
+ ThumbBox
;
154 psbi
->xyThumbTop
= 0;
155 psbi
->xyThumbBottom
= 0;
158 psbi
->dxyLineButton
= Thumb
;
164 IntUpdateSBInfo(PWINDOW_OBJECT Window
, int wBar
)
170 ASSERT(Window
->pSBInfo
);
172 sbi
= IntGetScrollbarInfoFromWindow(Window
, wBar
);
173 psi
= IntGetScrollInfoFromWindow(Window
, wBar
);
174 IntGetScrollBarRect(Window
, wBar
, &(sbi
->rcScrollBar
));
175 IntCalculateThumb(Window
, wBar
, sbi
, psi
);
179 co_IntGetScrollInfo(PWINDOW_OBJECT Window
, INT nBar
, LPSCROLLINFO lpsi
)
184 ASSERT_REFS_CO(Window
);
186 if(!SBID_IS_VALID(nBar
))
188 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
189 DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar
);
193 if(!co_IntCreateScrollBars(Window
))
198 psi
= IntGetScrollInfoFromWindow(Window
, nBar
);
200 if (lpsi
->fMask
== SIF_ALL
)
202 Mask
= SIF_PAGE
| SIF_POS
| SIF_RANGE
| SIF_TRACKPOS
;
209 if (0 != (Mask
& SIF_PAGE
))
211 lpsi
->nPage
= psi
->nPage
;
214 if (0 != (Mask
& SIF_POS
))
216 lpsi
->nPos
= psi
->nPos
;
219 if (0 != (Mask
& SIF_RANGE
))
221 lpsi
->nMin
= psi
->nMin
;
222 lpsi
->nMax
= psi
->nMax
;
225 if (0 != (Mask
& SIF_TRACKPOS
))
227 lpsi
->nTrackPos
= psi
->nTrackPos
;
234 NEWco_IntGetScrollInfo(
241 PSBTRACK pSBTrack
= pWnd
->head
.pti
->pSBTrack
;
243 if (!SBID_IS_VALID(nBar
))
245 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
246 DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar
);
252 if (0 != (Mask
& SIF_PAGE
))
254 lpsi
->nPage
= pSBData
->page
;
257 if (0 != (Mask
& SIF_POS
))
259 lpsi
->nPos
= pSBData
->pos
;
262 if (0 != (Mask
& SIF_RANGE
))
264 lpsi
->nMin
= pSBData
->posMin
;
265 lpsi
->nMax
= pSBData
->posMax
;
268 if (0 != (Mask
& SIF_TRACKPOS
))
271 pSBTrack
->nBar
== nBar
&&
272 pSBTrack
->spwndTrack
== pWnd
)
273 lpsi
->nTrackPos
= pSBTrack
->posNew
;
275 lpsi
->nTrackPos
= pSBData
->pos
;
277 return (Mask
& SIF_ALL
) !=0;
280 static DWORD FASTCALL
281 co_IntSetScrollInfo(PWINDOW_OBJECT Window
, INT nBar
, LPCSCROLLINFO lpsi
, BOOL bRedraw
)
284 * Update the scrollbar state and set action flags according to
285 * what has to be done graphics wise.
291 BOOL bChangeParams
= FALSE
; /* don't show/hide scrollbar if params don't change */
293 ASSERT_REFS_CO(Window
);
295 if(!SBID_IS_VALID(nBar
))
297 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
298 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", nBar
);
302 if(!co_IntCreateScrollBars(Window
))
307 if (lpsi
->cbSize
!= sizeof(SCROLLINFO
) &&
308 lpsi
->cbSize
!= (sizeof(SCROLLINFO
) - sizeof(lpsi
->nTrackPos
)))
310 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
313 if (lpsi
->fMask
& ~(SIF_ALL
| SIF_DISABLENOSCROLL
))
315 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
319 psbi
= IntGetScrollbarInfoFromWindow(Window
, nBar
);
320 Info
= IntGetScrollInfoFromWindow(Window
, nBar
);
322 /* Set the page size */
323 if (0 != (lpsi
->fMask
& SIF_PAGE
))
325 if (Info
->nPage
!= lpsi
->nPage
)
327 Info
->nPage
= lpsi
->nPage
;
328 bChangeParams
= TRUE
;
332 /* Set the scroll pos */
333 if (0 != (lpsi
->fMask
& SIF_POS
))
335 if (Info
->nPos
!= lpsi
->nPos
)
337 Info
->nPos
= lpsi
->nPos
;
341 /* Set the scroll range */
342 if (0 != (lpsi
->fMask
& SIF_RANGE
))
344 /* Invalid range -> range is set to (0,0) */
345 if (lpsi
->nMin
> lpsi
->nMax
||
346 0x80000000 <= (UINT
)(lpsi
->nMax
- lpsi
->nMin
))
350 bChangeParams
= TRUE
;
352 else if (Info
->nMin
!= lpsi
->nMin
|| Info
->nMax
!= lpsi
->nMax
)
354 Info
->nMin
= lpsi
->nMin
;
355 Info
->nMax
= lpsi
->nMax
;
356 bChangeParams
= TRUE
;
360 /* Make sure the page size is valid */
361 if (Info
->nMax
- Info
->nMin
+ 1 < Info
->nPage
)
363 Info
->nPage
= Info
->nMax
- Info
->nMin
+ 1;
366 /* Make sure the pos is inside the range */
367 if (Info
->nPos
< Info
->nMin
)
369 Info
->nPos
= Info
->nMin
;
371 else if (Info
->nPos
> Info
->nMax
- max(Info
->nPage
- 1, 0))
373 Info
->nPos
= Info
->nMax
- max(Info
->nPage
- 1, 0);
377 * Don't change the scrollbar state if SetScrollInfo is just called
378 * with SIF_DISABLENOSCROLL
380 if (0 == (lpsi
->fMask
& SIF_ALL
))
385 /* Check if the scrollbar should be hidden or disabled */
386 if (0 != (lpsi
->fMask
& (SIF_RANGE
| SIF_PAGE
| SIF_DISABLENOSCROLL
)))
388 if (Info
->nMin
>= (int)(Info
->nMax
- max(Info
->nPage
- 1, 0)))
390 /* Hide or disable scroll-bar */
391 if (0 != (lpsi
->fMask
& SIF_DISABLENOSCROLL
))
393 /* new_flags = ESB_DISABLE_BOTH;*/
395 else if ((nBar
!= SB_CTL
) && bChangeParams
)
397 co_UserShowScrollBar(Window
, nBar
, FALSE
);
401 else /* Show and enable scroll-bar */
404 if ((nBar
!= SB_CTL
) && bChangeParams
)
406 co_UserShowScrollBar(Window
, nBar
, TRUE
);
411 if (infoPtr
->flags
!= new_flags
) /* check arrow flags */
413 infoPtr
->flags
= new_flags
;
414 *Action
|= SA_SSI_REPAINT_ARROWS
;
422 RECTL UpdateRect
= psbi
->rcScrollBar
;
423 UpdateRect
.left
-= Window
->Wnd
->rcClient
.left
- Window
->Wnd
->rcWindow
.left
;
424 UpdateRect
.right
-= Window
->Wnd
->rcClient
.left
- Window
->Wnd
->rcWindow
.left
;
425 UpdateRect
.top
-= Window
->Wnd
->rcClient
.top
- Window
->Wnd
->rcWindow
.top
;
426 UpdateRect
.bottom
-= Window
->Wnd
->rcClient
.top
- Window
->Wnd
->rcWindow
.top
;
427 co_UserRedrawWindow(Window
, &UpdateRect
, 0, RDW_INVALIDATE
| RDW_FRAME
);
430 /* Return current position */
435 co_IntGetScrollBarInfo(PWINDOW_OBJECT Window
, LONG idObject
, PSCROLLBARINFO psbi
)
441 ASSERT_REFS_CO(Window
);
443 Bar
= SBOBJ_TO_SBID(idObject
);
445 if(!SBID_IS_VALID(Bar
))
447 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
448 DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar
);
452 if(!co_IntCreateScrollBars(Window
))
457 sbi
= IntGetScrollbarInfoFromWindow(Window
, Bar
);
458 psi
= IntGetScrollInfoFromWindow(Window
, Bar
);
460 IntGetScrollBarRect(Window
, Bar
, &(sbi
->rcScrollBar
));
461 IntCalculateThumb(Window
, Bar
, sbi
, psi
);
463 RtlCopyMemory(psbi
, sbi
, sizeof(SCROLLBARINFO
));
469 co_IntCreateScrollBars(PWINDOW_OBJECT Window
)
477 ASSERT_REFS_CO(Window
);
481 /* no need to create it anymore */
485 /* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
486 Size
= 3 * (sizeof(SBINFOEX
));
487 if(!(Window
->pSBInfo
= ExAllocatePoolWithTag(PagedPool
, Size
, TAG_SBARINFO
)))
489 DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window
->hSelf
);
493 RtlZeroMemory(Window
->pSBInfo
, Size
);
495 Result
= co_WinPosGetNonClientSize(Window
,
496 &Window
->Wnd
->rcWindow
,
497 &Window
->Wnd
->rcClient
);
499 for(s
= SB_HORZ
; s
<= SB_VERT
; s
++)
501 psbi
= IntGetScrollbarInfoFromWindow(Window
, s
);
502 psbi
->cbSize
= sizeof(SCROLLBARINFO
);
503 for (i
= 0; i
< CCHILDREN_SCROLLBAR
+ 1; i
++)
504 psbi
->rgstate
[i
] = 0;
506 psi
= IntGetScrollInfoFromWindow(Window
, s
);
507 psi
->cbSize
= sizeof(LPSCROLLINFO
);
510 IntGetScrollBarRect(Window
, s
, &(psbi
->rcScrollBar
));
511 IntCalculateThumb(Window
, s
, psbi
, psi
);
518 IntDestroyScrollBars(PWINDOW_OBJECT Window
)
522 ExFreePool(Window
->pSBInfo
);
523 Window
->pSBInfo
= NULL
;
530 IntEnableScrollBar(BOOL Horz
, PSCROLLBARINFO Info
, UINT wArrows
)
535 case ESB_DISABLE_BOTH
:
536 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
537 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
539 case ESB_DISABLE_RTDN
:
542 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
546 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
549 case ESB_DISABLE_LTUP
:
552 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
556 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
559 case ESB_ENABLE_BOTH
:
560 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, 0);
561 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, 0);
570 NtUserGetScrollBarInfo(HWND hWnd
, LONG idObject
, PSCROLLBARINFO psbi
)
574 PWINDOW_OBJECT Window
;
576 DECLARE_RETURN(BOOL
);
577 USER_REFERENCE_ENTRY Ref
;
579 DPRINT("Enter NtUserGetScrollBarInfo\n");
580 UserEnterExclusive();
582 Status
= MmCopyFromCaller(&sbi
, psbi
, sizeof(SCROLLBARINFO
));
583 if(!NT_SUCCESS(Status
) || (sbi
.cbSize
!= sizeof(SCROLLBARINFO
)))
585 SetLastNtError(Status
);
589 if(!(Window
= UserGetWindowObject(hWnd
)))
594 UserRefObjectCo(Window
, &Ref
);
595 Ret
= co_IntGetScrollBarInfo(Window
, idObject
, &sbi
);
596 UserDerefObjectCo(Window
);
598 Status
= MmCopyToCaller(psbi
, &sbi
, sizeof(SCROLLBARINFO
));
599 if(!NT_SUCCESS(Status
))
601 SetLastNtError(Status
);
608 DPRINT("Leave NtUserGetScrollBarInfo, ret=%i\n",_ret_
);
624 PWINDOW_OBJECT Window
;
628 DECLARE_RETURN(BOOL
);
629 USER_REFERENCE_ENTRY Ref
;
631 DPRINT("Enter NtUserGetScrollInfo\n");
632 UserEnterExclusive();
634 Status
= MmCopyFromCaller(&psi
.cbSize
, &(lpsi
->cbSize
), sizeof(UINT
));
635 if(!NT_SUCCESS(Status
) ||
636 !((psi
.cbSize
== sizeof(SCROLLINFO
)) || (psi
.cbSize
== sizeof(SCROLLINFO
) - sizeof(psi
.nTrackPos
))))
638 SetLastNtError(Status
);
642 Status
= MmCopyFromCaller(&psi
, lpsi
, sz
);
643 if (!NT_SUCCESS(Status
))
645 SetLastNtError(Status
);
649 if(!(Window
= UserGetWindowObject(hWnd
)))
654 UserRefObjectCo(Window
, &Ref
);
655 Ret
= co_IntGetScrollInfo(Window
, fnBar
, &psi
);
656 UserDerefObjectCo(Window
);
658 Status
= MmCopyToCaller(lpsi
, &psi
, sz
);
659 if(!NT_SUCCESS(Status
))
661 SetLastNtError(Status
);
668 DPRINT("Leave NtUserGetScrollInfo, ret=%i\n",_ret_
);
676 NtUserEnableScrollBar(
681 PWINDOW_OBJECT Window
= NULL
;
682 PSCROLLBARINFO InfoV
= NULL
, InfoH
= NULL
;
684 DECLARE_RETURN(BOOL
);
685 USER_REFERENCE_ENTRY Ref
;
687 DPRINT("Enter NtUserEnableScrollBar\n");
688 UserEnterExclusive();
690 if(!(Window
= UserGetWindowObject(hWnd
)))
694 UserRefObjectCo(Window
, &Ref
);
696 if(wSBflags
== SB_CTL
)
698 /* FIXME Enable or Disable SB Ctrl*/
699 DPRINT1("Enable Scrollbar SB_CTL\n");
700 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_CTL
);
701 Chg
= IntEnableScrollBar(FALSE
, InfoV
,wArrows
);
702 /* Chg? Scrollbar is Refresh in user32/controls/scrollbar.c. */
707 if(wSBflags
!= SB_BOTH
&& !SBID_IS_VALID(wSBflags
))
709 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
710 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", wSBflags
);
714 if(!co_IntCreateScrollBars(Window
))
722 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_VERT
);
725 InfoH
= IntGetScrollbarInfoFromWindow(Window
, SB_HORZ
);
728 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_VERT
);
735 Chg
= IntEnableScrollBar(FALSE
, InfoV
, wArrows
);
738 Chg
= (IntEnableScrollBar(TRUE
, InfoH
, wArrows
) || Chg
);
740 //if(Chg && (Window->style & WS_VISIBLE))
741 /* FIXME - repaint scrollbars */
747 UserDerefObjectCo(Window
);
749 DPRINT("Leave NtUserEnableScrollBar, ret=%i\n",_ret_
);
756 NtUserSetScrollBarInfo(
759 SETSCROLLBARINFO
*info
)
761 PWINDOW_OBJECT Window
= NULL
;
762 SETSCROLLBARINFO Safeinfo
;
767 DECLARE_RETURN(BOOL
);
768 USER_REFERENCE_ENTRY Ref
;
770 DPRINT("Enter NtUserSetScrollBarInfo\n");
771 UserEnterExclusive();
773 if(!(Window
= UserGetWindowObject(hWnd
)))
777 UserRefObjectCo(Window
, &Ref
);
779 Obj
= SBOBJ_TO_SBID(idObject
);
780 if(!SBID_IS_VALID(Obj
))
782 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
783 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d\n", Obj
);
787 if(!co_IntCreateScrollBars(Window
))
792 Status
= MmCopyFromCaller(&Safeinfo
, info
, sizeof(SETSCROLLBARINFO
));
793 if(!NT_SUCCESS(Status
))
795 SetLastNtError(Status
);
799 sbi
= IntGetScrollbarInfoFromWindow(Window
, Obj
);
800 psi
= IntGetScrollInfoFromWindow(Window
, Obj
);
802 psi
->nTrackPos
= Safeinfo
.nTrackPos
;
803 sbi
->reserved
= Safeinfo
.reserved
;
804 RtlCopyMemory(&sbi
->rgstate
, &Safeinfo
.rgstate
, sizeof(Safeinfo
.rgstate
));
810 UserDerefObjectCo(Window
);
812 DPRINT("Leave NtUserSetScrollBarInfo, ret=%i\n",_ret_
);
825 PWINDOW_OBJECT Window
= NULL
;
827 SCROLLINFO ScrollInfo
;
828 DECLARE_RETURN(DWORD
);
829 USER_REFERENCE_ENTRY Ref
;
831 DPRINT("Enter NtUserSetScrollInfo\n");
832 UserEnterExclusive();
834 if(!(Window
= UserGetWindowObject(hWnd
)))
838 UserRefObjectCo(Window
, &Ref
);
840 Status
= MmCopyFromCaller(&ScrollInfo
, lpsi
, sizeof(SCROLLINFO
) - sizeof(ScrollInfo
.nTrackPos
));
841 if(!NT_SUCCESS(Status
))
843 SetLastNtError(Status
);
847 RETURN(co_IntSetScrollInfo(Window
, fnBar
, &ScrollInfo
, bRedraw
));
851 UserDerefObjectCo(Window
);
853 DPRINT("Leave NtUserSetScrollInfo, ret=%i\n",_ret_
);
859 /* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
861 co_UserShowScrollBar(PWINDOW_OBJECT Window
, int wBar
, DWORD bShow
)
863 DWORD Style
, OldStyle
;
866 ASSERT_REFS_CO(Window
);
879 Style
= WS_HSCROLL
| WS_VSCROLL
;
885 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
889 if(!co_IntCreateScrollBars(Window
))
896 IntUpdateSBInfo(Window
, SB_CTL
);
898 co_WinPosShowWindow(Window
, bShow
? SW_SHOW
: SW_HIDE
);
902 OldStyle
= Wnd
->style
;
906 Wnd
->style
&= ~Style
;
908 if(Wnd
->style
!= OldStyle
)
910 if(Wnd
->style
& WS_HSCROLL
)
911 IntUpdateSBInfo(Window
, SB_HORZ
);
912 if(Wnd
->style
& WS_VSCROLL
)
913 IntUpdateSBInfo(Window
, SB_VERT
);
915 if(Wnd
->style
& WS_VISIBLE
)
917 /* Frame has been changed, let the window redraw itself */
918 co_WinPosSetWindowPos(Window
, 0, 0, 0, 0, 0, SWP_NOSIZE
| SWP_NOMOVE
|
919 SWP_NOACTIVATE
| SWP_NOZORDER
| SWP_FRAMECHANGED
| SWP_NOSENDCHANGING
);
928 NtUserShowScrollBar(HWND hWnd
, int wBar
, DWORD bShow
)
930 PWINDOW_OBJECT Window
;
931 DECLARE_RETURN(DWORD
);
933 USER_REFERENCE_ENTRY Ref
;
935 DPRINT("Enter NtUserShowScrollBar\n");
936 UserEnterExclusive();
938 if (!(Window
= UserGetWindowObject(hWnd
)))
943 UserRefObjectCo(Window
, &Ref
);
944 ret
= co_UserShowScrollBar(Window
, wBar
, bShow
);
945 UserDerefObjectCo(Window
);
950 DPRINT("Leave NtUserShowScrollBar, ret%i\n",_ret_
);