34 #define SCROLL_NOWHERE 0x00 35 #define SCROLL_TOP_ARROW 0x01 36 #define SCROLL_TOP_RECT 0x02 37 #define SCROLL_THUMB 0x03 38 #define SCROLL_BOTTOM_RECT 0x04 39 #define SCROLL_BOTTOM_ARROW 0x05 41 #define SCROLL_FIRST_DELAY 200 43 #define SCROLL_REPEAT_DELAY 50 45 #define SCROLL_TIMER 0 48 #define SCROLL_MIN_RECT 4 51 #define SCROLL_MIN_THUMB 6 54 #define SCROLL_ARROW_THUMB_OVERLAP 0 99 return &pSBInfo->
Horz;
101 return &pSBInfo->
Vert;
105 ERR(
"IntGetSBData Wrong Extra bytes for CTL Scrollbar!\n");
111 ERR(
"IntGetSBData Bad Bar!\n");
123 HBRUSH hSaveBrush, hBrush;
129 BottomSelected =
TRUE;
186 Rect.top += ThumbTop;
206 Rect.left += ThumbTop;
235 INT ScrollDirFlagLT, ScrollDirFlagRB;
290 else if (MaxSize <
Pos)
335 info->rgstate[Arrow] = ScrollBarInfo->
rgstate[Arrow];
384 if (
Info.dxyLineButton)
420 scrollbarWidth =
Rect->right -
Rect->left;
421 TempRect.
left -= scrollbarWidth*8;
422 TempRect.
right += scrollbarWidth*8;
423 TempRect.
top -= scrollbarWidth*2;
424 TempRect.
bottom += scrollbarWidth*2;
428 scrollbarWidth =
Rect->bottom -
Rect->top;
429 TempRect.
left -= scrollbarWidth*2;
430 TempRect.
right += scrollbarWidth*2;
431 TempRect.
top -= scrollbarWidth*8;
432 TempRect.
bottom += scrollbarWidth*8;
441 INT ArrowSize, ThumbSize, ThumbPos;
486 INT *ArrowSize,
INT *ThumbSize,
497 if (!pWnd)
return FALSE;
521 pSBData = &pSBInfo->
Horz;
546 pSBData = &pSBInfo->
Vert;
560 if (Vertical) Pixels =
Rect->bottom -
Rect->top;
561 else Pixels =
Rect->right -
Rect->left;
569 *ThumbPos = *ThumbSize = 0;
582 if (((Pixels -= *ThumbSize ) < 0) ||
586 *ThumbPos = *ThumbSize = 0;
619 if (!pWnd)
return FALSE;
638 if (
Pos > Pixels)
Pos = Pixels;
645 return pSBData->
posMin + ((
Pos + Pixels / 2) / Pixels);
659 if(
pt.y < lpRect->
top )
767 static UINT TrackThumbPos;
768 static INT LastClickPos;
770 static INT LastMousePos;
774 HWND WndOwner, WndCtl;
849 LastMousePos = LastClickPos;
888 TRACE(
"Event: hwnd=%p bar=%d msg=%s pt=%d,%d hit=%d\n",
1021 TRACE(
"Set Arrow\n");
1039 TrackThumbPos + LastMousePos - LastClickPos);
1053 TrackThumbPos + LastMousePos - LastClickPos);
1089 TRACE(
"hwnd=%p lpCreate=%p\n", Wnd, lpCreate);
1097 ERR(
"Created WS_DISABLED scrollbar\n");
1159 UINT XOffset = 0, YOffset = 0;
1219 #ifdef __REACTOS__ // Do this now, remove after Server side is fixed. 1229 TRACE(
"ScrollBar CTL size %d\n", (
sizeof(
SBWND)-
sizeof(
WND)));
1232 ERR(
"Wrong Extra bytes for Scrollbar!\n");
1246 ERR(
"Wrong window class for Scrollbar!\n");
1312 int ArrowSize, ThumbSize, ThumbPos, Vertical;
1315 &ArrowSize, &ThumbSize, &ThumbPos);
1333 int ArrowSize, ThumbSize, ThumbPos, Vertical;
1336 &ArrowSize, &ThumbSize, &ThumbPos);
1339 Rect.left = ThumbPos + 1;
1340 Rect.right =
Rect.left + ThumbSize;
1344 Rect.top = ThumbPos + 1;
1345 Rect.bottom =
Rect.top + ThumbSize;
1418 case SBM_SETSCROLLINFO:
1421 case SBM_GETSCROLLINFO:
1427 ERR(
"SBM_GETSCROLLINFO No ScrollInfo\n");
1431 case SBM_GETSCROLLBARINFO:
1442 WARN(
"unknown Win32 msg %04x wp=%08lx lp=%08lx\n",
1493 if (!Ret)
return Ret;
1503 ERR(
"Got exception in hooked EnableScrollBar!\n");
1524 if (!pWnd)
return FALSE;
1526 if (SBType < SB_HORZ || SBType >
SB_VERT)
1547 TRACE(
"hwnd=%p idObject=%d info=%p\n",
hwnd, idObject,
info);
1548 if (!pWnd)
return FALSE;
1578 ERR(
"Got exception in hooked GetScrollInfo!\n");
1598 TRACE(
"Wnd=%p Bar=%d\n", Wnd,
Bar);
1608 if (!pwnd)
return 0;
1613 return pSBData->
pos;
1617 TRACE(
"GetScrollPos No Scroll Info\n");
1635 TRACE(
"Wnd=%x Bar=%d Min=%p Max=%p\n", Wnd,
Bar, MinPos, MaxPos);
1645 if (!pwnd)
return FALSE;
1650 *MinPos = pSBData->
posMin;
1651 *MaxPos = pSBData->
posMax;
1702 ERR(
"Got exception in hooked SetScrollInfo!\n");
1724 ScrollInfo.
nPos = nPos;
1741 if ( !pWnd )
return FALSE;
1751 ScrollInfo.
nMin = nMinPos;
1752 ScrollInfo.
nMax = nMaxPos;
#define SBS_SIZEBOXTOPLEFTALIGN
#define ERROR_INVALID_PARAMETER
BOOL FASTCALL EndUserApiHook(VOID)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define STATE_SYSTEM_UNAVAILABLE
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
#define CCHILDREN_SCROLLBAR
#define CTLCOLOR_SCROLLBAR
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define ERROR_INVALID_SCROLLBAR_RANGE
#define GetWindowLongPtrW
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define WS_EX_LEFTSCROLLBAR
VOID(CALLBACK * TIMERPROC)(HWND, UINT, UINT_PTR, DWORD)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const char * SPY_GetMsgName(UINT msg, HWND hWnd)
struct tagSCROLLBARINFO * PSCROLLBARINFO
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI HideCaret(_In_opt_ HWND)
ENABLESCROLLBAR EnableScrollBar
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HWND WINAPI GetCapture(void)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_CTLCOLORSCROLLBAR
#define STATE_SYSTEM_PRESSED
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SBM_ENABLE_ARROWS
GETSCROLLINFO GetScrollInfo
#define DECLSPEC_HOTPATCH
struct tagSCROLLINFO SCROLLINFO
struct tagSBDATA * PSBDATA
#define PFD_DOUBLEBUFFER_DONTCARE
#define EXCEPTION_EXECUTE_HANDLER
#define DFCS_SCROLLSIZEGRIP
#define SBS_SIZEBOXBOTTOMRIGHTALIGN
#define ERROR_NO_SCROLLBARS
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
int WINAPI GetSystemMetrics(_In_ int)
unsigned __int3264 UINT_PTR
#define memcpy(s1, s2, n)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI DestroyCaret(void)
static __inline void LoadUserApiHook()
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct tagSCROLLBARINFO SCROLLBARINFO
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
HWND WINAPI GetFocus(void)
BOOL WINAPI ReleaseCapture(void)
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
BOOL WINAPI ShowCaret(_In_opt_ HWND)
#define _SEH2_EXCEPT(...)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
HBRUSH FASTCALL GetControlBrush(PWND pwnd, HDC hdc, UINT ctlType)
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)
SETSCROLLINFO SetScrollInfo
#define SBM_SETRANGEREDRAW
#define ValidateHwnd(hwnd)