VB Code:
Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
Private Sub Form_Load()
Set vbLink = New EventVB.APIFunctions
Set vbWnd = New EventVB.ApiWindow
vbWnd.hWnd = Me.hWnd
'\\ Subclass this form....
vbLink.SubclassedWindows.Add vbWnd
End Sub
Private Sub vbWnd_MinMaxSize(MaxHeight As Long, MaxWidth As Long, MaxPositionTop As Long, MaxPositionLeft As Long, MinTrackWidth As Long, MinTrackheight As Long, MaxTrackWidth As Long, MaxTrackHeight As Long)
If Me.WindowState <> vbMinimized Then
With vbWnd.RECT
MaxHeight = .Bottom - .Top
MaxWidth = .Right - .Left
MaxPositionLeft = .Left
MaxPositionTop = .Top
End With
End If
End Sub