Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Long, ByVal uParam As Long, lpvParam As RECT, _
ByVal fuWinIni As Long) As Long
Private RC As RECT
Const SPI_GETWORKAREA = 48
Private Sub Command1_Click()
Call SystemParametersInfo(SPI_GETWORKAREA, 0, RC, 0)
Me.Left = RC.Left * Screen.TwipsPerPixelX
Me.Top = RC.Top * Screen.TwipsPerPixelY
Me.Width = (RC.Right - RC.Left) * Screen.TwipsPerPixelX
Me.Height = (RC.Bottom - RC.Top) * Screen.TwipsPerPixelY
End Sub
00