Click here to Skip to main content
15,884,040 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have to merge code from 2 different projects. Both projects are used to modify monitor / display settings.

In one project “pathArray[index].targetInfo.id” are retrieved with
GetDisplayConfigBufferSizes
QueryDisplayConfig


In the second one “monitor handles” are retrieved with:
EnumDisplayMonitors
GetPhysicalMonitorsFromHMONITOR

I need to know both ways:

How I can get the “monitor handles” (plural, because in cloned display mode 2 monitors should be retrieved) from “pathArray[index].targetInfo.id”

And also the opposite way “pathArray[index].targetInfo.id” from “monitor handles”

What I have tried:

I investigate the according documentations on MSDN.
Posted
Updated 12-Jul-19 5:22am

1 solution

You must read the documentation of this functions carefully in GetPhysicalMonitorsFromHMONITOR is written that it is real device but the QueryDisplayConfig is about all possible devices. So the functions are different and you should not merge the code to careless and get fooled by the same variable names. Best is to rename and keep both code pathes and carefully study and debug the usage.

I guess that one code is for enumerate all possible resolutions and the other has the output of the actual settings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900