Screen Resolution Setting

I am a C # developer and I have to regularly change the screen resolution.

There are many examples of how to read current screen resolutions: SystemInformation.PrimaryMonitorSize

I found the ChangeDisplaySettingsEx Function

The only way to do this in C # is with PInvoke ???

It seems strange to me that it is very easy to get this information, but it is difficult to establish ...

+1
source share
3 answers

You will need to make a PInvoke call for ChangedisplaySetting.

Here's a link that provides sample code, http://www.xtremedotnettalk.com/printthread.php?t=73184 .

+1
source

I also recommend that you check out the Jared Parsons PInvoke Toolkit. You can download it here:

http://www.codeplex.com/clrinterop/Release/ProjectReleases.aspx?ReleaseId=14120

This makes adding signature signatures to your code a breeze. He doesn’t always choose the right types of interaction, but he’s usually pretty close, and even if you need to make some changes, he’s still usually faster than manually translating everything.

+1
source

The simple answer is yes. You must use PInvoke.

0
source

All Articles