'Private Declare Function ScrollWindow Lib "user32" (ByVal hWnd As Long, ByVal XAmount As Long, ByVal YAmount As Long, lpRect As RECT, lpClipRect As RECT) As Long
'Private Declare Function ScrollWindowByNum& Lib "user32" Alias "ScrollWindow" (ByVal hWnd As Long, ByVal XAmount As Long, ByVal YAmount As Long, ByVal lpRect As Long, ByVal lpClipRect As Long)
'Private Declare Function ScrollWindowEx& Lib "user32" (ByVal hWnd As Long, ByVal dx As Long, ByVal dy As Long, lprcScroll As RECT, lprcClip As RECT, ByVal hrgnUpdate As Long, lprcUpdate As RECT, ByVal fuScroll As Long)
'Private Declare Function ScrollWindowExByNum& Lib "user32" Alias "ScrollWindowEx" (ByVal hWnd As Long, ByVal dx As Long, ByVal dy As Long, lprcScroll As RECT, lprcClip As RECT, ByVal hrgnUpdate As Long, ByVal lprcUpdate As Long, ByVal fuScroll As Long)
'Private Declare Function InflateRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
'Private Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
'Private Declare Function UpdateWindow& Lib "user32" (ByVal hWnd As Long)
'#End If 'WIN32
'**********************************
'** Type Definitions:
'#If Win32 Then
'Private Type RECT
' left As Long
' top As Long
' right As Long
' bottom As Long
'End Type
'#End If 'WIN32 Types
Private m_Window As New foWindow
Private Sub cmdScroll1_Click()
'dl& = ScrollWindowByNum&(Me.hWnd, 15, 10, 0, 0)
m_Window.Scroll 15, 10
End Sub
Private Sub cmdScroll2_Click()
Dim rc1 As foRectangle 'RECT
Dim rc2 As New foRectangle 'RECT
Dim dl&
' Scroll the entire client area
'dl& = GetClientRect(Me.hWnd, rc1)
Set rc1 = m_Window.ClientRectangle
'LSet rc2 = rc1
rc1.Copy rc2
' But specify a smaller clipping rectangle
'dl& = InflateRect(rc2, -30, -30)
rc2.Inflate -30, -30
' Note how the controls don't move - but the image of them does!