Разделы
Главная

Windows API
Реестр
MS Access
Visual Basic
Download
Форум
Гостевая книга
Ссылки

E-mail

Партнерская программа WWW.PORTA.RU (on-line магазин портативной аудио, видео, фототехники). Самая щедрая, самая честная, самая популярная. Приглашаем всех веб-мастеров к участию!



Submitter.ru - Free promoting
Visual Basic

вернуться назад Как узнать разрешение экрана?

' Разрешение экрана
' Добавить в форму TextBox

текст модуля:

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 байт)