- 'A mettre dans un module
-
- Public Const SPI_GETWORKAREA = 48
- Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
-
- Public Type RECT
- Left As Long
- Top As Long
- Right As Long
- Bottom As Long
- End Type
-
-
- 'Routine
- Dim lngTop, lngLeft, lngRight, lngBottom As Long
- Dim typRect As RECT
-
- Call SystemParametersInfo(SPI_GETWORKAREA, vbNull, typRect, 0)
- With typRect
- lngTop = .Top
- lngLeft = .Left
- lngRight = .Right
- lngBottom = .Bottom
- End With
-
- 'On récupère les coordonnées dans:
- ' typRect.Bottom
- ' typRect.Top
- ' typRect.Left
- ' typRect.Right
'A mettre dans un module
Public Const SPI_GETWORKAREA = 48
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'Routine
Dim lngTop, lngLeft, lngRight, lngBottom As Long
Dim typRect As RECT
Call SystemParametersInfo(SPI_GETWORKAREA, vbNull, typRect, 0)
With typRect
lngTop = .Top
lngLeft = .Left
lngRight = .Right
lngBottom = .Bottom
End With
'On récupère les coordonnées dans:
' typRect.Bottom
' typRect.Top
' typRect.Left
' typRect.Right