GetScrollInfo(RichEdit.Handle, SB_HORZ, lpsi); // 水平
GetScrollInfo(RichEdit.Handle, SB_VERT, lpsi); // 垂直
返回的 lpsi 是一个结构体,包含了滚动条的信息:
lpsi
Points to a SCROLLINFO structure whose fMask member, upon entry to the function,
specifies the scroll bar parameters to retrieve. Before returning, the function
copies the specified parameters to the appropriate members of the structure.
The fMask member can be a combination of the following values:
Value Meaning
SIF_PAGE Copies the scroll page to the nPage member of the SCROLLINFO
structure pointed to by lpsi.
SIF_POS Copies the scroll position to the nPos member of the SCROLLINFO
structure pointed to by lpsi.
SIF_RANGE Copies the scroll range to the nMin and nMax members of the SCROLLINFO
structure pointed to by lpsi.