Windows does not provide a function that allows applications to obtain the numbers used by the display settings app. The numbers themselves are specific only to the display settings app and have no meaning in the system or in the CCD APIs used to query/set the display topology.
The best option is for applications to define their own criteria for assigning an index when prompting the user to select a display.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…