术语 | getscrollpos |
释义 | GetScrollPos 语法: int GetScrollPos( HWND hWnd, int nBar ); GetScrollPos函数 该GetScrollPos函数检索滚动框(拇指在指定的滚动条)当前位置。当前位置是一个相对值,对当前滚动的范围而定。例如,如果滚动范围是0到100的滚动框,目前的情况是50栏的中间。 注意GetScrollPos函数是为了向后兼容。新的应用程序应该使用GetScrollInfo功能。 参数 hWnd [in]句柄滚动条控制或与一个标准的滚动条的窗口,这取决于该nBar参数的值。 nBar [in]指定滚动条进行审查。此参数可以是下列值之一。 SB_CTL 检索立场滚动条控制滚动框。在hWnd参数必须处理的滚动条控制。 SB_HORZ 位置检索在一个窗口的标准Level滚动条的滚动框。 SB_VERT 位置检索在一个窗口的标准垂直滚动条的滚动框。 返回值 如果函数成功,返回值是滚动框的当前位置。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 该GetScrollPos函数使应用程序能够使用32位滚动位置。尽管消息显示滚动条的位置,WM_HSCROLL和WM_VSCROLL,被限制为16个位置数据,职能SetScrollPos,SetScrollRange,GetScrollPos和GetScrollRange支持32位的滚动条位置的数据位。因此,一个应用程序可以调用GetScrollPos在处理要么WM_HSCROLL或WM_VSCROLL消息获得32位滚动条位置数据。 为了让32位的滚动框(拇指期间在WM_HSCROLL或WM_VSCROLL消息,SB_THUMBTRACK请求的代码)的位置使用GetScrollInfo功能。 如果nBar参数SB_CTL和hWnd参数指定的窗口不是一个滚动条控制系统,该系统发送SBM_GETPOS信息获取的窗口滚动条信息。这使得GetScrollPos运作自定义控件模仿一个滚动条。如果窗口不处理SBM_GETPOS消息,GetScrollPos函数失败。 功能信息 最低DLL版本 comctl32.dll 在Winuser.h中HeaderDeclared,头文件:winuser.h import libraryUser32.lib 最低操作系统Windows 95,Windows NT 3.1 参见 GetScrollInfo,GetScrollRange,SetScrollInfo,SetScrollPos,SetScrollRange,WM_HSCROLL,WM_VSCROLL ==英文原文==GetScrollPos Function 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. Note The GetScrollPos function is provided for backward compatibility. New applications should use the GetScrollInfo function. Syntax int GetScrollPos( HWND hWnd, int nBar ); Parameters hWnd [in] Handle to a scroll bar control or a window with a standard scroll bar, depending on the value of the nBar parameter. nBar [in] Specifies the scroll bar to be examined. This parameter can be one of the following values. SB_CTL Retrieves the position of the scroll box in a scroll bar control. The hWnd parameter must be the handle to 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. Return Value 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 . Remarks 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 request code in a WM_HSCROLL or WM_VSCROLL message, use the GetScrollInfo function. If the nBar parameter is SB_CTL and the window specified by the hWnd parameter is not a system scroll bar control, the system sends the SBM_GETPOS message to the window to obtain scroll bar information. This allows GetScrollPos to operate on a custom control that mimics a scroll bar. If the window does not handle the SBM_GETPOS message, the GetScrollPos function fails. Function Information Minimum DLL Versioncomctl32.dll HeaderDeclared in Winuser.h, include Windows.h Import libraryUser32.lib Minimum operating systemsWindows 95, Windows NT 3.1 See Also GetScrollInfo , GetScrollRange , SetScrollInfo , SetScrollPos , SetScrollRange , WM_HSCROLL , WM_VSCROLL ==原始网址==http://msdn.microsoft.com/en-us/library/bb787585(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。