by Timmy Smith (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating:
(5 Votes)
The purpose of the code is to determine the height of the taskbar so that you can display a form at the bottom right hand corner of the screen everytime.
API DeclarationsPrivate Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_GETWORKAREA = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
' this code will display a form at the bottom right had corner everytime.
dim WindowRect as RECT
SystemParametersInfo SPI_GETWORKAREA, 0, WindowRect, 0
FrmMain.Top = WindowRect.Bottom * Screen.TwipsPerPixelY - FrmMain.Height
FrmMain.Left = WindowRect.Right * Screen.TwipsPerPixelX - FrmMain.Width