'Store rectangle coordinates.
Public Type FormCoords
lngX1 As Long
lngY1 As Long
lngX2 As Long
lngY2 As Long
End Type
#If VBA7 Then 'use PtrSafe & LongPtr
Declare PtrSafe Sub GetWindowRect Lib "user32" (ByVal hWnd As LongPtr, lpRect As FormCoords)
Declare PtrSafe Function GetDC Lib "user32" (ByVal hWnd As LongPtr) As LongPtr
Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hWnd As LongPtr, ByVal hDC As LongPtr) As Long
Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
Declare PtrSafe Function apiSystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As RECT, ByVal fuWinIni As Long) As Long
#Else
'API Declarations
Declare Sub GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As FormCoords)
Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
Declare Function apiSystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As RECT, ByVal fuWinIni As Long) As Long
#End If
Public Const SPI_GETWORKAREA = 48
'Store for usable area of screen (see frmCalendar code)
Public Type RECT
vLeft As Long
vTop As Long
vRight As Long
vBottom As Long
End Type