Private Type SCROLLINFO
cbSize As Long
fMask As Long
nMin As Long
nMax As Long
nPage As Long
nPos As Long
nTrackPos As Long
End Type
Private Declare Function GetScrollInfo Lib "user32" (ByVal hwnd As Long, ByVal n As Long, lpScrollInfo As SCROLLINFO) As Long
Private Sub Command20_Click()
Dim n As Long
Dim SI As SCROLLINFO
SI.cbSize = Len(SI)
SI.fMask = SIF_TRACKPOS '这两句是从msdn.microsoft.com上看到的有关要求,不知用对没有
n = GetScrollInfo(Me.hwnd, SB_VERT, SI)
MsgBox SI.nPos & " ==" & SI.nTrackPos '显示的都是0,得不到正确的结果
End Sub