Question:
At run time, how can I retrieve the resolution of an open screen in an E3Viewer?
Solution:
To do so, you must write a script similar to the one below in a button’s Click() event.
Example:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
Set colItems = objWMIService.ExecQuery(“Select * From Win32_VideoController”)
For Each objItem in colItems
MsgBox “Width: “&objItem.CurrentHorizontalResolution
MsgBox “Height: ” & objItem.CurrentVerticalResolution
Next
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
Set colItems = objWMIService.ExecQuery(“Select * From Win32_VideoController”)
For Each objItem in colItems
MsgBox “Width: “&objItem.CurrentHorizontalResolution
MsgBox “Height: ” & objItem.CurrentVerticalResolution
Next