Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, rectangle As Rect) As Long
Type Rect
x1 As Long
Y1 As Long
x2 As Long
y2 As Long
End Type текст формы:
Function ScreenResolution() As String
Dim R As Rect
Dim hwnd As Long
Dim retval As Long
hwnd = GetDesktopWindow()
retval = GetWindowRect(hwnd, R)
ScreenResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.Y1)
End Function
Private Sub Form_Load()
' разрешение экрана
Dim Resol As String
Resol = ScreenResolution
Text1.Text = Resol
End Sub
Системная информация (2 797 байт)