int x,y;
x=0;
y=0;
GetScrollRange(SB_HORZ,&x,&y);
SetScrollPos(SB_HORZ,(x)/2,TRUE);
楼主你滚动条是水平的啊,,加上 垂直的坐标干嘛,不是找BUG吗
[/Quote]
哦,这个x应该是min y应该是max。都是水平滚动条的参数。肯能用了xy容易误导大家....
void GetScrollRange(
int nBar,
LPINT lpMinPos,
LPINT lpMaxPos )
const;
Parameters
nBar
Specifies the scroll bar to examine. The parameter can take one of the following values:
SB_HORZ Retrieves the position of the horizontal scroll bar.
SB_VERT Retrieves the position of the vertical scroll bar.
lpMinPos
Points to the integer variable that is to receive the minimum position.
lpMaxPos
Points to the integer variable that is to receive the maximum position.