Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect screensetting? 2

Status
Not open for further replies.

rudo

Programmer
Joined
Jul 3, 2002
Messages
72
Location
NL
Hello,

I have made VBA applications for 600 * 800 screens. I would like to include code to increase the zoom to 120, when a larger screen is used. (Activewindow.zoom = 120) Does anyone know how I can detect automatically what the users screensetting is?

Thank you for your help.

Greetings from Holland,

Rudo
 
Code:
Option Explicit
Declare Function GetSystemMetrics& Lib "User32" (ByVal nIndex As Long)

Function GetScreenSize() As String
  GetScreenSize = GetSystemMetrics(1) & "x" & GetSystemMetrics(0)
End Function

Sub test()
  MsgBox GetScreenSize
End Sub
 
You certainly can use the API, as above, but you can also get it, and use it, with the Horizontal and Vertical properties of System, as in:

Dim lnghorizontal As Long
Dim lngvertical As Long

lnghorizontal = System.HorizontalResolution
lngvertical = System.VerticalResolution



Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top