I ran into a problem when it comes to loading a convenient setting for a game.
What am I trying to do:
I am trying to load the name of all monitors in a different way.
What I tried:
WMIC:
C:\Users\Matt>wmic wmic:root\cli>DESKTOPMONITOR Availability Bandwidth Caption ConfigManagerErrorCode ConfigManagerUserConfig CreationClassName Description DeviceID DisplayType ErrorCleared ErrorDescription InstallDate IsLocked LastErrorCode MonitorManufacturer MonitorType Name PixelsPerXLogicalInch PixelsPerYLogicalInch PNPDeviceID PowerManagementCapabilities PowerManagementSupported ScreenHeight ScreenWidth Status StatusInfo SystemCreationClassName SystemName 8 Generic PnP Monitor 0 FALSE Win32_DesktopMonitor Generic PnP Monitor DesktopMonitor1 (Standard monitor types) Generic PnP Monitor Generic PnP Monitor 96 96 DISPLAY\LGD02DA\4&265EFD6&0&UID67568640 OK Win32_ComputerSystem ALIENWARE 3 Generic PnP Monitor 0 FALSE Win32_DesktopMonitor Generic PnP Monitor DesktopMonitor2 (Standard monitor types) Generic PnP Monitor Generic PnP Monitor 96 96 DISPLAY\SAM08D6\5&14F3DA9&0&UID1078064 1080 1920 OK Win32_ComputerSystem ALIENWARE wmic:root\cli>DESKTOP BorderWidth Caption CoolSwitch CursorBlinkRate Description DragFullWindows GridGranularity IconSpacing IconTitleFaceName IconTitleSize IconTitleWrap Name Pattern ScreenSaverActive ScreenSaverExecutable ScreenSaverSecure ScreenSaverTimeout SettingID Wallpaper WallpaperStretched WallpaperTiled 1 500 TRUE Segoe UI 9 TRUE NT AUTHORITY\SYSTEM (None) FALSE FALSE 1 530 TRUE 43 Segoe UI 9 TRUE Alienware\Matt 0 FALSE 0 C:\Users\Matt\Pictures\Wall Papers\daftpunk3.png TRUE FALSE 1 500 TRUE Segoe UI 9 TRUE .DEFAULT (None) FALSE FALSE
GraphicsEnvironment (Java code):
final GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment(); for (GraphicsDevice device : environment.getScreenDevices()) { System.out.println(device); System.out.println("\t" + device.getIDstring()); System.out.println("\t" + device.getType()); }
Output:
D3DGraphicsDevice[screen=0] \Display0 0 null D3DGraphicsDevice[screen=1] \Display1 0 null D3DGraphicsDevice[screen=2] \Display2 0 null
What I expect:
Screen[0]: S23C350 Screen[1]: Mobile PC Display Screen[2]: S23B350
I have 3 monitors. Each of these names are names taken from the Screen Resolution control panel.
Additionally:
Another thing I'm trying to achieve is to determine the orientation of the screen. From what I saw: it can be a landscape, a portrait, a landscape (inverted) or a portrait (inverted). I would then just want to start the game on Landscape - turned upside down or not.
Being able to distinguish between the two main types will be the next step for me.
Thank you for taking the time to read this, I apologize if something is unclear about this question in advance.
I am ready to use registry access and a possible dll implementation, so I decided to tag those if that happens.
user1181445
source share