|
|
|
|
|
|
Code des Screen-Objekts
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetDC Lib "user32" _
(ByVal hWnd As Long) As Long
Private 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
Public Function ColorDepth() As Long
Const BITSPIXEL = 12
ColorDepth = GetDeviceCaps(GetDC(0), BITSPIXEL)
End Function
Public Property Get Height() As Long
Height = VB.Screen.Height \ Screen.TwipsPerPixelY
End Property
Public Property Get Width() As Long
Width = VB.Screen.Width \ Screen.TwipsPerPixelX
End Property
Public Property Get WorkAreaHeight() As Long
Dim nRect As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
With nRect
WorkAreaHeight = .Bottom - .Top
End With
End Property
Public Property Get WorkAreaLeft() As Long
Dim nRect As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
WorkAreaLeft = nRect.Left
End Property
Public Property Get WorkAreaTop() As Long
Dim nRect As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
WorkAreaTop = nRect.Top
End Property
Public Property Get WorkAreaWidth() As Long
Dim nRect As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
With nRect
WorkAreaWidth = .Right - .Left
End With
End Property
|
|
|