Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Problem: Setting up a executable that will do the following
1. Verify monitor setup is correct
2. Launch several apps starting them on the correct screen.

What I know how to do so far
1. Verify and set screen resolution
2. Launch applications on the appropriate screen

What I still need:
1. Verify and set monitor physical arrangement.

Does anyone know how to set the physical arrangement (what can be done manually at Display Properties -> Settings) using the .net framework?

[Edit Moved from answer by OP - Henry]
Let me clarify. The PC has 5 monitors. Users keep going into Display Properties -> Settings and changing the physical layout setup. That would be the part at the top with a picture of each monitor labeled 1,2,3,4,5 etc... where you can drag them around to match physical layout. The actual physical setup does not change but users keep changing it in the settings. I am looking for a way to make sure those settings are correct before launching the applications.
[/Edit]
Posted
Updated 22-Feb-11 7:08am
v2

Second Answer based on your updated questions.

It appears what you trying to do is check/set screen resolution for a known monitor. Again that is not possible. Now take a deep breath and look at the issue one more time.

You source of problem is users changing the display properties. Is it possible to control the environment? This can be done by either clearly stating to the what the operating requirements are or taking away the privilege from them.

To me it is as simple as 'Set of expected requirement' period. I don't know your application and how it is setup, but I am sure it has puts many assumptions in order to run properly. What if the user deletes one of your binary files, or you have a service that starts up automatically and the user disables it, or ... you got my idea. ( I hope)

May all you need to do is document you set of requirement as
1. The application requires 5 monitors
2. The physical and screen resolution of the monitors shall not be altered.
etc....


Another approach is, if all the monitors can have exactly the same resolution, for example 1280x780, then during your application startup set the screen resolution to all of the monitors, if you fail to set any one then your quit.
 
Share this answer
 
Comments
Espen Harlinn 25-Feb-11 11:28am    
Nice reply, a 5
Yusuf 25-Feb-11 12:01pm    
Thanks
biggerboots 9-Feb-12 15:15pm    
You missed the point of their question, I understand exactly what they were trying to do, I am in fact trying to do the same thing. I have a product that supports multiple monitors and right now when setting it up the user has to go into the Windows Display Properties dialog and drag the displays around until they match the physical layout. I want to 'automate' this to simplify setup (the number of monitors I can support is quite large).

I have a method for getting the physical layout I just need a way to input that into the display settings. I know there are exposed APIs for changing resolutions, orientation, etc. however does anyone know if there are any APIs exposed so I can tell Windows that 'Display #1' is to the left of 'Display #2' and that 'Display #3' is under 'Display #1'?
I could well be wrong on this but I don't think that it is possible.

How on earth can Windows (or any OS, for that matter) 'know' where the screens are physically located?
 
Share this answer
 
Your question is somewhat misleading. You stated you know how to set screen resolution and what to know physical arrangement. What is physical arrangement any ways? Then you proceeded to clarify your question by asking you want control programmatically what is done manually at Display->Settings. Isn't that the screen resolution and color? what does it have to do with physical arrangements?

As Henry stated, there is no way you can get the "physical" arrangement. period. If you have multi monitor you can check with one First, Second ... display. I am not sure how to get that info, but may graphics adapters display that.

If you simply are trying to set the resolution and color, you stated you know it, but if you need more information look at

Dynamic Screen Resolution[^]

Changing Screen Orientation Programmatically[^]
 
Share this answer
 
Comments
Henry Minute 22-Feb-11 13:09pm    
The OP has responded with an answer. I have moved it into the original question. :)
Well I guess I am not making myself clear. I already have working code for checking and setting screen resolution. I am only stuck on the part where you tell the OS what your physical layout it. So when you move your mouse off the primary monitor it goes to the correct screen. I've already done a bunch of searching and had been unable to find anything. I was hoping someone else may have know a solution. I guess I will play with group policy and just disable the settings tab.
 
Share this answer
 
Comments
biggerboots 9-Feb-12 15:14pm    
I understood exactly what you were trying to do, I am in fact trying to do the same thing. I have a product that supports multiple monitors and right now when setting it up the user has to go into the Windows Display Properties dialog and drag the displays around until they match the physical layout. I want to 'automate' this to simplify setup (the number of monitors I can support is quite large).

I have a method for getting the physical layout I just need a way to input that into the display settings. I know there are exposed APIs for changing resolutions, orientation, etc. however does anyone know if there are any APIs exposed so I can tell Windows that 'Display #1' is to the left of 'Display #2' and that 'Display #3' is under 'Display #1'?

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