网站首页  词典首页

请输入您要查询的函数:

 

术语 setscrollinfo
释义 SetScrollInfo
语法:
int SetScrollInfo( HWND hwnd,
int fnBar,
LPCSCROLLINFO lpsi,
BOOL fRedraw
);
SetScrollInfo函数
该SetScrollInfo函数设置滚动条参数,包括最低和最高滚动立场,页面大小,并滚动框(拇指)的立场。该功能也重绘滚动条,如果要求。
参数
hwnd
[in]句柄滚动条控制或与一个标准的滚动条的窗口,这取决于该fnBar参数的值。
fnBar
[in]指定滚动条的设置参数的类型。此参数可以是下列值之一。
SB_CTL
设置滚动条的控制参数。在hwnd参数必须处理的滚动条控制。
SB_HORZ
设置窗口的标准Level滚动条的参数。
SB_VERT
设置窗口的标准垂直滚动条的参数。
lpsi
[in]指向1 SCROLLINFO结构。在调用SetScrollInfo,设置结构的cbSize成员为sizeof(SCROLLINFO),设置fMask成员,以显示参数设置,并指定相应的成员在新的参数值。
该fMask成员可以是一个或多个下列值。
SIF_DISABLENOSCROLL
禁用滚动条,而不是删除它,如果滚动条的新的参数,使滚动条是不必要的。
SIF_PAGE
设置滚动页面在SCROLLINFO结构nPage成员中指定的值指向lpsi。
SIF_POS
设置滚动位置,以在SCROLLINFO结构npos返回成员中指定的值指向lpsi。
SIF_RANGE
设置滚动范围的无机氮和SCROLLINFO结构nMax成员中指定的值指向lpsi。
fRedraw
[in]指定滚动条是否重绘,以反映变化的滚动条。如果此参数为TRUE,滚动条重绘,否则,它不是重绘。
返回值
返回值是滚动框的当前位置。
备注
该SetScrollInfo函数对由nPage及SCROLLINFO结构npos返回成员中指定的值范围检查。该nPage成员必须指定一个值从0到nMax -无机氮1。非营利组织的成员必须设在无机氮和nMax值-最大(nPage - 1,0)。如果任何值超出其范围是,该函数将它设置为一个值,仅仅范围内。
如果fnBar参数SB_CTL和hwnd参数指定的窗口不是一个滚动条控制系统,该系统发送SBM_SETSCROLLINFO信息,窗口设置滚动条信息(系统优化信息SBM_SETPOS或SBM_SETRANGE如果请求专为位置或范围)。这使得SetScrollInfo运作自定义控件模仿一个滚动条。如果窗口不处理SBM_SETSCROLLINFO(或优化SBM_SETPOS邮件或SBM_SETRANGE消息),然后SetScrollInfo函数失败。
有关示例,请与WM_PAINT消息滚动文字。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.51
参见
GetScrollInfo,SCROLLINFO
==英文原文==SetScrollInfo Function
The SetScrollInfo function sets the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb). The function also redraws the scroll bar, if requested.
Syntax
int SetScrollInfo( HWND hwnd,
int fnBar,
LPCSCROLLINFO lpsi,
BOOL fRedraw
);
Parameters
hwnd
[in] Handle to a scroll bar control or a window with a standard scroll bar, depending on the value of the fnBar parameter.
fnBar
[in] Specifies the type of scroll bar for which to set parameters. This parameter can be one of the following values.
SB_CTL
Sets the parameters of a scroll bar control. The hwnd parameter must be the handle to the scroll bar control.
SB_HORZ
Sets the parameters of the window's standard horizontal scroll bar.
SB_VERT
Sets the parameters of the window's standard vertical scroll bar.
lpsi
[in] Pointer to a SCROLLINFO structure. Before calling SetScrollInfo, set the cbSize member of the structure to sizeof(SCROLLINFO), set the fMask member to indicate the parameters to set, and specify the new parameter values in the appropriate members.
The fMask member can be one or more of the following values.
SIF_DISABLENOSCROLL
Disables the scroll bar instead of removing it, if the scroll bar's new parameters make the scroll bar unnecessary.
SIF_PAGE
Sets the scroll page to the value specified in the nPage member of the SCROLLINFO structure pointed to by lpsi.
SIF_POS
Sets the scroll position to the value specified in the nPos member of the SCROLLINFO structure pointed to by lpsi.
SIF_RANGE
Sets the scroll range to the value specified in the nMin and nMax members of the SCROLLINFO structure pointed to by lpsi.
fRedraw
[in] Specifies whether the scroll bar is redrawn to reflect the changes to the scroll bar. If this parameter is TRUE, the scroll bar is redrawn, otherwise, it is not redrawn.
Return Value
The return value is the current position of the scroll box.
Remarks
The SetScrollInfo function performs range checking on the values specified by the nPage and nPos members of the SCROLLINFO structure. The nPage member must specify a value from 0 to nMax - nMin +1. The nPos member must specify a value between nMin and nMax - max( nPage– 1, 0). If either value is beyond its range, the function sets it to a value that is just within the range.
If the fnBar parameter is SB_CTL and the window specified by the hwnd parameter is not a system scroll bar control, the system sends the SBM_SETSCROLLINFO message to the window to set scroll bar information (The system can optimize the message to SBM_SETPOS or SBM_SETRANGE if the request is solely for the position or range). This allows SetScrollInfo to operate on a custom control that mimics a scroll bar. If the window does not handle SBM_SETSCROLLINFO (or the optimized SBM_SETPOS message or SBM_SETRANGE message), then the SetScrollInfo function fails.
For an example, see Scrolling Text with the WM_PAINT Message .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.51
See Also
GetScrollInfo , SCROLLINFO
==原始网址==http://msdn.microsoft.com/en-us/library/bb787595(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:22:41