Private Declare Function GetDeviceCaps Lib "gdi32" _ (ByVal hDC As Long, ByVal nIndex As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" _ (ByVal hwnd As Long, ByVal hDC As Long) As Long
Const HORZRES = 8
Const VERTRES = 10
Const BITSPIXEL = 12
Public Sub GetVideoMode()
Dim xWidth As Long, xHeight As Long, xDepth As Long, hDC As Long
hDC = GetDC(GetDesktopWindow())
xWidth = GetDeviceCaps(hDC, HORZRES)
xHeight = GetDeviceCaps(hDC, VERTRES)
xDepth = GetDeviceCaps(hDC, BITSPIXEL)
ReleaseDC GetDesktopWindow(), hDC
End Sub |
|