Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Windows Displays
Function:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Windows Displays
This example is the version from Sat, 2nd Mar 2018.
Project "Windows Displays.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() dim displays() as WindowsDisplayMBS = WindowsDisplayMBS.Displays for each display as WindowsDisplayMBS in displays List.AddRow "DeviceName", display.DeviceName List.AddRow "DeviceInstanceID", display.DeviceInstanceID List.AddRow "LogPixelsX", str(display.LogPixelsX) List.AddRow "LogPixelsY", str(display.LogPixelsY) List.AddRow "Width", str(display.Width) List.AddRow "Height", str(display.Height) List.AddRow "Primary", yes(display.Primary) list.AddRow "" List.AddRow "DisplayAdapterActive", yes(display.DisplayAdapterActive) List.AddRow "DisplayAdapterDeviceID", display.DisplayAdapterDeviceID List.AddRow "DisplayAdapterDeviceKey", display.DisplayAdapterDeviceKey List.AddRow "DisplayAdapterDeviceName", display.DisplayAdapterDeviceName List.AddRow "DisplayAdapterDeviceString", display.DisplayAdapterDeviceString List.AddRow "DisplayAdapterRemovable", yes(display.DisplayAdapterRemovable) List.AddRow "DisplayAdapterStateFlags", str(display.DisplayAdapterStateFlags) list.AddRow "" List.AddRow "DisplayMonitorActive", yes(display.DisplayMonitorActive) List.AddRow "DisplayMonitorDeviceID", display.DisplayMonitorDeviceID List.AddRow "DisplayMonitorDeviceKey", display.DisplayMonitorDeviceKey List.AddRow "DisplayMonitorDeviceName", display.DisplayMonitorDeviceName List.AddRow "DisplayMonitorDeviceString", display.DisplayMonitorDeviceString List.AddRow "DisplayMonitorRemovable", yes(display.DisplayMonitorRemovable) List.AddRow "DisplayMonitorStateFlags", str(display.DisplayMonitorStateFlags) list.AddRow "" List.AddRow "MonitorX", str(display.MonitorX) List.AddRow "MonitorY", str(display.MonitorY) List.AddRow "MonitorWidth", str(display.MonitorWidth) List.AddRow "MonitorHeight", str(display.MonitorHeight) list.AddRow "" List.AddRow "WidthDPI", str(display.WidthDPI) List.AddRow "WidthInch", str(display.WidthInch) List.AddRow "WidthMM", str(display.WidthMM) List.AddRow "HeightDPI", str(display.HeightDPI) List.AddRow "HeightInch", str(display.HeightInch) List.AddRow "HeightMM", str(display.HeightMM) list.AddRow "" next End EventHandler
Private Function yes(b as Boolean) As string if b then Return "yes" else return "no" end if End Function
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS Xojo Plugins