ReactOS  0.4.15-dev-5496-g599ba9c
scrollbar.c File Reference
#include <win32k.h>
Include dependency graph for scrollbar.c:

Go to the source code of this file.

Macros

#define SCROLL_NOWHERE   0x00 /* Outside the scroll bar */
 
#define SCROLL_TOP_ARROW   0x01 /* Top or left arrow */
 
#define SCROLL_TOP_RECT   0x02 /* Rectangle between the top arrow and the thumb */
 
#define SCROLL_THUMB   0x03 /* Thumb rectangle */
 
#define SCROLL_BOTTOM_RECT   0x04 /* Rectangle between the thumb and the bottom arrow */
 
#define SCROLL_BOTTOM_ARROW   0x05 /* Bottom or right arrow */
 
#define SCROLL_FIRST_DELAY
 
#define SCROLL_REPEAT_DELAY   50 /* Delay (in ms) between scroll repetitions */
 
#define SCROLL_TIMER   0 /* Scroll timer id */
 
#define SCROLL_MIN_RECT   4
 
#define SCROLL_MIN_THUMB   6
 
#define SCROLL_ARROW_THUMB_OVERLAP   0
 
#define MINTRACKTHUMB   8 /* Minimum size of the rectangle between the arrows */
 
#define SA_SSI_HIDE   0x0001
 
#define SA_SSI_SHOW   0x0002
 
#define SA_SSI_REFRESH   0x0004
 
#define SA_SSI_REPAINT_ARROWS   0x0008
 
#define SBRG_SCROLLBAR   0 /* The scrollbar itself */
 
#define SBRG_TOPRIGHTBTN   1 /* The top or right button */
 
#define SBRG_PAGEUPRIGHT   2 /* The page up or page right region */
 
#define SBRG_SCROLLBOX   3 /* The scroll box */
 
#define SBRG_PAGEDOWNLEFT   4 /* The page down or page left region */
 
#define SBRG_BOTTOMLEFTBTN   5 /* The bottom or left button */
 
#define CHANGERGSTATE(item, status)
 

Functions

 DBG_DEFAULT_CHANNEL (UserScrollbar)
 
BOOL APIENTRY IntEnableScrollBar (BOOL Horz, PSCROLLBARINFO Info, UINT wArrows)
 
static void IntRefeshScrollInterior (PWND pWnd, INT nBar, PSCROLLBARINFO psbi)
 
static void mirror_rect (const RECT *window_rect, RECT *rect)
 
PSBDATA FASTCALL IntGetSBData (PWND pwnd, INT Bar)
 
BOOL FASTCALL IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
 
BOOL FASTCALL IntCalculateThumb (PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, PSBDATA pSBData)
 
static BOOL FASTCALL co_IntGetScrollInfo (PWND Window, INT nBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
 
BOOL FASTCALL NEWco_IntGetScrollInfo (PWND pWnd, INT nBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
 
static DWORD FASTCALL co_IntSetScrollInfo (PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
 
BOOL FASTCALL co_IntGetScrollBarInfo (PWND Window, LONG idObject, PSCROLLBARINFO psbi)
 
BOOL FASTCALL co_IntSetScrollBarInfo (PWND Window, LONG idObject, PSETSCROLLBARINFO psbi)
 
BOOL FASTCALL co_IntCreateScrollBars (PWND Window)
 
BOOL FASTCALL IntDestroyScrollBars (PWND Window)
 
DWORD FASTCALL co_UserShowScrollBar (PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
 
static void IntDrawScrollInterior (PWND pWnd, HDC hDC, INT nBar, BOOL Vertical, PSCROLLBARINFO ScrollBarInfo)
 
static VOID FASTCALL IntDrawScrollArrows (HDC hDC, PSCROLLBARINFO ScrollBarInfo, BOOL Vertical)
 
static LONG FASTCALL IntScrollGetObjectId (INT SBType)
 
void IntDrawScrollBar (PWND Wnd, HDC DC, INT Bar)
 
LRESULT APIENTRY ScrollBarWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL APIENTRY NtUserGetScrollBarInfo (HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
 
BOOL APIENTRY NtUserSBGetParms (HWND hWnd, int fnBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
 
BOOL APIENTRY NtUserEnableScrollBar (HWND hWnd, UINT wSBflags, UINT wArrows)
 
DWORD APIENTRY NtUserSetScrollInfo (HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
 
DWORD APIENTRY NtUserShowScrollBar (HWND hWnd, int nBar, DWORD bShow)
 
BOOL APIENTRY NtUserSetScrollBarInfo (HWND hWnd, LONG idObject, SETSCROLLBARINFO *info)
 

Macro Definition Documentation

◆ CHANGERGSTATE

#define CHANGERGSTATE (   item,
  status 
)
Value:
if(Info->rgstate[(item)] != (status)) \
Chg = TRUE; \
Info->rgstate[(item)] = (status);
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
static ATOM item
Definition: dde.c:856
Definition: ps.c:97

Definition at line 54 of file scrollbar.c.

◆ MINTRACKTHUMB

#define MINTRACKTHUMB   8 /* Minimum size of the rectangle between the arrows */

Definition at line 39 of file scrollbar.c.

◆ SA_SSI_HIDE

#define SA_SSI_HIDE   0x0001

Definition at line 42 of file scrollbar.c.

◆ SA_SSI_REFRESH

#define SA_SSI_REFRESH   0x0004

Definition at line 44 of file scrollbar.c.

◆ SA_SSI_REPAINT_ARROWS

#define SA_SSI_REPAINT_ARROWS   0x0008

Definition at line 45 of file scrollbar.c.

◆ SA_SSI_SHOW

#define SA_SSI_SHOW   0x0002

Definition at line 43 of file scrollbar.c.

◆ SBRG_BOTTOMLEFTBTN

#define SBRG_BOTTOMLEFTBTN   5 /* The bottom or left button */

Definition at line 52 of file scrollbar.c.

◆ SBRG_PAGEDOWNLEFT

#define SBRG_PAGEDOWNLEFT   4 /* The page down or page left region */

Definition at line 51 of file scrollbar.c.

◆ SBRG_PAGEUPRIGHT

#define SBRG_PAGEUPRIGHT   2 /* The page up or page right region */

Definition at line 49 of file scrollbar.c.

◆ SBRG_SCROLLBAR

#define SBRG_SCROLLBAR   0 /* The scrollbar itself */

Definition at line 47 of file scrollbar.c.

◆ SBRG_SCROLLBOX

#define SBRG_SCROLLBOX   3 /* The scroll box */

Definition at line 50 of file scrollbar.c.

◆ SBRG_TOPRIGHTBTN

#define SBRG_TOPRIGHTBTN   1 /* The top or right button */

Definition at line 48 of file scrollbar.c.

◆ SCROLL_ARROW_THUMB_OVERLAP

#define SCROLL_ARROW_THUMB_OVERLAP   0

Definition at line 34 of file scrollbar.c.

◆ SCROLL_BOTTOM_ARROW

#define SCROLL_BOTTOM_ARROW   0x05 /* Bottom or right arrow */

Definition at line 19 of file scrollbar.c.

◆ SCROLL_BOTTOM_RECT

#define SCROLL_BOTTOM_RECT   0x04 /* Rectangle between the thumb and the bottom arrow */

Definition at line 18 of file scrollbar.c.

◆ SCROLL_FIRST_DELAY

#define SCROLL_FIRST_DELAY
Value:
200 /* Delay (in ms) before first repetition when
holding the button down */

Definition at line 21 of file scrollbar.c.

◆ SCROLL_MIN_RECT

#define SCROLL_MIN_RECT   4

Definition at line 28 of file scrollbar.c.

◆ SCROLL_MIN_THUMB

#define SCROLL_MIN_THUMB   6

Definition at line 31 of file scrollbar.c.

◆ SCROLL_NOWHERE

#define SCROLL_NOWHERE   0x00 /* Outside the scroll bar */

Definition at line 14 of file scrollbar.c.

◆ SCROLL_REPEAT_DELAY

#define SCROLL_REPEAT_DELAY   50 /* Delay (in ms) between scroll repetitions */

Definition at line 23 of file scrollbar.c.

◆ SCROLL_THUMB

#define SCROLL_THUMB   0x03 /* Thumb rectangle */

Definition at line 17 of file scrollbar.c.

◆ SCROLL_TIMER

#define SCROLL_TIMER   0 /* Scroll timer id */

Definition at line 25 of file scrollbar.c.

◆ SCROLL_TOP_ARROW

#define SCROLL_TOP_ARROW   0x01 /* Top or left arrow */

Definition at line 15 of file scrollbar.c.

◆ SCROLL_TOP_RECT

#define SCROLL_TOP_RECT   0x02 /* Rectangle between the top arrow and the thumb */

Definition at line 16 of file scrollbar.c.

Function Documentation

◆ co_IntCreateScrollBars()

BOOL FASTCALL co_IntCreateScrollBars ( PWND  Window)

Definition at line 842 of file scrollbar.c.

843 {
844  PSCROLLBARINFO psbi;
845  PSBDATA pSBData;
846  ULONG Size, s;
847  INT i;
848 
850 
851  if (Window->pSBInfo && Window->pSBInfoex)
852  {
853  /* No need to create it anymore */
854  return TRUE;
855  }
856 
857  /* Allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
858  Size = 3 * (sizeof(SBINFOEX));
860  {
861  ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h);
862  return FALSE;
863  }
864 
865  RtlZeroMemory(Window->pSBInfoex, Size);
866 
867  if(!(Window->pSBInfo = DesktopHeapAlloc( Window->head.rpdesk, sizeof(SBINFO))))
868  {
869  ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h);
870  return FALSE;
871  }
872 
873  RtlZeroMemory(Window->pSBInfo, sizeof(SBINFO));
874  Window->pSBInfo->Vert.posMax = 100;
875  Window->pSBInfo->Horz.posMax = 100;
876 
878  &Window->rcWindow,
879  &Window->rcClient);
880 
881  for(s = SB_HORZ; s <= SB_VERT; s++)
882  {
884  psbi->cbSize = sizeof(SCROLLBARINFO);
885  for (i = 0; i < CCHILDREN_SCROLLBAR + 1; i++)
886  psbi->rgstate[i] = 0;
887 
888  pSBData = IntGetSBData(Window, s);
889 
891  IntCalculateThumb(Window, s, psbi, pSBData);
892  }
893 
894  return TRUE;
895 }
BOOL FASTCALL IntGetScrollBarRect(PWND Wnd, INT nBar, RECTL *lprect)
Definition: scrollbar.c:110
PSBDATA FASTCALL IntGetSBData(PWND pwnd, INT Bar)
Definition: scrollbar.c:83
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SB_HORZ
Definition: winuser.h:552
#define CCHILDREN_SCROLLBAR
Definition: winuser.h:3735
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
int32_t INT
Definition: typedefs.h:58
#define TAG_SBARINFO
Definition: tags.h:9
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
static __inline PVOID DesktopHeapAlloc(IN PDESKTOP Desktop, IN SIZE_T Bytes)
Definition: desktop.h:204
#define FALSE
Definition: types.h:117
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
BOOL FASTCALL IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, PSBDATA pSBData)
Definition: scrollbar.c:172
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
GLdouble s
Definition: gl.h:2039
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct tagSCROLLBARINFO SCROLLBARINFO
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
struct _SBINFOEX SBINFOEX
LRESULT FASTCALL co_WinPosGetNonClientSize(PWND Window, RECT *WindowRect, RECT *ClientRect)
Definition: winpos.c:2318

Referenced by co_IntGetScrollBarInfo(), co_IntSetScrollBarInfo(), co_IntSetScrollInfo(), NtUserEnableScrollBar(), and NtUserSetScrollBarInfo().

◆ co_IntGetScrollBarInfo()

BOOL FASTCALL co_IntGetScrollBarInfo ( PWND  Window,
LONG  idObject,
PSCROLLBARINFO  psbi 
)

Definition at line 760 of file scrollbar.c.

761 {
762  INT Bar;
763  PSCROLLBARINFO sbi;
764  PSBDATA pSBData;
766 
767  Bar = SBOBJ_TO_SBID(idObject);
768 
769  if(!SBID_IS_VALID(Bar))
770  {
772  ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar);
773  return FALSE;
774  }
775 
777  {
778  ERR("Failed to create scrollbars for window.\n");
779  return FALSE;
780  }
781 
783  pSBData = IntGetSBData(Window, Bar);
784 
786  IntCalculateThumb(Window, Bar, sbi, pSBData);
787 
788  /* Scroll bar state */
789  psbi->rgstate[0] = 0;
790  if ((Bar == SB_HORZ && !(Window->style & WS_HSCROLL))
791  || (Bar == SB_VERT && !(Window->style & WS_VSCROLL)))
792  psbi->rgstate[0] |= STATE_SYSTEM_INVISIBLE;
793  if (pSBData->posMin >= pSBData->posMax - max(pSBData->page - 1, 0))
794  {
795  if (!(psbi->rgstate[0] & STATE_SYSTEM_INVISIBLE))
796  psbi->rgstate[0] |= STATE_SYSTEM_UNAVAILABLE;
797  else
798  psbi->rgstate[0] |= STATE_SYSTEM_OFFSCREEN;
799  }
800  if (Bar == SB_CTL && !(Window->style & WS_DISABLED))
801  psbi->rgstate[0] |= STATE_SYSTEM_UNAVAILABLE;
802 
803  RtlCopyMemory(psbi, sbi, sizeof(SCROLLBARINFO));
804 
805  return TRUE;
806 }
BOOL FASTCALL IntGetScrollBarRect(PWND Wnd, INT nBar, RECTL *lprect)
Definition: scrollbar.c:110
PSBDATA FASTCALL IntGetSBData(PWND pwnd, INT Bar)
Definition: scrollbar.c:83
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define WS_DISABLED
Definition: pedump.c:621
#define max(a, b)
Definition: svc.c:63
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2852
#define STATE_SYSTEM_OFFSCREEN
Definition: winuser.h:2868
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
INT page
Definition: ntuser.h:502
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SB_HORZ
Definition: winuser.h:552
#define SBOBJ_TO_SBID(Obj)
Definition: scroll.h:39
int32_t INT
Definition: typedefs.h:58
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
#define FALSE
Definition: types.h:117
void Bar(void)
Definition: terminate.cpp:70
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:842
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
BOOL FASTCALL IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, PSBDATA pSBData)
Definition: scrollbar.c:172
#define WS_HSCROLL
Definition: pedump.c:628
INT posMin
Definition: ntuser.h:500
#define ERR(fmt,...)
Definition: debug.h:110
#define WS_VSCROLL
Definition: pedump.c:627
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2867
INT posMax
Definition: ntuser.h:501

Referenced by IntDrawScrollBar(), IntIsScrollBarVisible(), IntRefeshScrollInterior(), and NtUserGetScrollBarInfo().

◆ co_IntGetScrollInfo()

static BOOL FASTCALL co_IntGetScrollInfo ( PWND  Window,
INT  nBar,
PSBDATA  pSBData,
LPSCROLLINFO  lpsi 
)
static

Definition at line 272 of file scrollbar.c.

273 {
274  UINT Mask;
275  LPSCROLLINFO psi;
276 
278 
279  lpsi->fMask &= ~SIF_THEMED; // Remove Theme bit
280  if(!SBID_IS_VALID(nBar))
281  {
283  ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar);
284  return FALSE;
285  }
286 
287  if (!Window->pSBInfo)
288  {
289  ERR("IntGetScrollInfo No window scrollbar info!\n");
290  return FALSE;
291  }
292 
293  psi = IntGetScrollInfoFromWindow(Window, nBar);
294 
295  if (lpsi->fMask == SIF_ALL)
296  {
298  }
299  else
300  {
301  Mask = lpsi->fMask;
302  }
303 
304  if (0 != (Mask & SIF_PAGE))
305  {
306  lpsi->nPage = psi->nPage;
307  }
308 
309  if (0 != (Mask & SIF_POS))
310  {
311  lpsi->nPos = psi->nPos;
312  }
313 
314  if (0 != (Mask & SIF_RANGE))
315  {
316  lpsi->nMin = psi->nMin;
317  lpsi->nMax = psi->nMax;
318  }
319 
320  if (0 != (Mask & SIF_TRACKPOS))
321  {
322  lpsi->nTrackPos = psi->nTrackPos;
323  }
324 
325  return TRUE;
326 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SIF_RANGE
Definition: winuser.h:1225
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SIF_THEMED
Definition: winuser.h:1228
#define SIF_PAGE
Definition: winuser.h:1223
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int Mask
Definition: fpcontrol.c:82
#define SIF_POS
Definition: winuser.h:1224
#define ERR(fmt,...)
Definition: debug.h:110
#define SIF_TRACKPOS
Definition: winuser.h:1227
unsigned int UINT
Definition: ndis.h:50
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
#define SBID_IS_VALID(id)
Definition: scroll.h:40
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
#define SIF_ALL
Definition: winuser.h:1222

Referenced by NtUserSBGetParms().

◆ co_IntSetScrollBarInfo()

BOOL FASTCALL co_IntSetScrollBarInfo ( PWND  Window,
LONG  idObject,
PSETSCROLLBARINFO  psbi 
)

Definition at line 809 of file scrollbar.c.

810 {
811  INT Bar;
812  PSCROLLBARINFO sbi;
813  LPSCROLLINFO psi;
815 
816  Bar = SBOBJ_TO_SBID(idObject);
817 
818  if(!SBID_IS_VALID(Bar))
819  {
821  ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar);
822  return FALSE;
823  }
824 
826  {
827  ERR("Failed to create scrollbars for window.\n");
828  return FALSE;
829  }
830 
833 
834  psi->nTrackPos = psbi->nTrackPos;
835  sbi->reserved = psbi->reserved;
836  RtlCopyMemory(&sbi->rgstate, &psbi->rgstate, sizeof(psbi->rgstate));
837 
838  return TRUE;
839 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SBOBJ_TO_SBID(Obj)
Definition: scroll.h:39
int32_t INT
Definition: typedefs.h:58
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
#define FALSE
Definition: types.h:117
void Bar(void)
Definition: terminate.cpp:70
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: ntuser.h:3739
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:842
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
#define ERR(fmt,...)
Definition: debug.h:110
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28

◆ co_IntSetScrollInfo()

static DWORD FASTCALL co_IntSetScrollInfo ( PWND  Window,
INT  nBar,
LPCSCROLLINFO  lpsi,
BOOL  bRedraw 
)
static

Definition at line 479 of file scrollbar.c.

480 {
481  /*
482  * Update the scrollbar state and set action flags according to
483  * what has to be done graphics wise.
484  */
485 
487  PSCROLLBARINFO psbi;
488  UINT new_flags;
489  INT action = 0;
490  PSBDATA pSBData;
491  DWORD OldPos = 0, CurrentPos = 0;
492  BOOL bChangeParams = FALSE; /* Don't show/hide scrollbar if params don't change */
493  UINT MaxPage;
494  int MaxPos;
495  /* [0] = SB_HORZ, [1] = SB_VERT, [2] = SB_CTL */
496  static PWND PrevHwnd[3] = { 0 };
497  static DWORD PrevPos[3] = { 0 };
498  static DWORD PrevMax[3] = { 0 };
499  static INT PrevAction[3] = { 0 };
500  BOOL bVisible;
501 
503 
504  if(!SBID_IS_VALID(nBar)) /* Assures nBar is 0, 1, or 2 */
505  {
507  ERR("Trying to set scrollinfo for unknown scrollbar type %d\n", nBar);
508  return FALSE;
509  }
510 
512  {
513  return FALSE;
514  }
515 
516  if (lpsi->cbSize != sizeof(SCROLLINFO) &&
517  lpsi->cbSize != (sizeof(SCROLLINFO) - sizeof(lpsi->nTrackPos)))
518  {
520  return 0;
521  }
523  {
525  return 0;
526  }
527 
530  pSBData = IntGetSBData(Window, nBar);
531 
532  if (lpsi->fMask & SIF_THEMED && !(Info->fMask & SIF_THEMED))
533  {
534  Info->fMask |= SIF_THEMED;
535  }
536 
537  /* Set the page size */
538  if (lpsi->fMask & SIF_PAGE)
539  {
540  if (Info->nPage != lpsi->nPage)
541  {
542  Info->nPage = lpsi->nPage;
543  pSBData->page = lpsi->nPage;
544  bChangeParams = TRUE;
545  }
546  }
547 
548  /* Set the scroll pos */
549  if (lpsi->fMask & SIF_POS)
550  {
551  if (Info->nPos != lpsi->nPos)
552  {
553  OldPos = Info->nPos;
554  Info->nPos = lpsi->nPos;
555  pSBData->pos = lpsi->nPos;
556  }
557  }
558 
559  /* Set the scroll range */
560  if (lpsi->fMask & SIF_RANGE)
561  {
562  if (lpsi->nMin > lpsi->nMax)
563  {
564  Info->nMin = lpsi->nMin;
565  Info->nMax = lpsi->nMin;
566  pSBData->posMin = lpsi->nMin;
567  pSBData->posMax = lpsi->nMin;
568  bChangeParams = TRUE;
569  }
570  else if (Info->nMin != lpsi->nMin || Info->nMax != lpsi->nMax)
571  {
572  Info->nMin = lpsi->nMin;
573  Info->nMax = lpsi->nMax;
574  pSBData->posMin = lpsi->nMin;
575  pSBData->posMax = lpsi->nMax;
576  bChangeParams = TRUE;
577  }
578  }
579 
580  /* Make sure the page size is valid */
581  MaxPage = abs(Info->nMax - Info->nMin) + 1;
582  if (Info->nPage > MaxPage)
583  {
584  pSBData->page = Info->nPage = MaxPage;
585  }
586 
587  /* Make sure the pos is inside the range */
588  MaxPos = Info->nMax + 1 - (int)max(Info->nPage, 1);
589  ASSERT(MaxPos >= Info->nMin);
590  if (Info->nPos < Info->nMin)
591  {
592  pSBData->pos = Info->nPos = Info->nMin;
593  }
594  else if (Info->nPos > MaxPos)
595  {
596  pSBData->pos = Info->nPos = MaxPos;
597  }
598 
599  /*
600  * Don't change the scrollbar state if SetScrollInfo is just called
601  * with SIF_DISABLENOSCROLL
602  */
603  if (!(lpsi->fMask & SIF_ALL))
604  {
605  //goto done;
606  return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos;
607  }
608 
609  /* Check if the scrollbar should be hidden or disabled */
610  if (lpsi->fMask & (SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL))
611  {
612  new_flags = Window->pSBInfo->WSBflags;
613  if (Info->nMin + (int)max(Info->nPage, 1) > Info->nMax)
614  {
615  /* Hide or disable scroll-bar */
616  if (lpsi->fMask & SIF_DISABLENOSCROLL)
617  {
618  new_flags = ESB_DISABLE_BOTH;
619  bChangeParams = TRUE;
620  }
621  else if ((nBar != SB_CTL) && bChangeParams)
622  {
624  }
625  }
626  else /* Show and enable scroll-bar only if no page only changed. */
627  if ((lpsi->fMask & ~SIF_THEMED) != SIF_PAGE)
628  {
629  if ((nBar != SB_CTL) && bChangeParams)
630  {
631  new_flags = ESB_ENABLE_BOTH;
632  action |= SA_SSI_SHOW;
633  }
634  else if (nBar == SB_CTL)
635  {
636  new_flags = ESB_ENABLE_BOTH;
637  }
638  }
639 
640  if (Window->pSBInfo->WSBflags != new_flags) /* Check arrow flags */
641  {
642  Window->pSBInfo->WSBflags = new_flags;
644  }
645  }
646 
647 //done:
648  if ((Window != PrevHwnd[nBar]) || (action != PrevAction[nBar]))
649  {
650  if ((action == SA_SSI_SHOW) && (PrevAction[nBar] == SA_SSI_HIDE))
651  {
653  }
654  }
655  if ((action != PrevAction[nBar]) && action != 0)
656  PrevAction[nBar] = action;
657 
658  if ( action & SA_SSI_HIDE )
659  {
661  }
662  else
663  {
664  if ( action & SA_SSI_SHOW )
665  if ( co_UserShowScrollBar(Window, nBar, TRUE, TRUE) )
666  return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; /* SetWindowPos() already did the painting */
667 
668  switch (nBar)
669  {
670  case SB_HORZ:
671  bVisible = (Window->style & WS_HSCROLL);
672  break;
673  case SB_VERT:
674  bVisible = (Window->style & WS_VSCROLL);
675  break;
676  case SB_CTL:
677  bVisible = (Window->style & WS_VISIBLE);
678  break;
679  default:
680  bVisible = FALSE;
681  break;
682  }
683 
684  if (bRedraw && bVisible)
685  {
686  if (!(Info->fMask & SIF_THEMED)) /* Not Using Themes */
687  {
688  TRACE("Not using themes.\n");
690  {
691  // Redraw the entire bar.
692  RECTL UpdateRect = psbi->rcScrollBar;
693  UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
694  UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
695  UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
696  UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
698  }
699  else
700  {
701  // Redraw only the interior part of the bar.
702  IntRefeshScrollInterior(Window, nBar, psbi);
703  }
704  }
705  else /* Using Themes */
706  {
707  RECTL UpdateRect = psbi->rcScrollBar;
708  TRACE("Using themes.\n");
709  UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
710  UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
711  UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
712  UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
713  /* Just paint the interior and not the arrows. */
714  if (!(action & SA_SSI_REPAINT_ARROWS))
715  {
716  if (nBar == SB_HORZ)
717  {
718  UpdateRect.left += psbi->dxyLineButton;
719  UpdateRect.right -= psbi->dxyLineButton;
720  }
721  if (nBar == SB_VERT)
722  {
723  UpdateRect.top += psbi->dxyLineButton;
724  UpdateRect.bottom -= psbi->dxyLineButton;
725  }
726  }
727  CurrentPos = lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos;
728  /* Check for changes to Window or CurrentPos or lpsi->nMax */
729  if ((Window != PrevHwnd[nBar]) || (CurrentPos != PrevPos[nBar]) ||
730  (lpsi->nMax != PrevMax[nBar]))
731  {
733  PrevHwnd[nBar] = Window;
734  PrevPos[nBar] = CurrentPos;
735  PrevMax[nBar] = lpsi->nMax;
736  }
737  }
738  } // FIXME: Arrows
739 /* else if( action & SA_SSI_REPAINT_ARROWS )
740  {
741  RECTL UpdateRect = psbi->rcScrollBar;
742  UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
743  UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
744  UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
745  UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
746  co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
747  }
748 */ }
749 
750  if (bChangeParams && (nBar == SB_HORZ || nBar == SB_VERT) && (lpsi->fMask & SIF_DISABLENOSCROLL))
751  {
752  IntEnableScrollBar(nBar == SB_HORZ, psbi, Window->pSBInfo->WSBflags);
753  }
754 
755  /* Return current position */
756  return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos;
757 }
PSBDATA FASTCALL IntGetSBData(PWND pwnd, INT Bar)
Definition: scrollbar.c:83
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define abs(i)
Definition: fconv.c:206
#define max(a, b)
Definition: svc.c:63
#define SIF_RANGE
Definition: winuser.h:1225
#define SA_SSI_HIDE
Definition: scrollbar.c:42
#define SB_CTL
Definition: winuser.h:554
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
INT page
Definition: ntuser.h:502
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SIF_THEMED
Definition: winuser.h:1228
static void IntRefeshScrollInterior(PWND pWnd, INT nBar, PSCROLLBARINFO psbi)
Definition: scrollbar.c:1165
#define SB_HORZ
Definition: winuser.h:552
INT pos
Definition: ntuser.h:503
#define RDW_FRAME
Definition: winuser.h:1202
int32_t INT
Definition: typedefs.h:58
#define SIF_PAGE
Definition: winuser.h:1223
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:842
#define TRACE(s)
Definition: solgame.cpp:4
#define ASSERT(a)
Definition: mode.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
int Window
Definition: x11stubs.h:26
#define WS_HSCROLL
Definition: pedump.c:628
#define SA_SSI_SHOW
Definition: scrollbar.c:43
INT posMin
Definition: ntuser.h:500
#define SIF_POS
Definition: winuser.h:1224
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
#define SIF_PREVIOUSPOS
Definition: undocuser.h:89
const WCHAR * action
Definition: action.c:7479
BOOL APIENTRY IntEnableScrollBar(BOOL Horz, PSCROLLBARINFO Info, UINT wArrows)
Definition: scrollbar.c:912
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
DWORD FASTCALL co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
Definition: scrollbar.c:951
#define SA_SSI_REPAINT_ARROWS
Definition: scrollbar.c:45
unsigned int UINT
Definition: ndis.h:50
#define WS_VSCROLL
Definition: pedump.c:627
#define SIF_DISABLENOSCROLL
Definition: winuser.h:1226
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
#define SBID_IS_VALID(id)
Definition: scroll.h:40
static int UpdateRect(TreeListData *pData, unsigned uItem, unsigned uSub)
Definition: treelist.c:1529
#define WS_VISIBLE
Definition: pedump.c:620
#define ESB_ENABLE_BOTH
Definition: winuser.h:563
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
INT posMax
Definition: ntuser.h:501
#define RDW_INVALIDATE
Definition: winuser.h:1204
#define SIF_ALL
Definition: winuser.h:1222
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by NtUserSetScrollInfo().

◆ co_UserShowScrollBar()

DWORD FASTCALL co_UserShowScrollBar ( PWND  Wnd,
int  nBar,
BOOL  fShowH,
BOOL  fShowV 
)

Definition at line 951 of file scrollbar.c.

952 {
953  ULONG old_style, set_bits = 0, clear_bits = 0;
954 
955  ASSERT_REFS_CO(Wnd);
956 
957  switch(nBar)
958  {
959  case SB_CTL:
960  {
961  //IntUpdateSBInfo(Wnd, SB_CTL); // Is this needed? Was tested w/o!
962 
963  co_WinPosShowWindow(Wnd, fShowH ? SW_SHOW : SW_HIDE);
964  return TRUE;
965  }
966  case SB_BOTH:
967  case SB_HORZ:
968  if (fShowH) set_bits |= WS_HSCROLL;
969  else clear_bits |= WS_HSCROLL;
970  if( nBar == SB_HORZ ) break;
971  /* Fall through */
972  case SB_VERT:
973  if (fShowV) set_bits |= WS_VSCROLL;
974  else clear_bits |= WS_VSCROLL;
975  break;
976  default:
978  return FALSE; /* Nothing to do! */
979  }
980 
981  old_style = IntSetStyle( Wnd, set_bits, clear_bits );
982  if ((old_style & clear_bits) != 0 || (old_style & set_bits) != set_bits)
983  {
985  //if (Wnd->style & WS_HSCROLL) IntUpdateSBInfo(Wnd, SB_HORZ);
986  //if (Wnd->style & WS_VSCROLL) IntUpdateSBInfo(Wnd, SB_VERT);
988  /* Frame has been changed, let the window redraw itself */
989  co_WinPosSetWindowPos( Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
991  return TRUE;
992  }
993  return FALSE; /* no frame changes */
994 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:14
#define SB_HORZ
Definition: winuser.h:552
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1748
#define SWP_NOZORDER
Definition: winuser.h:1237
#define FALSE
Definition: types.h:117
#define SW_SHOW
Definition: winuser.h:769
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2518
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define WS_HSCROLL
Definition: pedump.c:628
#define SWP_FRAMECHANGED
Definition: winuser.h:1230
#define SB_BOTH
Definition: winuser.h:555
#define SWP_NOSIZE
Definition: winuser.h:1235
#define WS_VSCROLL
Definition: pedump.c:627
ULONG FASTCALL IntSetStyle(PWND pwnd, ULONG set_bits, ULONG clear_bits)
Definition: window.c:147
unsigned int ULONG
Definition: retypes.h:1
#define SWP_NOMOVE
Definition: winuser.h:1234
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28

Referenced by co_IntSetScrollInfo(), co_UserCreateWindowEx(), and NtUserShowScrollBar().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserScrollbar  )

◆ IntCalculateThumb()

BOOL FASTCALL IntCalculateThumb ( PWND  Wnd,
LONG  idObject,
PSCROLLBARINFO  psbi,
PSBDATA  pSBData 
)

Definition at line 172 of file scrollbar.c.

173 {
174  INT Thumb, ThumbBox, ThumbPos, cxy, mx;
175  RECTL ClientRect;
176 
177  switch(idObject)
178  {
179  case SB_HORZ:
181  cxy = psbi->rcScrollBar.right - psbi->rcScrollBar.left;
182  break;
183  case SB_VERT:
185  cxy = psbi->rcScrollBar.bottom - psbi->rcScrollBar.top;
186  break;
187  case SB_CTL:
188  IntGetClientRect(Wnd, &ClientRect);
189  if(Wnd->style & SBS_VERT)
190  {
192  cxy = ClientRect.bottom - ClientRect.top;
193  }
194  else
195  {
197  cxy = ClientRect.right - ClientRect.left;
198  }
199  break;
200  default:
201  return FALSE;
202  }
203 
204  ThumbPos = Thumb;
205  /* Calculate Thumb */
206  if(cxy <= (2 * Thumb))
207  {
208  Thumb = cxy / 2;
209  psbi->xyThumbTop = 0;
210  psbi->xyThumbBottom = 0;
211  ThumbPos = Thumb;
212  }
215  pSBData->posMin >= (int)(pSBData->posMax - max(pSBData->page - 1, 0)))
216  {
217  /* Nothing to scroll */
218  psbi->xyThumbTop = 0;
219  psbi->xyThumbBottom = 0;
220  }
221  else
222  {
223  ThumbBox = pSBData->page ? MINTRACKTHUMB : UserGetSystemMetrics(SM_CXHTHUMB);
224  cxy -= (2 * Thumb);
225  if(cxy >= ThumbBox)
226  {
227  if(pSBData->page)
228  {
229  ThumbBox = max(EngMulDiv(cxy, pSBData->page, pSBData->posMax - pSBData->posMin + 1), ThumbBox);
230  }
231 
232  if(cxy > ThumbBox)
233  {
234  mx = pSBData->posMax - max(pSBData->page - 1, 0);
235  if(pSBData->posMin < mx)
236  ThumbPos = Thumb + EngMulDiv(cxy - ThumbBox, pSBData->pos - pSBData->posMin, mx - pSBData->posMin);
237  else
238  ThumbPos = Thumb + ThumbBox;
239  }
240 
241  psbi->xyThumbTop = ThumbPos;
242  psbi->xyThumbBottom = ThumbPos + ThumbBox;
243  }
244  else
245  {
246  psbi->xyThumbTop = 0;
247  psbi->xyThumbBottom = 0;
248  }
249  }
250  psbi->dxyLineButton = Thumb;
251 
252  return TRUE;
253 }
#define max(a, b)
Definition: svc.c:63
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2852
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
INT page
Definition: ntuser.h:502
#define SB_HORZ
Definition: winuser.h:552
#define SM_CYVSCROLL
Definition: winuser.h:975
LONG top
Definition: windef.h:307
long bottom
Definition: polytest.cpp:53
INT pos
Definition: ntuser.h:503
LONG left
Definition: windef.h:306
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:91
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
long top
Definition: polytest.cpp:53
#define SM_CXHTHUMB
Definition: winuser.h:965
#define MINTRACKTHUMB
Definition: scrollbar.c:39
long left
Definition: polytest.cpp:53
#define SBS_VERT
Definition: winuser.h:334
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
#define SM_CXHSCROLL
Definition: winuser.h:976
INT posMin
Definition: ntuser.h:500
ENGAPI INT APIENTRY EngMulDiv(_In_ INT a, _In_ INT b, _In_ INT c)
Definition: math.c:26
#define SBRG_TOPRIGHTBTN
Definition: scrollbar.c:48
#define SBRG_BOTTOMLEFTBTN
Definition: scrollbar.c:52
LONG bottom
Definition: windef.h:309
INT posMax
Definition: ntuser.h:501
DWORD style
Definition: ntuser.h:701

Referenced by co_IntCreateScrollBars(), and co_IntGetScrollBarInfo().

◆ IntDestroyScrollBars()

BOOL FASTCALL IntDestroyScrollBars ( PWND  Window)

Definition at line 898 of file scrollbar.c.

899 {
900  if (Window->pSBInfo && Window->pSBInfoex)
901  {
902  DesktopHeapFree(Window->head.rpdesk, Window->pSBInfo);
903  Window->pSBInfo = NULL;
905  Window->pSBInfoex = NULL;
906  return TRUE;
907  }
908  return FALSE;
909 }
#define TRUE
Definition: types.h:120
#define TAG_SBARINFO
Definition: tags.h:9
Definition: window.c:28
#define FALSE
Definition: types.h:117
#define NULL
Definition: types.h:112
static __inline BOOL DesktopHeapFree(IN PDESKTOP Desktop, IN PVOID lpMem)
Definition: desktop.h:215
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by co_UserFreeWindow().

◆ IntDrawScrollArrows()

static VOID FASTCALL IntDrawScrollArrows ( HDC  hDC,
PSCROLLBARINFO  ScrollBarInfo,
BOOL  Vertical 
)
static

Definition at line 1112 of file scrollbar.c.

1113 {
1114  RECT RectLT, RectRB;
1115  INT ScrollDirFlagLT, ScrollDirFlagRB;
1116 
1117  RectLT = RectRB = ScrollBarInfo->rcScrollBar;
1118  if (Vertical)
1119  {
1120  ScrollDirFlagLT = DFCS_SCROLLUP;
1121  ScrollDirFlagRB = DFCS_SCROLLDOWN;
1122  RectLT.bottom = RectLT.top + ScrollBarInfo->dxyLineButton;
1123  RectRB.top = RectRB.bottom - ScrollBarInfo->dxyLineButton;
1124  }
1125  else
1126  {
1127  ScrollDirFlagLT = DFCS_SCROLLLEFT;
1128  ScrollDirFlagRB = DFCS_SCROLLRIGHT;
1129  RectLT.right = RectLT.left + ScrollBarInfo->dxyLineButton;
1130  RectRB.left = RectRB.right - ScrollBarInfo->dxyLineButton;
1131  }
1132 
1133  if (ScrollBarInfo->rgstate[SCROLL_TOP_ARROW] & STATE_SYSTEM_PRESSED)
1134  {
1135  ScrollDirFlagLT |= DFCS_PUSHED | DFCS_FLAT;
1136  }
1137  if (ScrollBarInfo->rgstate[SCROLL_TOP_ARROW] & STATE_SYSTEM_UNAVAILABLE)
1138  {
1139  ScrollDirFlagLT |= DFCS_INACTIVE;
1140  }
1141  if (ScrollBarInfo->rgstate[SCROLL_BOTTOM_ARROW] & STATE_SYSTEM_PRESSED)
1142  {
1143  ScrollDirFlagRB |= DFCS_PUSHED | DFCS_FLAT;
1144  }
1146  {
1147  ScrollDirFlagRB |= DFCS_INACTIVE;
1148  }
1149 
1150  DrawFrameControl(hDC, &RectLT, DFC_SCROLL, ScrollDirFlagLT);
1151  DrawFrameControl(hDC, &RectRB, DFC_SCROLL, ScrollDirFlagRB);
1152 }
#define DFCS_FLAT
Definition: winuser.h:510
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2852
#define DFCS_INACTIVE
Definition: winuser.h:502
LONG top
Definition: windef.h:307
#define SCROLL_BOTTOM_ARROW
Definition: scrollbar.c:19
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
LONG left
Definition: windef.h:306
#define SCROLL_TOP_ARROW
Definition: scrollbar.c:15
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
#define DFCS_PUSHED
Definition: winuser.h:503
#define STATE_SYSTEM_PRESSED
Definition: winuser.h:2855
#define DFCS_SCROLLDOWN
Definition: winuser.h:490
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
#define DFCS_SCROLLRIGHT
Definition: winuser.h:492
#define DFCS_SCROLLUP
Definition: winuser.h:489
static HDC hDC
Definition: 3dtext.c:33
#define DFC_SCROLL
Definition: winuser.h:475
LONG bottom
Definition: windef.h:309
#define DFCS_SCROLLLEFT
Definition: winuser.h:491

Referenced by IntDrawScrollBar().

◆ IntDrawScrollBar()

void IntDrawScrollBar ( PWND  Wnd,
HDC  DC,
INT  Bar 
)

Definition at line 1180 of file scrollbar.c.

1181 {
1182  //PSBWND pSBWnd;
1183  //INT ThumbSize;
1184  PTHREADINFO pti;
1186  BOOL Vertical;
1187 
1189 
1190  /*
1191  * Get scroll bar info.
1192  */
1193  switch (Bar)
1194  {
1195  case SB_HORZ:
1196  Vertical = FALSE;
1197  break;
1198 
1199  case SB_VERT:
1200  Vertical = TRUE;
1201  break;
1202 
1203  case SB_CTL:
1204  Vertical = (Wnd->style & SBS_VERT) != 0;
1205  break;
1206 
1207  default:
1208  return;
1209  }
1210 
1212  {
1213  return;
1214  }
1215 
1216  if (RECTL_bIsEmptyRect(&Info.rcScrollBar))
1217  {
1218  return;
1219  }
1220 
1221  //ThumbSize = pSBWnd->pSBCalc->pxThumbBottom - pSBWnd->pSBCalc->pxThumbTop;
1222 
1223  /*
1224  * Draw the arrows.
1225  */
1226  if (Info.dxyLineButton)
1227  {
1228  IntDrawScrollArrows(DC, &Info, Vertical);
1229  }
1230 
1231  /*
1232  * Draw the interior.
1233  */
1234  IntDrawScrollInterior(Wnd, DC, Bar, Vertical, &Info);
1235 
1236  /*
1237  * If scroll bar has focus, reposition the caret.
1238  */
1239  if ( Wnd == pti->MessageQueue->spwndFocus && Bar == SB_CTL )
1240  {
1241  if (Vertical)
1242  {
1243  co_IntSetCaretPos(Info.rcScrollBar.top + 1, Info.dxyLineButton + 1);
1244  }
1245  else
1246  {
1247  co_IntSetCaretPos(Info.dxyLineButton + 1, Info.rcScrollBar.top + 1);
1248  }
1249  }
1250 }
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:760
static void IntDrawScrollInterior(PWND pWnd, HDC hDC, INT nBar, BOOL Vertical, PSCROLLBARINFO ScrollBarInfo)
Definition: scrollbar.c:997
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define SB_HORZ
Definition: winuser.h:552
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
void Bar(void)
Definition: terminate.cpp:70
static LONG FASTCALL IntScrollGetObjectId(INT SBType)
Definition: scrollbar.c:1155
#define SBS_VERT
Definition: winuser.h:334
Definition: polytest.cpp:40
BOOL FASTCALL co_IntSetCaretPos(int X, int Y)
Definition: caret.c:193
static VOID FASTCALL IntDrawScrollArrows(HDC hDC, PSCROLLBARINFO ScrollBarInfo, BOOL Vertical)
Definition: scrollbar.c:1112
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:89
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
DWORD style
Definition: ntuser.h:701

Referenced by NC_DoNCPaint(), SCROLL_RefreshScrollBar(), and ScrollBarWndProc_common().

◆ IntDrawScrollInterior()

static void IntDrawScrollInterior ( PWND  pWnd,
HDC  hDC,
INT  nBar,
BOOL  Vertical,
PSCROLLBARINFO  ScrollBarInfo 
)
static

Definition at line 997 of file scrollbar.c.

998 {
999  INT ThumbSize = ScrollBarInfo->xyThumbBottom - ScrollBarInfo->xyThumbTop;
1000  INT ThumbTop = ScrollBarInfo->xyThumbTop;
1001  RECT Rect;
1002  HBRUSH hSaveBrush, hBrush;
1003  BOOL TopSelected = FALSE, BottomSelected = FALSE;
1004 
1005  if (ScrollBarInfo->rgstate[SCROLL_TOP_RECT] & STATE_SYSTEM_PRESSED)
1006  TopSelected = TRUE;
1007  if (ScrollBarInfo->rgstate[SCROLL_BOTTOM_RECT] & STATE_SYSTEM_PRESSED)
1008  BottomSelected = TRUE;
1009 
1010  /*
1011  * Only scrollbar controls send WM_CTLCOLORSCROLLBAR.
1012  * The window-owned scrollbars need to call DefWndControlColor
1013  * to correctly setup default scrollbar colors
1014  */
1015  if (nBar == SB_CTL)
1016  {
1017  hBrush = GetControlBrush( pWnd, hDC, WM_CTLCOLORSCROLLBAR);
1018  if (!hBrush)
1020  }
1021  else
1022  {
1024  }
1025 
1026  hSaveBrush = NtGdiSelectBrush(hDC, hBrush);
1027 
1028  /* Calculate the scroll rectangle */
1029  if (Vertical)
1030  {
1031  Rect.top = ScrollBarInfo->rcScrollBar.top + ScrollBarInfo->dxyLineButton;
1032  Rect.bottom = ScrollBarInfo->rcScrollBar.bottom - ScrollBarInfo->dxyLineButton;
1033  Rect.left = ScrollBarInfo->rcScrollBar.left;
1034  Rect.right = ScrollBarInfo->rcScrollBar.right;
1035  }
1036  else
1037  {
1038  Rect.top = ScrollBarInfo->rcScrollBar.top;
1039  Rect.bottom = ScrollBarInfo->rcScrollBar.bottom;
1040  Rect.left = ScrollBarInfo->rcScrollBar.left + ScrollBarInfo->dxyLineButton;
1041  Rect.right = ScrollBarInfo->rcScrollBar.right - ScrollBarInfo->dxyLineButton;
1042  }
1043 
1044  /* Draw the scroll rectangles and thumb */
1045  if (!ScrollBarInfo->xyThumbBottom)
1046  {
1047  NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right - Rect.left,
1048  Rect.bottom - Rect.top, PATCOPY);
1049 
1050  /* Cleanup and return */
1051  NtGdiSelectBrush(hDC, hSaveBrush);
1052  return;
1053  }
1054 
1055  ThumbTop -= ScrollBarInfo->dxyLineButton;
1056 
1057  if (ScrollBarInfo->dxyLineButton)
1058  {
1059  if (Vertical)
1060  {
1061  if (ThumbSize)
1062  {
1063  NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right - Rect.left,
1064  ThumbTop, TopSelected ? BLACKNESS : PATCOPY);
1065  Rect.top += ThumbTop;
1066  NtGdiPatBlt(hDC, Rect.left, Rect.top + ThumbSize, Rect.right - Rect.left,
1067  Rect.bottom - Rect.top - ThumbSize, BottomSelected ? BLACKNESS : PATCOPY);
1068  Rect.bottom = Rect.top + ThumbSize;
1069  }
1070  else
1071  {
1072  if (ThumbTop)
1073  {
1074  NtGdiPatBlt(hDC, Rect.left, ScrollBarInfo->dxyLineButton,
1075  Rect.right - Rect.left, Rect.bottom - Rect.top, PATCOPY);
1076  }
1077  }
1078  }
1079  else
1080  {
1081  if (ThumbSize)
1082  {
1083  NtGdiPatBlt(hDC, Rect.left, Rect.top, ThumbTop,
1084  Rect.bottom - Rect.top, TopSelected ? BLACKNESS : PATCOPY);
1085  Rect.left += ThumbTop;
1086  NtGdiPatBlt(hDC, Rect.left + ThumbSize, Rect.top,
1087  Rect.right - Rect.left - ThumbSize, Rect.bottom - Rect.top,
1088  BottomSelected ? BLACKNESS : PATCOPY);
1089  Rect.right = Rect.left + ThumbSize;
1090  }
1091  else
1092  {
1093  if (ThumbTop)
1094  {
1095  NtGdiPatBlt(hDC, ScrollBarInfo->dxyLineButton, Rect.top,
1096  Rect.right - Rect.left, Rect.bottom - Rect.top, PATCOPY);
1097  }
1098  }
1099  }
1100  }
1101 
1102  /* Draw the thumb */
1103  if (ThumbSize)
1105 
1106  /* Cleanup */
1107  NtGdiSelectBrush(hDC, hSaveBrush);
1108 }
#define BF_MIDDLE
Definition: winuser.h:468
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
Definition: bitblt.c:984
HGDIOBJ FASTCALL IntGetSysColorBrush(INT Object)
Definition: stockobj.c:317
#define SB_CTL
Definition: winuser.h:554
#define TRUE
Definition: types.h:120
#define SCROLL_BOTTOM_RECT
Definition: scrollbar.c:18
LONG top
Definition: windef.h:307
#define CTLCOLOR_SCROLLBAR
Definition: winuser.h:950
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
__kernel_entry W32KAPI HBRUSH APIENTRY NtGdiSelectBrush(_In_ HDC hdc, _In_ HBRUSH hbrush)
#define BF_RECT
Definition: winuser.h:462
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define COLOR_SCROLLBAR
Definition: winuser.h:906
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1761
#define STATE_SYSTEM_PRESSED
Definition: winuser.h:2855
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
HBRUSH DefWndControlColor(HDC hDC, UINT ctlType)
Definition: defwnd.c:33
#define PATCOPY
Definition: wingdi.h:335
#define EDGE_RAISED
Definition: winuser.h:450
static HDC hDC
Definition: 3dtext.c:33
#define BLACKNESS
Definition: wingdi.h:323
LONG bottom
Definition: windef.h:309
HBRUSH FASTCALL GetControlBrush(PWND pwnd, HDC hdc, UINT ctlType)
Definition: misc.c:172
#define SCROLL_TOP_RECT
Definition: scrollbar.c:16
struct Rect Rect

Referenced by IntDrawScrollBar(), and IntRefeshScrollInterior().

◆ IntEnableScrollBar()

BOOL APIENTRY IntEnableScrollBar ( BOOL  Horz,
PSCROLLBARINFO  Info,
UINT  wArrows 
)

Definition at line 912 of file scrollbar.c.

913 {
914  BOOL Chg = FALSE;
915  switch(wArrows)
916  {
917  case ESB_DISABLE_BOTH:
920  break;
921  case ESB_DISABLE_RTDN:
922  if(Horz)
923  {
925  }
926  else
927  {
929  }
930  break;
931  case ESB_DISABLE_LTUP:
932  if(Horz)
933  {
935  }
936  else
937  {
939  }
940  break;
941  case ESB_ENABLE_BOTH:
944  break;
945  }
946  return Chg;
947 }
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2852
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define ESB_DISABLE_RTDN
Definition: winuser.h:561
#define CHANGERGSTATE(item, status)
Definition: scrollbar.c:54
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ESB_DISABLE_LTUP
Definition: winuser.h:559
#define SBRG_TOPRIGHTBTN
Definition: scrollbar.c:48
#define SBRG_BOTTOMLEFTBTN
Definition: scrollbar.c:52
#define ESB_ENABLE_BOTH
Definition: winuser.h:563

Referenced by co_IntSetScrollInfo(), and NtUserEnableScrollBar().

◆ IntGetSBData()

PSBDATA FASTCALL IntGetSBData ( PWND  pwnd,
INT  Bar 
)

Definition at line 83 of file scrollbar.c.

84 {
85  PSBWND pSBWnd;
86  PSBINFO pSBInfo;
87 
88  pSBInfo = pwnd->pSBInfo;
89  switch (Bar)
90  {
91  case SB_HORZ:
92  return &pSBInfo->Horz;
93  case SB_VERT:
94  return &pSBInfo->Vert;
95  case SB_CTL:
96  if ( pwnd->cbwndExtra < (sizeof(SBWND)-sizeof(WND)) )
97  {
98  ERR("IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
99  return 0;
100  }
101  pSBWnd = (PSBWND)pwnd;
102  return (PSBDATA)&pSBWnd->SBCalc;
103  default:
104  ERR("IntGetSBData Bad Bar!\n");
105  }
106  return NULL;
107 }
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
SBDATA Vert
Definition: ntuser.h:510
#define SB_HORZ
Definition: winuser.h:552
PSBINFO pSBInfo
Definition: ntuser.h:721
SBCALC SBCalc
Definition: ntuser.h:771
ULONG cbwndExtra
Definition: ntuser.h:733
void Bar(void)
Definition: terminate.cpp:70
struct _SBWND * PSBWND
Definition: ntuser.h:766
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
SBDATA Horz
Definition: ntuser.h:509
#define NULL
Definition: types.h:112

Referenced by co_IntCreateScrollBars(), co_IntGetScrollBarInfo(), co_IntSetScrollInfo(), GetScrollPos(), GetScrollRange(), IntScrollGetThumbVal(), and RealGetScrollInfo().

◆ IntGetScrollBarRect()

BOOL FASTCALL IntGetScrollBarRect ( PWND  Wnd,
INT  nBar,
RECTL lprect 
)

Definition at line 110 of file scrollbar.c.

111 {
112  BOOL vertical;
113  *lprect = Wnd->rcClient;
114 
115  RECTL_vOffsetRect( lprect, -Wnd->rcWindow.left, -Wnd->rcWindow.top );
116  if (Wnd->ExStyle & WS_EX_LAYOUTRTL)
117  mirror_rect( &Wnd->rcWindow, lprect );
118 
119  switch (nBar)
120  {
121  case SB_HORZ:
122  lprect->top = lprect->bottom;
124  if (Wnd->style & WS_BORDER)
125  {
126  lprect->left--;
127  lprect->right++;
128  }
129  else if (Wnd->style & WS_VSCROLL)
130  {
131  lprect->right++;
132  }
133  vertical = FALSE;
134  break;
135 
136  case SB_VERT:
137  if(Wnd->ExStyle & WS_EX_LEFTSCROLLBAR)
138  {
139  lprect->right = lprect->left;
141  }
142  else
143  {
144  lprect->left = lprect->right;
146  }
147  if (Wnd->style & WS_BORDER)
148  {
149  lprect->top--;
150  lprect->bottom++;
151  }
152  else if (Wnd->style & WS_HSCROLL)
153  {
154  lprect->bottom++;
155  }
156  vertical = TRUE;
157  break;
158 
159  case SB_CTL:
160  IntGetClientRect (Wnd, lprect);
161  vertical = !!(Wnd->style & SBS_VERT);
162  break;
163 
164  default:
165  return FALSE;
166  }
167 
168  return vertical;
169 }
DWORD ExStyle
Definition: ntuser.h:699
#define SM_CYHSCROLL
Definition: winuser.h:956
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define SB_HORZ
Definition: winuser.h:552
LONG top
Definition: windef.h:307
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
long bottom
Definition: polytest.cpp:53
RECT rcClient
Definition: ntuser.h:712
LONG left
Definition: windef.h:306
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:91
#define WS_EX_LEFTSCROLLBAR
Definition: winuser.h:392
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
#define SBS_VERT
Definition: winuser.h:334
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:208
static void mirror_rect(const RECT *window_rect, RECT *rect)
Definition: scrollbar.c:74
#define WS_HSCROLL
Definition: pedump.c:628
RECT rcWindow
Definition: ntuser.h:711
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
Definition: rect.h:31
#define WS_BORDER
Definition: pedump.c:625
#define WS_VSCROLL
Definition: pedump.c:627
#define SM_CXVSCROLL
Definition: winuser.h:955
DWORD style
Definition: ntuser.h:701

Referenced by co_IntCreateScrollBars(), and co_IntGetScrollBarInfo().

◆ IntRefeshScrollInterior()

static void IntRefeshScrollInterior ( PWND  pWnd,
INT  nBar,
PSCROLLBARINFO  psbi 
)
static

Definition at line 1165 of file scrollbar.c.

1166 {
1167  HDC hdc;
1168  BOOL Vertical = ((nBar == SB_CTL) ? ((pWnd->style & SBS_VERT) != 0) : (nBar == SB_VERT));
1169 
1170  hdc = UserGetDCEx(pWnd, NULL, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
1171  if (hdc)
1172  { /* Get updated info. */
1173  co_IntGetScrollBarInfo(pWnd, IntScrollGetObjectId(nBar), psbi);
1174  IntDrawScrollInterior(pWnd, hdc, nBar, Vertical, psbi);
1175  UserReleaseDC(pWnd, hdc, FALSE);
1176  }
1177 }
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:760
static void IntDrawScrollInterior(PWND pWnd, HDC hDC, INT nBar, BOOL Vertical, PSCROLLBARINFO ScrollBarInfo)
Definition: scrollbar.c:997
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
static HDC
Definition: imagelist.c:92
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
#define DCX_WINDOW
Definition: winuser.h:2103
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static LONG FASTCALL IntScrollGetObjectId(INT SBType)
Definition: scrollbar.c:1155
#define SBS_VERT
Definition: winuser.h:334
HDC hdc
Definition: main.c:9
#define DCX_CACHE
Definition: winuser.h:2104
#define NULL
Definition: types.h:112
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
DWORD style
Definition: ntuser.h:701

Referenced by co_IntSetScrollInfo().

◆ IntScrollGetObjectId()

static LONG FASTCALL IntScrollGetObjectId ( INT  SBType)
static

Definition at line 1155 of file scrollbar.c.

1156 {
1157  if (SBType == SB_VERT)
1158  return OBJID_VSCROLL;
1159  if (SBType == SB_HORZ)
1160  return OBJID_HSCROLL;
1161  return OBJID_CLIENT;
1162 }
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
#define OBJID_CLIENT
Definition: winable.h:19
#define OBJID_HSCROLL
Definition: winable.h:21
#define OBJID_VSCROLL
Definition: winable.h:20

Referenced by IntDrawScrollBar(), and IntRefeshScrollInterior().

◆ mirror_rect()

static void mirror_rect ( const RECT window_rect,
RECT rect 
)
inlinestatic

Definition at line 74 of file scrollbar.c.

75 {
76  int width = window_rect->right - window_rect->left;
77  int tmp = rect->left;
78  rect->left = width - rect->right;
79  rect->right = width - tmp;
80 }
GLint GLint GLsizei width
Definition: gl.h:1546
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
& rect
Definition: startmenu.cpp:1413

Referenced by IntGetScrollBarRect(), and IntScrollGetScrollBarRect().

◆ NEWco_IntGetScrollInfo()

BOOL FASTCALL NEWco_IntGetScrollInfo ( PWND  pWnd,
INT  nBar,
PSBDATA  pSBData,
LPSCROLLINFO  lpsi 
)

Definition at line 329 of file scrollbar.c.

334 {
335  UINT Mask;
336  PSBTRACK pSBTrack = pWnd->head.pti->pSBTrack;
337 
338  lpsi->fMask &= ~SIF_THEMED; // Remove Theme bit
339  if (!SBID_IS_VALID(nBar))
340  {
342  ERR("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar);
343  return FALSE;
344  }
345 
346  if (!pWnd->pSBInfo || !pSBTrack) return FALSE;
347 
348  Mask = lpsi->fMask;
349 
350  if (0 != (Mask & SIF_PAGE))
351  {
352  lpsi->nPage = pSBData->page;
353  }
354 
355  if (0 != (Mask & SIF_POS))
356  {
357  lpsi->nPos = pSBData->pos;
358  }
359 
360  if (0 != (Mask & SIF_RANGE))
361  {
362  lpsi->nMin = pSBData->posMin;
363  lpsi->nMax = pSBData->posMax;
364  }
365 
366  if (0 != (Mask & SIF_TRACKPOS))
367  {
368  if ( pSBTrack &&
369  pSBTrack->nBar == nBar &&
370  pSBTrack->spwndTrack == pWnd )
371  lpsi->nTrackPos = pSBTrack->posNew;
372  else
373  lpsi->nTrackPos = pSBData->pos;
374  }
375  return (Mask & SIF_ALL) !=0;
376 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SIF_RANGE
Definition: winuser.h:1225
INT page
Definition: ntuser.h:502
#define SIF_THEMED
Definition: winuser.h:1228
INT pos
Definition: ntuser.h:503
PSBINFO pSBInfo
Definition: ntuser.h:721
#define SIF_PAGE
Definition: winuser.h:1223
#define FALSE
Definition: types.h:117
INT posNew
Definition: scroll.h:21
THRDESKHEAD head
Definition: ntuser.h:690
unsigned int Mask
Definition: fpcontrol.c:82
PWND spwndTrack
Definition: scroll.h:11
INT posMin
Definition: ntuser.h:500
#define SIF_POS
Definition: winuser.h:1224
#define ERR(fmt,...)
Definition: debug.h:110
#define SIF_TRACKPOS
Definition: winuser.h:1227
unsigned int UINT
Definition: ndis.h:50
#define SBID_IS_VALID(id)
Definition: scroll.h:40
INT nBar
Definition: scroll.h:22
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
INT posMax
Definition: ntuser.h:501
#define SIF_ALL
Definition: winuser.h:1222

◆ NtUserEnableScrollBar()

BOOL APIENTRY NtUserEnableScrollBar ( HWND  hWnd,
UINT  wSBflags,
UINT  wArrows 
)

Definition at line 1389 of file scrollbar.c.

1393 {
1394  UINT OrigArrows;
1395  PWND Window = NULL;
1396  PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
1397  BOOL Chg = FALSE;
1400 
1401  TRACE("Enter NtUserEnableScrollBar\n");
1403 
1404  if (!(Window = UserGetWindowObject(hWnd)) ||
1406  {
1407  RETURN(FALSE);
1408  }
1409  UserRefObjectCo(Window, &Ref);
1410 
1412  {
1413  RETURN( FALSE);
1414  }
1415 
1416  OrigArrows = Window->pSBInfo->WSBflags;
1417  Window->pSBInfo->WSBflags = wArrows;
1418 
1419  if (wSBflags == SB_CTL)
1420  {
1421  if ((wArrows == ESB_DISABLE_BOTH || wArrows == ESB_ENABLE_BOTH))
1422  IntEnableWindow(hWnd, (wArrows == ESB_ENABLE_BOTH));
1423 
1424  RETURN(TRUE);
1425  }
1426 
1427  if(wSBflags != SB_BOTH && !SBID_IS_VALID(wSBflags))
1428  {
1430  ERR("Trying to set scrollinfo for unknown scrollbar type %u\n", wSBflags);
1431  RETURN(FALSE);
1432  }
1433 
1434  switch(wSBflags)
1435  {
1436  case SB_BOTH:
1438  /* Fall through */
1439  case SB_HORZ:
1441  break;
1442  case SB_VERT:
1444  break;
1445  default:
1446  RETURN(FALSE);
1447  }
1448 
1449  if(InfoV)
1450  Chg = IntEnableScrollBar(FALSE, InfoV, wArrows);
1451 
1452  if(InfoH)
1453  Chg = (IntEnableScrollBar(TRUE, InfoH, wArrows) || Chg);
1454 
1455  ERR("FIXME: EnableScrollBar wSBflags %u wArrows %u Chg %d\n", wSBflags, wArrows, Chg);
1456 // Done in user32:
1457 // SCROLL_RefreshScrollBar( hwnd, nBar, TRUE, TRUE );
1458 
1459  RETURN( Chg);
1460  if (OrigArrows == wArrows) RETURN( FALSE);
1461  RETURN( TRUE);
1462 
1463 CLEANUP:
1464  if (Window)
1466 
1467  TRACE("Leave NtUserEnableScrollBar, ret=%i\n",_ret_);
1468  UserLeave();
1469  END_CLEANUP;
1470 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CLEANUP
Definition: ntuser.h:5
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
#define SB_CTL
Definition: winuser.h:554
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define SB_HORZ
Definition: winuser.h:552
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define RETURN(x)
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:842
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define TRACE(s)
Definition: solgame.cpp:4
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
#define UserIsMessageWindow(pWnd)
Definition: desktop.h:197
#define SB_BOTH
Definition: winuser.h:555
BOOL FASTCALL IntEnableWindow(HWND hWnd, BOOL bEnable)
Definition: window.c:224
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
BOOL APIENTRY IntEnableScrollBar(BOOL Horz, PSCROLLBARINFO Info, UINT wArrows)
Definition: scrollbar.c:912
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define ESB_ENABLE_BOTH
Definition: winuser.h:563
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by EnableScrollBar(), and ResetUserApiHook().

◆ NtUserGetScrollBarInfo()

BOOL APIENTRY NtUserGetScrollBarInfo ( HWND  hWnd,
LONG  idObject,
PSCROLLBARINFO  psbi 
)

Definition at line 1279 of file scrollbar.c.

1280 {
1281  NTSTATUS Status;
1282  SCROLLBARINFO sbi;
1283  PWND Window;
1284  BOOL Ret;
1287 
1288  TRACE("Enter NtUserGetScrollBarInfo\n");
1290 
1291  Status = MmCopyFromCaller(&sbi, psbi, sizeof(SCROLLBARINFO));
1292  if(!NT_SUCCESS(Status) || (sbi.cbSize != sizeof(SCROLLBARINFO)))
1293  {
1295  RETURN(FALSE);
1296  }
1297 
1298  if(!(Window = UserGetWindowObject(hWnd)))
1299  {
1300  RETURN(FALSE);
1301  }
1302 
1303  UserRefObjectCo(Window, &Ref);
1304  Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi);
1306 
1307  Status = MmCopyToCaller(psbi, &sbi, sizeof(SCROLLBARINFO));
1308  if(!NT_SUCCESS(Status))
1309  {
1311  Ret = FALSE;
1312  }
1313 
1314  RETURN( Ret);
1315 
1316 CLEANUP:
1317  TRACE("Leave NtUserGetScrollBarInfo, ret=%i\n",_ret_);
1318  UserLeave();
1319  END_CLEANUP;
1320 
1321 }
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:760
#define CLEANUP
Definition: ntuser.h:5
LONG NTSTATUS
Definition: precomp.h:26
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define MmCopyFromCaller
Definition: polytest.cpp:29
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
#define RETURN(x)
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
int Window
Definition: x11stubs.h:26
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by GetScrollBarInfo(), IntGetScrollBarInfo(), and ScrollBarWndProc_common().

◆ NtUserSBGetParms()

BOOL APIENTRY NtUserSBGetParms ( HWND  hWnd,
int  fnBar,
PSBDATA  pSBData,
LPSCROLLINFO  lpsi 
)

Definition at line 1325 of file scrollbar.c.

1330 {
1331  PWND Window;
1332  SCROLLINFO psi;
1333  BOOL Ret;
1334  SBDATA SBDataSafe;
1337 
1338  TRACE("Enter NtUserGetScrollInfo\n");
1339  UserEnterShared();
1340 
1341  _SEH2_TRY
1342  {
1343  RtlCopyMemory(&psi, lpsi, sizeof(SCROLLINFO));
1344  if (pSBData)
1345  {
1346  RtlCopyMemory(&SBDataSafe, pSBData, sizeof(SBDATA));
1347  }
1348  }
1350  {
1351  ERR("NtUserGetScrollInfo Failed size.\n");
1354  }
1355  _SEH2_END
1356 
1357  if(!(Window = UserGetWindowObject(hWnd)))
1358  {
1359  ERR("NtUserGetScrollInfo Bad window.\n");
1360  RETURN(FALSE);
1361  }
1362 
1363  UserRefObjectCo(Window, &Ref);
1364  Ret = co_IntGetScrollInfo(Window, fnBar, &SBDataSafe, &psi);
1366 
1367  _SEH2_TRY
1368  {
1369  RtlCopyMemory(lpsi, &psi, sizeof(SCROLLINFO));
1370  }
1372  {
1373  ERR("NtUserGetScrollInfo Failed copy to user.\n");
1376  }
1377  _SEH2_END
1378 
1379  RETURN( Ret);
1380 
1381 CLEANUP:
1382  TRACE("Leave NtUserGetScrollInfo, ret=%i\n",_ret_);
1383  UserLeave();
1384  END_CLEANUP;
1385 }
_SEH2_TRY
Definition: create.c:4226
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:238
#define CLEANUP
Definition: ntuser.h:5
static BOOL FASTCALL co_IntGetScrollInfo(PWND Window, INT nBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
Definition: scrollbar.c:272
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
_SEH2_END
Definition: create.c:4400
#define RETURN(x)
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
int Window
Definition: x11stubs.h:26
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by RealGetScrollInfo(), and ScrollBarWndProc_common().

◆ NtUserSetScrollBarInfo()

BOOL APIENTRY NtUserSetScrollBarInfo ( HWND  hWnd,
LONG  idObject,
SETSCROLLBARINFO info 
)

Definition at line 1550 of file scrollbar.c.

1554 {
1555  PWND Window = NULL;
1556  SETSCROLLBARINFO Safeinfo;
1557  PSCROLLBARINFO sbi;
1558  LPSCROLLINFO psi;
1559  NTSTATUS Status;
1560  LONG Obj;
1563 
1564  TRACE("Enter NtUserSetScrollBarInfo\n");
1566 
1567  if(!(Window = UserGetWindowObject(hWnd)))
1568  {
1569  RETURN( FALSE);
1570  }
1571  UserRefObjectCo(Window, &Ref);
1572 
1573  Obj = SBOBJ_TO_SBID(idObject);
1574  if(!SBID_IS_VALID(Obj))
1575  {
1577  ERR("Trying to set scrollinfo for unknown scrollbar type %d\n", Obj);
1578  RETURN( FALSE);
1579  }
1580 
1582  {
1583  RETURN(FALSE);
1584  }
1585 
1586  Status = MmCopyFromCaller(&Safeinfo, info, sizeof(SETSCROLLBARINFO));
1587  if(!NT_SUCCESS(Status))
1588  {
1590  RETURN(FALSE);
1591  }
1592 
1595 
1596  psi->nTrackPos = Safeinfo.nTrackPos;
1597  sbi->reserved = Safeinfo.reserved;
1598  RtlCopyMemory(&sbi->rgstate, &Safeinfo.rgstate, sizeof(Safeinfo.rgstate));
1599 
1600  RETURN(TRUE);
1601 
1602 CLEANUP:
1603  if (Window)
1605 
1606  TRACE("Leave NtUserSetScrollBarInfo, ret=%i\n",_ret_);
1607  UserLeave();
1608  END_CLEANUP;
1609 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CLEANUP
Definition: ntuser.h:5
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
HWND hWnd
Definition: settings.c:17
#define SBOBJ_TO_SBID(Obj)
Definition: scroll.h:39
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define MmCopyFromCaller
Definition: polytest.cpp:29
#define RETURN(x)
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: ntuser.h:3739
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:842
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3744
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
#define NULL
Definition: types.h:112
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by IntScrollHandleScrollEvent(), and IntUpdateScrollArrows().

◆ NtUserSetScrollInfo()

DWORD APIENTRY NtUserSetScrollInfo ( HWND  hWnd,
int  fnBar,
LPCSCROLLINFO  lpsi,
BOOL  bRedraw 
)

Definition at line 1474 of file scrollbar.c.

1479 {
1480  PWND Window = NULL;
1481  NTSTATUS Status;
1482  SCROLLINFO ScrollInfo;
1485 
1486  TRACE("Enter NtUserSetScrollInfo\n");
1488 
1489  if(!(Window = UserGetWindowObject(hWnd)) ||
1491  {
1492  RETURN( 0);
1493  }
1494  UserRefObjectCo(Window, &Ref);
1495 
1496  Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
1497  if(!NT_SUCCESS(Status))
1498  {
1500  RETURN( 0);
1501  }
1502 
1503  RETURN(co_IntSetScrollInfo(Window, fnBar, &ScrollInfo, bRedraw));
1504 
1505 CLEANUP:
1506  if (Window)
1508 
1509  TRACE("Leave NtUserSetScrollInfo, ret=%lu\n", _ret_);
1510  UserLeave();
1511  END_CLEANUP;
1512 
1513 }
static DWORD FASTCALL co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
Definition: scrollbar.c:479
#define CLEANUP
Definition: ntuser.h:5
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
LONG NTSTATUS
Definition: precomp.h:26
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define MmCopyFromCaller
Definition: polytest.cpp:29
#define RETURN(x)
Definition: window.c:28
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
#define UserIsMessageWindow(pWnd)
Definition: desktop.h:197
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
#define NULL
Definition: types.h:112
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by IntScrollCreateScrollBar(), IntSetScrollInfo(), and RealSetScrollInfo().

◆ NtUserShowScrollBar()

DWORD APIENTRY NtUserShowScrollBar ( HWND  hWnd,
int  nBar,
DWORD  bShow 
)

Definition at line 1516 of file scrollbar.c.

1517 {
1518  PWND Window;
1520  DWORD ret;
1522 
1523  TRACE("Enter NtUserShowScrollBar\n");
1525 
1526  if (!(Window = UserGetWindowObject(hWnd)))
1527  {
1528  RETURN(0);
1529  }
1530 
1531  UserRefObjectCo(Window, &Ref);
1532  ret = co_UserShowScrollBar(Window, nBar, (nBar == SB_VERT) ? 0 : bShow,
1533  (nBar == SB_HORZ) ? 0 : bShow);
1535 
1536  RETURN(ret);
1537 
1538 CLEANUP:
1539  TRACE("Leave NtUserShowScrollBar, ret%lu\n", _ret_);
1540  UserLeave();
1541  END_CLEANUP;
1542 
1543 }
#define CLEANUP
Definition: ntuser.h:5
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define RETURN(x)
Definition: window.c:28
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
int Window
Definition: x11stubs.h:26
int ret
Definition: ntuser.h:688
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:254
DWORD FASTCALL co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
Definition: scrollbar.c:951
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by ShowScrollBar().

◆ ScrollBarWndProc()

LRESULT APIENTRY ScrollBarWndProc ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1254 of file scrollbar.c.

1255 {
1256  LRESULT lResult = 0;
1257  PWND pWnd;
1258  pWnd = UserGetWindowObject(hWnd);
1259  if (!pWnd) return 0;
1260 
1261  switch(Msg)
1262  {
1263  case WM_ENABLE:
1264  {
1265  if (pWnd->pSBInfo)
1266  {
1268  }
1269  }
1270  break;
1271  }
1272  return lResult;
1273 }
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
HWND hWnd
Definition: settings.c:17
PSBINFO pSBInfo
Definition: ntuser.h:721
INT WSBflags
Definition: ntuser.h:508
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1605
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:126
Definition: ntuser.h:688
LONG_PTR LRESULT
Definition: windef.h:209
struct @1595 Msg[]
#define ESB_ENABLE_BOTH
Definition: winuser.h:563

Referenced by NtUserMessageCall().