Есть проверка на прокрутку колёсика мыши, вопрос как связать это с ScrollBar вертикальный???? у него даже имени нету!
единственное свойство MDIForm.ScrollBars=true(false)
mc = FindWindowEx(Me.hwnd, ByVal 0&, "MDIClient", vbNullString)
Private Const SB_VERT = 1
Private Const SIF_RANGE = &H1
Private Const SIF_PAGE = &H2
Private Const SIF_POS = &H4
Private Const SIF_DISABLENOSCROLL = &H8
Private Const SIF_TRACKPOS = &H10
Private Const SIF_ALL = (SIF_RANGE Or SIF_PAGE Or SIF_POS Or SIF_TRACKPOS)
Private Const SB_LINEUP = 0
Private Const SB_LINEDOWN = 1
Private Const SB_PAGEUP = 2
Private Const SB_PAGEDOWN = 3
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_BOTTOM = 7
Private Const SB_ENDSCROLL = 8
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 Declare Function SetScrollInfo Lib "user32" _
(ByVal hwnd As Long, _
ByVal n As Long, _
lpcScrollInfo As SCROLLINFO, _
ByVal fRedraw As Long) As Long
Private s As SCROLLINFO
BOOL GetScrollInfo(
HWND hwnd, // handle to window with scroll bar
int fnBar, // scroll bar flag
LPSCROLLINFO lpsi // pointer to structure for scroll parameters
);
...
lpsi
Pointer to a SCROLLINFO structure. Before calling GetScrollInfo, set the cbSize member of the structure to sizeof(SCROLLINFO), and set the fMask member to specify the scroll bar parameters to retrieve.
s.cbSize = Len(s)
s.fMask = SIF_POS Or SIF_RANGE
GetScrollInfo ByVal mc, ByVal SB_VERT, s
s.fMask = SIF_POS
SetScrollInfo ByVal mc, ByVal SB_VERT, s, 1
Сейчас этот форум просматривают: Google-бот и гости: 47