Use a WindowState of 0 (Normal)
Code:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Sub Form_Load() Dim r As RECT Dim hWnd As Long hWnd = FindWindow("Shell_traywnd", vbNullString) GetWindowRect hWnd, r Me.Height = Screen.Height - ((r.Bottom - r.Top) * Screen.TwipsPerPixelX) Me.Width = Screen.Width End Sub




Reply With Quote