Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Function fIsScrollBarHZ(frm As Form) As Long
' Get ScrollBar's Horizontal hWnd
Dim hWnd_VSB As Long
Dim hWnd As Long
Dim lngStyle As Long
hWnd = frm.hWnd
' Let's get first Child Window of the FORM
hWnd_VSB = apiGetWindow(hWnd, GW_CHILD)
' Let's walk through every sibling window of the Form
Do
' Thanks to Terry Kreft for explaining
' why the apiGetParent acll is not required.
' Terry is in a Class by himself! :-)
'If apiGetParent(hWnd_VSB) <> hWnd Then Exit Do
If fGetClassName(hWnd_VSB) = "scrollBar" Then
lngStyle = apiGetWindowLong(hWnd_VSB, GWL_STYLE)
If (lngStyle And SBS_SIZEBOX) = False Then
'If apiGetWindowLong(hWnd_VSB, GWL_STYLE) And SBS_HORZ Then
If (lngStyle And 1) = SBS_HORZ Then
fIsScrollBarHZ = hWnd_VSB
Exit Function
End If
End If
End If
' Let's get the NEXT SIBLING Window
hWnd_VSB = apiGetWindow(hWnd_VSB, GW_HWNDNEXT)
' Let's Start the process from the Top again
' Really just an error check
Loop While hWnd_VSB <> 0
' SORRY - NO Vertical ScrollBar control
' is currently visible for this Form
fIsScrollBarHZ = -1
End Function
[blue]Form scrollbars . . . Yes![/blue] Listbox scrollbars . . . [red]No![/red] Believe me . . . I've been through the search sooooooo many times . . . your gonna come up, zero . . . zippo . . . nada!TheAceMan said:[blue] . . . but I've never heard of an API that can track listbox scroll bars![/blue]
Public Function GetScrollBarListBoxPosHZ(ByVal lstListbox As ListBox) As SCROLLINFO
Dim lsthWndSB As Long
Dim lngret As Long
Dim sInfo As SCROLLINFO
' Init SCROLLINFO structure
sInfo.fMask = SIF_ALL
sInfo.cbSize = Len(sInfo)
sInfo.nPos = 0
sInfo.nTrackPos = 0
lstListbox.SetFocus
lsthWndSB = GetFocus()
' Get the window's ScrollBar position
lngret = apiGetScrollInfo(lsthWndSB, SB_HORZ, sInfo)
GetScrollBarListBoxPosHZ = sInfo '.nMax + 1
End Function