|
Option Compare Database
Option Explicit
Type RECT
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type
Declare Function GetDesktopWindow Lib "User32" () As Long
Declare Function GetWindowRect Lib "User32" (ByVal hwnd As Long, rectangle As RECT) As Long
Function GetScreenResolution() As String
Dim R As RECT
Dim hwnd As Long
Dim RetVal As Long
hwnd = GetDesktopWindow()
RetVal = GetWindowRect(hwnd, R)
GetScreenResolution = (R.x2 - R.x1) & "*" & (R.y2 - R.y1)
End Function
'测试:
'? GetScreenResolution()
'1024*768
'说明:
'其实本站中就有 |
|