-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to distinguish between different monitors of the same model type? #250
Comments
Do you know what command they are using to extract that serial number? Sounds like a similar issue to #46 |
Unfortunately I do not. I don't think the program is open source. Here is the project homepage: |
You could use GetMonitorInfo and then check the position of the monitor to find the one you want
|
This is a decent workaround for now, but it's not ideal, especially if I re-arrange the virtual position of the monitors (I do this semi frequently). |
I put together this script as a workaround for now. It sorts the monitors by the x position so I can access them numerically (1 being leftmost and the highest number being rightmost):
This works for now, but I would like to be able to specify some type of unique serial number at some point in the future. |
Using import monitorcontrol
from win32api import EnumDisplayDevices, EnumDisplayMonitors, GetMonitorInfo
hmonitorToDeviceId = {}
for hmon, hdcmon, rect in EnumDisplayMonitors(None, None):
info = GetMonitorInfo(hmon)
dev = EnumDisplayDevices(info['Device'], 0, 1)
hmonitorToDeviceId[int(hmon)] = dev.DeviceID
for mon in monitorcontrol.get_monitors():
print(mon, hmonitorToDeviceId[mon.vcp.hmonitor.value])
|
I have several monitors which are the same model; for example, two Dell P2422H monitors. When I print the VCP capabilities, I don't see any information that distinguishes them:
I checked and this output is identical for both monitors. How can I distinguish them other than the index? For example, in another software "Nirsoft ControlMyMonitor" I get a serial number of some kind as well:
In Nirsoft ControlMyMonitor, I can address the monitor by the number in the red box directly, which makes it possible to distinguish them when controlling them.
It would make more sense to identify them this way since monitor indexes in Windows can change, especially as I add and remove other monitors. The indexes are not consistent in my experience.
I have a setup with 8 total monitors on Windows 10, Python 3.8, monitorcontrol==3.0.2.
The text was updated successfully, but these errors were encountered: