How to properly order monitors from the Screen interface? RRS feed

  • Question

  • Hey Guys,

    I've used the Screen interface to discover monitors that are connected to the users computer.  On my pc this was fine at first but now (apprantly randomly) my primary monitor is not the first monitor that is found.  Now I could check the "primary" attribute but this wont help me if the user has more than two monitors because I still dont know what order the final 2 are in!

    The reason for order being important is that sometimes my program needs to generate a wallpaper image using seperate images for each screen.  As i'm sure you know, the way you do that is to create one large image with dimensions equal to the combined size of your monitors and then insert image data into the appriopriate point inside that image.  Then you can set the image as a desktop wallpaper and use the tile attribute and walla, everything is lined up nice and it appears every monitor has a seperate wallpaper applied.

    However currently if my program doesnt get the monitors in the right order then the wallpaper a user sets for one monitor might appear on another one!  And if the monitors have different resolutions you get all kinds of problems.  But, short of getting the user to arrange the monitors in a list by hand, I don't know how to properly order the monitors to match up with, for example, how they are displayed in the windows desktop properties.  Any ideas?

    Thanks in advance!

    I've peered closer at the windows desktop properties and although the monitor icons are in the right order for some bizarre reason the monitor on the left (which is set as primary) has now got a number 2 written inside the icon.  I havnt found any way to change this and its bizzare because that monitor always used to quite rightly be monitor 1.  But I guess this means its not a progmatical error and this question should be ignored :/  Back to the drawing board
    • Edited by Dave R. B Sunday, October 5, 2008 2:25 PM
    • Moved by jack 321 Wednesday, October 8, 2008 5:52 AM off topic (Moved from Visual C# General to Off-Topic Posts (Do Not Post Here))
    Sunday, October 5, 2008 2:19 PM



    Hello Dave,

    Thank you for your post!  Unfortunately there is not a current forum to post the question you are asking so I would recommend that you post you question to one of the microsoftproduct community located here: http://www.microsoft.com/communities/products/default.mspx

    Hope that helps!

    Vijay Mullick Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by Vijay Mullick Tuesday, October 21, 2008 11:21 AM
    • Marked as answer by Dave R. B Wednesday, October 22, 2008 6:20 AM
    Tuesday, October 21, 2008 11:21 AM