by Anonymous (267 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sun 27th December 1998
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Make a form cover the entire screen including taskbar and office toolbar
API Declarations
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
Const HWND_TOP = 0
Const SWP_SHOWWINDOW = &H40
Dim cy As Long
Dim RetVal As Long
' Determine if screen is already maximized.
If Me.WindowState = vbMaximized Then
' Set window to normal size
Me.WindowState = vbNormal
End If ' Get full screen width.
cx = GetSystemMetrics(SM_CXSCREEN) ' Get full screen height.
cy = GetSystemMetrics(SM_CYSCREEN)
' Call API to set new size of window.
RetVal = SetWindowPos(Me.hwnd, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW)
No comments have been posted about Make a form cover the entire screen including taskbar and office toolbar. Why not be the first to post a comment about Make a form cover the entire screen including taskbar and office toolbar.