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
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;
288 if (Pos < ScrollBarInfo->dxyLineButton)
290 else if (MaxSize <
Pos)
332 ScrollBarInfo->
rgstate[Arrow] &= ~STATE_SYSTEM_PRESSED;
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;
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 WINE_DEFAULT_DEBUG_CHANNEL(t)
#define ERROR_INVALID_PARAMETER
#define ValidateHwnd(hwnd)
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
struct tagSBDATA * PSBDATA
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
#define EXCEPTION_EXECUTE_HANDLER
#define memcpy(s1, s2, n)
unsigned __int3264 UINT_PTR
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
HBRUSH FASTCALL DefWndControlColor(HDC hDC, UINT ctlType)
#define _SEH2_EXCEPT(...)
#define DECLSPEC_HOTPATCH
GETSCROLLINFO GetScrollInfo
ENABLESCROLLBAR EnableScrollBar
SETSCROLLINFO SetScrollInfo
TW_UINT32 TW_UINT16 TW_UINT16 MSG
BOOL FASTCALL EndUserApiHook(VOID)
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
const char * SPY_GetMsgName(UINT msg, HWND hWnd)
static __inline void LoadUserApiHook()
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
HBRUSH FASTCALL GetControlBrush(PWND pwnd, HDC hdc, UINT ctlType)
#define ERROR_INVALID_SCROLLBAR_RANGE
#define ERROR_NO_SCROLLBARS
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define PFD_DOUBLEBUFFER_DONTCARE
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HWND WINAPI GetFocus(void)
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define STATE_SYSTEM_PRESSED
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define CTLCOLOR_SCROLLBAR
#define GetWindowLongPtrW
BOOL WINAPI ShowCaret(_In_opt_ HWND)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ReleaseCapture(void)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
struct tagSCROLLINFO SCROLLINFO
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SBM_ENABLE_ARROWS
#define DFCS_SCROLLSIZEGRIP
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
HWND WINAPI GetCapture(void)
#define WM_CTLCOLORSCROLLBAR
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
#define SBS_SIZEBOXTOPLEFTALIGN
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define CCHILDREN_SCROLLBAR
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SBM_SETRANGEREDRAW
#define STATE_SYSTEM_UNAVAILABLE
HWND WINAPI GetParent(_In_ HWND)
#define SBS_SIZEBOXBOTTOMRIGHTALIGN
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
struct tagSCROLLBARINFO SCROLLBARINFO
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define WS_EX_LEFTSCROLLBAR
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)
BOOL WINAPI DestroyCaret(void)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
VOID(CALLBACK * TIMERPROC)(HWND, UINT, UINT_PTR, DWORD)
BOOL WINAPI HideCaret(_In_opt_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
struct tagSCROLLBARINFO * PSCROLLBARINFO
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)