2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
24 * FILE: subsys/win32k/ntuser/scrollbar.c
25 * PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
26 * Jason Filby (jasonfilby@yahoo.com)
28 * 16-11-2002 Jason Filby Created
30 /* INCLUDES ******************************************************************/
37 #define MINTRACKTHUMB 8 /* Minimum size of the rectangle between the arrows */
39 #define SBRG_SCROLLBAR 0 /* the scrollbar itself */
40 #define SBRG_TOPRIGHTBTN 1 /* the top or right button */
41 #define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
42 #define SBRG_SCROLLBOX 3 /* the scroll box */
43 #define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
44 #define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
46 #define CHANGERGSTATE(item, status) \
47 if(Info->rgstate[(item)] != (status)) \
49 Info->rgstate[(item)] = (status);
51 /* FUNCTIONS *****************************************************************/
53 /* Ported from WINE20020904 */
54 /* Compute the scroll bar rectangle, in drawing coordinates (i.e. client coords for SB_CTL, window coords for SB_VERT and
55 * SB_HORZ). 'arrowSize' returns the width or height of an arrow (depending on * the orientation of the scrollbar),
56 * 'thumbSize' returns the size of the thumb, and 'thumbPos' returns the position of the thumb relative to the left or to
57 * the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
60 IntGetScrollBarRect (PWINDOW_OBJECT Window
, INT nBar
, PRECT lprect
)
63 PWINDOW Wnd
= Window
->Wnd
;
64 RECT ClientRect
= Window
->Wnd
->ClientRect
;
65 RECT WindowRect
= Window
->Wnd
->WindowRect
;
70 lprect
->left
= ClientRect
.left
- WindowRect
.left
;
71 lprect
->top
= ClientRect
.bottom
- WindowRect
.top
;
72 lprect
->right
= ClientRect
.right
- WindowRect
.left
;
73 lprect
->bottom
= lprect
->top
+ UserGetSystemMetrics (SM_CYHSCROLL
);
78 if(Wnd
->ExStyle
& WS_EX_LEFTSCROLLBAR
)
80 lprect
->right
= ClientRect
.left
- WindowRect
.left
;
81 lprect
->left
= lprect
->right
- UserGetSystemMetrics(SM_CXVSCROLL
);
85 lprect
->left
= ClientRect
.right
- WindowRect
.left
;
86 lprect
->right
= lprect
->left
+ UserGetSystemMetrics(SM_CXVSCROLL
);
88 lprect
->top
= ClientRect
.top
- WindowRect
.top
;
89 lprect
->bottom
= ClientRect
.bottom
- WindowRect
.top
;
94 IntGetClientRect (Window
, lprect
);
95 vertical
= ((Wnd
->Style
& SBS_VERT
) != 0);
106 IntCalculateThumb(PWINDOW_OBJECT Window
, LONG idObject
, PSCROLLBARINFO psbi
, LPSCROLLINFO psi
)
108 PWINDOW Wnd
= Window
->Wnd
;
109 INT Thumb
, ThumbBox
, ThumbPos
, cxy
, mx
;
115 Thumb
= UserGetSystemMetrics(SM_CXHSCROLL
);
116 cxy
= psbi
->rcScrollBar
.right
- psbi
->rcScrollBar
.left
;
119 Thumb
= UserGetSystemMetrics(SM_CYVSCROLL
);
120 cxy
= psbi
->rcScrollBar
.bottom
- psbi
->rcScrollBar
.top
;
123 IntGetClientRect (Window
, &ClientRect
);
124 if(Wnd
->Style
& SBS_VERT
)
126 Thumb
= UserGetSystemMetrics(SM_CYVSCROLL
);
127 cxy
= ClientRect
.bottom
- ClientRect
.top
;
131 Thumb
= UserGetSystemMetrics(SM_CXHSCROLL
);
132 cxy
= ClientRect
.right
- ClientRect
.left
;
140 /* calculate Thumb */
141 if(cxy
<= (2 * Thumb
))
144 psbi
->xyThumbTop
= 0;
145 psbi
->xyThumbBottom
= 0;
150 ThumbBox
= psi
->nPage
? MINTRACKTHUMB
: UserGetSystemMetrics(SM_CXHTHUMB
);
156 ThumbBox
= max(EngMulDiv(cxy
, psi
->nPage
, psi
->nMax
- psi
->nMin
+ 1), ThumbBox
);
161 mx
= psi
->nMax
- max(psi
->nPage
- 1, 0);
163 ThumbPos
= Thumb
+ EngMulDiv(cxy
- ThumbBox
, psi
->nPos
- psi
->nMin
, mx
- psi
->nMin
);
165 ThumbPos
= Thumb
+ ThumbBox
;
168 psbi
->xyThumbTop
= ThumbPos
;
169 psbi
->xyThumbBottom
= ThumbPos
+ ThumbBox
;
173 psbi
->xyThumbTop
= 0;
174 psbi
->xyThumbBottom
= 0;
177 psbi
->dxyLineButton
= Thumb
;
183 IntUpdateSBInfo(PWINDOW_OBJECT Window
, int wBar
)
189 ASSERT(Window
->Scroll
);
191 sbi
= IntGetScrollbarInfoFromWindow(Window
, wBar
);
192 psi
= IntGetScrollInfoFromWindow(Window
, wBar
);
193 IntGetScrollBarRect(Window
, wBar
, &(sbi
->rcScrollBar
));
194 IntCalculateThumb(Window
, wBar
, sbi
, psi
);
198 co_IntGetScrollInfo(PWINDOW_OBJECT Window
, INT nBar
, LPSCROLLINFO lpsi
)
203 ASSERT_REFS_CO(Window
);
205 if(!SBID_IS_VALID(nBar
))
207 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
208 DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar
);
212 if(!co_IntCreateScrollBars(Window
))
217 psi
= IntGetScrollInfoFromWindow(Window
, nBar
);
219 if (lpsi
->fMask
== SIF_ALL
)
221 Mask
= SIF_PAGE
| SIF_POS
| SIF_RANGE
| SIF_TRACKPOS
;
228 if (0 != (Mask
& SIF_PAGE
))
230 lpsi
->nPage
= psi
->nPage
;
233 if (0 != (Mask
& SIF_POS
))
235 lpsi
->nPos
= psi
->nPos
;
238 if (0 != (Mask
& SIF_RANGE
))
240 lpsi
->nMin
= psi
->nMin
;
241 lpsi
->nMax
= psi
->nMax
;
244 if (0 != (Mask
& SIF_TRACKPOS
))
246 lpsi
->nTrackPos
= psi
->nTrackPos
;
252 static DWORD FASTCALL
253 co_IntSetScrollInfo(PWINDOW_OBJECT Window
, INT nBar
, LPCSCROLLINFO lpsi
, BOOL bRedraw
)
256 * Update the scrollbar state and set action flags according to
257 * what has to be done graphics wise.
263 BOOL bChangeParams
= FALSE
; /* don't show/hide scrollbar if params don't change */
265 ASSERT_REFS_CO(Window
);
267 if(!SBID_IS_VALID(nBar
))
269 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
270 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", nBar
);
274 if(!co_IntCreateScrollBars(Window
))
279 if (lpsi
->cbSize
!= sizeof(SCROLLINFO
) &&
280 lpsi
->cbSize
!= (sizeof(SCROLLINFO
) - sizeof(lpsi
->nTrackPos
)))
282 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
285 if (lpsi
->fMask
& ~(SIF_ALL
| SIF_DISABLENOSCROLL
))
287 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
291 psbi
= IntGetScrollbarInfoFromWindow(Window
, nBar
);
292 Info
= IntGetScrollInfoFromWindow(Window
, nBar
);
294 /* Set the page size */
295 if (0 != (lpsi
->fMask
& SIF_PAGE
))
297 if (Info
->nPage
!= lpsi
->nPage
)
299 Info
->nPage
= lpsi
->nPage
;
300 bChangeParams
= TRUE
;
304 /* Set the scroll pos */
305 if (0 != (lpsi
->fMask
& SIF_POS
))
307 if (Info
->nPos
!= lpsi
->nPos
)
309 Info
->nPos
= lpsi
->nPos
;
313 /* Set the scroll range */
314 if (0 != (lpsi
->fMask
& SIF_RANGE
))
316 /* Invalid range -> range is set to (0,0) */
317 if (lpsi
->nMin
> lpsi
->nMax
||
318 0x80000000 <= (UINT
)(lpsi
->nMax
- lpsi
->nMin
))
322 bChangeParams
= TRUE
;
324 else if (Info
->nMin
!= lpsi
->nMin
|| Info
->nMax
!= lpsi
->nMax
)
326 Info
->nMin
= lpsi
->nMin
;
327 Info
->nMax
= lpsi
->nMax
;
328 bChangeParams
= TRUE
;
332 /* Make sure the page size is valid */
333 if (Info
->nMax
- Info
->nMin
+ 1 < Info
->nPage
)
335 Info
->nPage
= Info
->nMax
- Info
->nMin
+ 1;
338 /* Make sure the pos is inside the range */
339 if (Info
->nPos
< Info
->nMin
)
341 Info
->nPos
= Info
->nMin
;
343 else if (Info
->nPos
> Info
->nMax
- max(Info
->nPage
- 1, 0))
345 Info
->nPos
= Info
->nMax
- max(Info
->nPage
- 1, 0);
349 * Don't change the scrollbar state if SetScrollInfo is just called
350 * with SIF_DISABLENOSCROLL
352 if (0 == (lpsi
->fMask
& SIF_ALL
))
357 /* Check if the scrollbar should be hidden or disabled */
358 if (0 != (lpsi
->fMask
& (SIF_RANGE
| SIF_PAGE
| SIF_DISABLENOSCROLL
)))
360 if (Info
->nMin
>= (int)(Info
->nMax
- max(Info
->nPage
- 1, 0)))
362 /* Hide or disable scroll-bar */
363 if (0 != (lpsi
->fMask
& SIF_DISABLENOSCROLL
))
365 /* new_flags = ESB_DISABLE_BOTH;*/
367 else if ((nBar
!= SB_CTL
) && bChangeParams
)
369 co_UserShowScrollBar(Window
, nBar
, FALSE
);
373 else /* Show and enable scroll-bar */
376 if ((nBar
!= SB_CTL
) && bChangeParams
)
378 co_UserShowScrollBar(Window
, nBar
, TRUE
);
383 if (infoPtr
->flags
!= new_flags
) /* check arrow flags */
385 infoPtr
->flags
= new_flags
;
386 *Action
|= SA_SSI_REPAINT_ARROWS
;
394 RECT UpdateRect
= psbi
->rcScrollBar
;
395 UpdateRect
.left
-= Window
->Wnd
->ClientRect
.left
- Window
->Wnd
->WindowRect
.left
;
396 UpdateRect
.right
-= Window
->Wnd
->ClientRect
.left
- Window
->Wnd
->WindowRect
.left
;
397 UpdateRect
.top
-= Window
->Wnd
->ClientRect
.top
- Window
->Wnd
->WindowRect
.top
;
398 UpdateRect
.bottom
-= Window
->Wnd
->ClientRect
.top
- Window
->Wnd
->WindowRect
.top
;
399 co_UserRedrawWindow(Window
, &UpdateRect
, 0, RDW_INVALIDATE
| RDW_FRAME
);
402 /* Return current position */
407 co_IntGetScrollBarInfo(PWINDOW_OBJECT Window
, LONG idObject
, PSCROLLBARINFO psbi
)
413 ASSERT_REFS_CO(Window
);
415 Bar
= SBOBJ_TO_SBID(idObject
);
417 if(!SBID_IS_VALID(Bar
))
419 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
420 DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar
);
424 if(!co_IntCreateScrollBars(Window
))
429 sbi
= IntGetScrollbarInfoFromWindow(Window
, Bar
);
430 psi
= IntGetScrollInfoFromWindow(Window
, Bar
);
432 IntGetScrollBarRect(Window
, Bar
, &(sbi
->rcScrollBar
));
433 IntCalculateThumb(Window
, Bar
, sbi
, psi
);
435 RtlCopyMemory(psbi
, sbi
, sizeof(SCROLLBARINFO
));
441 co_IntCreateScrollBars(PWINDOW_OBJECT Window
)
449 ASSERT_REFS_CO(Window
);
453 /* no need to create it anymore */
457 /* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
458 Size
= 3 * (sizeof(WINDOW_SCROLLINFO
));
459 if(!(Window
->Scroll
= ExAllocatePoolWithTag(PagedPool
, Size
, TAG_SBARINFO
)))
461 DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window
->hSelf
);
465 RtlZeroMemory(Window
->Scroll
, Size
);
467 Result
= co_WinPosGetNonClientSize(Window
,
468 &Window
->Wnd
->WindowRect
,
469 &Window
->Wnd
->ClientRect
);
471 for(s
= SB_HORZ
; s
<= SB_VERT
; s
++)
473 psbi
= IntGetScrollbarInfoFromWindow(Window
, s
);
474 psbi
->cbSize
= sizeof(SCROLLBARINFO
);
475 for (i
= 0; i
< CCHILDREN_SCROLLBAR
+ 1; i
++)
476 psbi
->rgstate
[i
] = 0;
478 psi
= IntGetScrollInfoFromWindow(Window
, s
);
479 psi
->cbSize
= sizeof(LPSCROLLINFO
);
482 IntGetScrollBarRect(Window
, s
, &(psbi
->rcScrollBar
));
483 IntCalculateThumb(Window
, s
, psbi
, psi
);
490 IntDestroyScrollBars(PWINDOW_OBJECT Window
)
494 ExFreePool(Window
->Scroll
);
495 Window
->Scroll
= NULL
;
502 IntEnableScrollBar(BOOL Horz
, PSCROLLBARINFO Info
, UINT wArrows
)
507 case ESB_DISABLE_BOTH
:
508 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
509 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
511 case ESB_DISABLE_RTDN
:
514 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
518 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
521 case ESB_DISABLE_LTUP
:
524 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, STATE_SYSTEM_UNAVAILABLE
);
528 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, STATE_SYSTEM_UNAVAILABLE
);
531 case ESB_ENABLE_BOTH
:
532 CHANGERGSTATE(SBRG_TOPRIGHTBTN
, 0);
533 CHANGERGSTATE(SBRG_BOTTOMLEFTBTN
, 0);
542 NtUserGetScrollBarInfo(HWND hWnd
, LONG idObject
, PSCROLLBARINFO psbi
)
546 PWINDOW_OBJECT Window
;
548 DECLARE_RETURN(BOOL
);
549 USER_REFERENCE_ENTRY Ref
;
551 DPRINT("Enter NtUserGetScrollBarInfo\n");
552 UserEnterExclusive();
554 Status
= MmCopyFromCaller(&sbi
, psbi
, sizeof(SCROLLBARINFO
));
555 if(!NT_SUCCESS(Status
) || (sbi
.cbSize
!= sizeof(SCROLLBARINFO
)))
557 SetLastNtError(Status
);
561 if(!(Window
= UserGetWindowObject(hWnd
)))
566 UserRefObjectCo(Window
, &Ref
);
567 Ret
= co_IntGetScrollBarInfo(Window
, idObject
, &sbi
);
568 UserDerefObjectCo(Window
);
570 Status
= MmCopyToCaller(psbi
, &sbi
, sizeof(SCROLLBARINFO
));
571 if(!NT_SUCCESS(Status
))
573 SetLastNtError(Status
);
580 DPRINT("Leave NtUserGetScrollBarInfo, ret=%i\n",_ret_
);
589 NtUserGetScrollInfo(HWND hWnd
, int fnBar
, LPSCROLLINFO lpsi
)
592 PWINDOW_OBJECT Window
;
596 DECLARE_RETURN(BOOL
);
597 USER_REFERENCE_ENTRY Ref
;
599 DPRINT("Enter NtUserGetScrollInfo\n");
600 UserEnterExclusive();
602 Status
= MmCopyFromCaller(&psi
.cbSize
, &(lpsi
->cbSize
), sizeof(UINT
));
603 if(!NT_SUCCESS(Status
) ||
604 !((psi
.cbSize
== sizeof(SCROLLINFO
)) || (psi
.cbSize
== sizeof(SCROLLINFO
) - sizeof(psi
.nTrackPos
))))
606 SetLastNtError(Status
);
610 Status
= MmCopyFromCaller(&psi
, lpsi
, sz
);
611 if (!NT_SUCCESS(Status
))
613 SetLastNtError(Status
);
617 if(!(Window
= UserGetWindowObject(hWnd
)))
622 UserRefObjectCo(Window
, &Ref
);
623 Ret
= co_IntGetScrollInfo(Window
, fnBar
, &psi
);
624 UserDerefObjectCo(Window
);
626 Status
= MmCopyToCaller(lpsi
, &psi
, sz
);
627 if(!NT_SUCCESS(Status
))
629 SetLastNtError(Status
);
636 DPRINT("Leave NtUserGetScrollInfo, ret=%i\n",_ret_
);
644 NtUserEnableScrollBar(
649 PWINDOW_OBJECT Window
= NULL
;
650 PSCROLLBARINFO InfoV
= NULL
, InfoH
= NULL
;
652 DECLARE_RETURN(BOOL
);
653 USER_REFERENCE_ENTRY Ref
;
655 DPRINT("Enter NtUserEnableScrollBar\n");
656 UserEnterExclusive();
658 if(!(Window
= UserGetWindowObject(hWnd
)))
662 UserRefObjectCo(Window
, &Ref
);
664 if(wSBflags
== SB_CTL
)
666 /* FIXME Enable or Disable SB Ctrl*/
667 DPRINT1("Enable Scrollbar SB_CTL\n");
668 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_CTL
);
669 Chg
= IntEnableScrollBar(FALSE
, InfoV
,wArrows
);
670 /* Chg? Scrollbar is Refresh in user32/controls/scrollbar.c. */
675 if(wSBflags
!= SB_BOTH
&& !SBID_IS_VALID(wSBflags
))
677 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
678 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", wSBflags
);
682 if(!co_IntCreateScrollBars(Window
))
690 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_VERT
);
693 InfoH
= IntGetScrollbarInfoFromWindow(Window
, SB_HORZ
);
696 InfoV
= IntGetScrollbarInfoFromWindow(Window
, SB_VERT
);
703 Chg
= IntEnableScrollBar(FALSE
, InfoV
, wArrows
);
706 Chg
= (IntEnableScrollBar(TRUE
, InfoH
, wArrows
) || Chg
);
708 //if(Chg && (Window->Style & WS_VISIBLE))
709 /* FIXME - repaint scrollbars */
715 UserDerefObjectCo(Window
);
717 DPRINT("Leave NtUserEnableScrollBar, ret=%i\n",_ret_
);
724 NtUserSetScrollBarInfo(
727 SETSCROLLBARINFO
*info
)
729 PWINDOW_OBJECT Window
= NULL
;
730 SETSCROLLBARINFO Safeinfo
;
735 DECLARE_RETURN(BOOL
);
736 USER_REFERENCE_ENTRY Ref
;
738 DPRINT("Enter NtUserSetScrollBarInfo\n");
739 UserEnterExclusive();
741 if(!(Window
= UserGetWindowObject(hWnd
)))
745 UserRefObjectCo(Window
, &Ref
);
747 Obj
= SBOBJ_TO_SBID(idObject
);
748 if(!SBID_IS_VALID(Obj
))
750 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
751 DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", Obj
);
755 if(!co_IntCreateScrollBars(Window
))
760 Status
= MmCopyFromCaller(&Safeinfo
, info
, sizeof(SETSCROLLBARINFO
));
761 if(!NT_SUCCESS(Status
))
763 SetLastNtError(Status
);
767 sbi
= IntGetScrollbarInfoFromWindow(Window
, Obj
);
768 psi
= IntGetScrollInfoFromWindow(Window
, Obj
);
770 psi
->nTrackPos
= Safeinfo
.nTrackPos
;
771 sbi
->reserved
= Safeinfo
.reserved
;
772 RtlCopyMemory(&sbi
->rgstate
, &Safeinfo
.rgstate
, sizeof(Safeinfo
.rgstate
));
778 UserDerefObjectCo(Window
);
780 DPRINT("Leave NtUserSetScrollBarInfo, ret=%i\n",_ret_
);
793 PWINDOW_OBJECT Window
= NULL
;
795 SCROLLINFO ScrollInfo
;
796 DECLARE_RETURN(DWORD
);
797 USER_REFERENCE_ENTRY Ref
;
799 DPRINT("Enter NtUserSetScrollInfo\n");
800 UserEnterExclusive();
802 if(!(Window
= UserGetWindowObject(hWnd
)))
806 UserRefObjectCo(Window
, &Ref
);
808 Status
= MmCopyFromCaller(&ScrollInfo
, lpsi
, sizeof(SCROLLINFO
) - sizeof(ScrollInfo
.nTrackPos
));
809 if(!NT_SUCCESS(Status
))
811 SetLastNtError(Status
);
815 RETURN(co_IntSetScrollInfo(Window
, fnBar
, &ScrollInfo
, bRedraw
));
819 UserDerefObjectCo(Window
);
821 DPRINT("Leave NtUserSetScrollInfo, ret=%i\n",_ret_
);
827 /* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
829 co_UserShowScrollBar(PWINDOW_OBJECT Window
, int wBar
, DWORD bShow
)
831 DWORD Style
, OldStyle
;
834 ASSERT_REFS_CO(Window
);
847 Style
= WS_HSCROLL
| WS_VSCROLL
;
853 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
857 if(!co_IntCreateScrollBars(Window
))
864 IntUpdateSBInfo(Window
, SB_CTL
);
866 co_WinPosShowWindow(Window
, bShow
? SW_SHOW
: SW_HIDE
);
870 OldStyle
= Wnd
->Style
;
874 Wnd
->Style
&= ~Style
;
876 if(Wnd
->Style
!= OldStyle
)
878 if(Wnd
->Style
& WS_HSCROLL
)
879 IntUpdateSBInfo(Window
, SB_HORZ
);
880 if(Wnd
->Style
& WS_VSCROLL
)
881 IntUpdateSBInfo(Window
, SB_VERT
);
883 if(Wnd
->Style
& WS_VISIBLE
)
885 /* Frame has been changed, let the window redraw itself */
886 co_WinPosSetWindowPos(Window
, 0, 0, 0, 0, 0, SWP_NOSIZE
| SWP_NOMOVE
|
887 SWP_NOACTIVATE
| SWP_NOZORDER
| SWP_FRAMECHANGED
| SWP_NOSENDCHANGING
);
896 NtUserShowScrollBar(HWND hWnd
, int wBar
, DWORD bShow
)
898 PWINDOW_OBJECT Window
;
899 DECLARE_RETURN(DWORD
);
901 USER_REFERENCE_ENTRY Ref
;
903 DPRINT("Enter NtUserShowScrollBar\n");
904 UserEnterExclusive();
906 if (!(Window
= UserGetWindowObject(hWnd
)))
911 UserRefObjectCo(Window
, &Ref
);
912 ret
= co_UserShowScrollBar(Window
, wBar
, bShow
);
913 UserDerefObjectCo(Window
);
918 DPRINT("Leave NtUserShowScrollBar, ret%i\n",_ret_
);