' Restrict the form so it just shows its menus.
Private Sub Form_Resize()
Dim rgn As Long
Dim wid As Single
Dim hgt As Single
Dim border_width As Single
' Create the region.
wid = ScaleX(Width, vbTwips, vbPixels)
hgt = ScaleY(Height, vbTwips, vbPixels)
ScaleMode = vbPixels
border_width = (wid - ScaleWidth) / 2
rgn = CreateRectRgn( _
border_width, border_width, _
wid - border_width, _
hgt - border_width - ScaleHeight - 1)
' Restrict the window to the region.
SetWindowRgn hWnd, rgn, True
DeleteObject rgn
End Sub
|