The GetScrollPos function retrieves the current position of the scroll box (thumb) in the specified scroll bar. The current position is a relative value that depends on the current scrolling range. For example, if the scrolling range is 0 through 100 and the scroll box is in the middle of the bar, the current position is 50.
The GetScrollPos function is provided for backward compatibility. New applications should use the GetScrollInfo function.
int GetScrollPos(
HWND hWnd, |
// handle of window with scroll bar |
int nBar |
// scroll bar flags |
); |
Value |
Meaning |
SB_CTL |
Retrieves the position of the scroll box in a scroll bar control. The hWnd parameter must be the handle of the scroll bar control. |
SB_HORZ |
Retrieves the position of the scroll box in a window’s standard horizontal scroll bar. |
SB_VERT |
Retrieves the position of the scroll box in a window’s standard vertical scroll bar. |
If the function succeeds, the return value is the current position of the scroll box.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The GetScrollPos function enables applications to use 32-bit scroll positions. Although the messages that indicate scroll bar position, WM_HSCROLL and WM_VSCROLL, are limited to 16 bits of position data, the functions SetScrollPos, SetScrollRange, GetScrollPos, and GetScrollRange support 32-bit scroll bar position data. Thus, an application can call GetScrollPos while processing either the WM_HSCROLL or WM_VSCROLL messages to obtain 32-bit scroll bar position data.
To get the 32-bit position of the scroll box (thumb) during a SB_THUMBTRACK notification in a WM_HSCROLL or WM_VSCROLL message, use the GetScrollInfo function.
GetScrollInfo, GetScrollRange, SetScrollInfo, SetScrollPos, SetScrollRange, WM_HSCROLL, WM_VSCROLL
file: /Techref/os/win/api/win32/func/src/f38_8.htm, 4KB, , updated: 2000/4/7 11:19, local time: 2024/11/20 04:19,
3.144.3.181:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://ecomorder.com/techref/os/win/api/win32/func/src/f38_8.htm"> GetScrollPos</A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to ecomorder.com! |
.