Setting my Display Resolution

前端 未结 3 1086
长情又很酷
长情又很酷 2021-01-25 04:54

I\'m a C# developer and I have to change my display resolution regularly.

There are plenty of examples on how to read the current display resolutions: SystemInformation.

相关标签:
3条回答
  • 2021-01-25 05:22

    You'll have to make a PInvoke call to ChangedisplaySetting.

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

    0 讨论(0)
  • 2021-01-25 05:36

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

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

    It makes adding pinvoke signatures to your code a breeze. It doesn't always pick the right interop types, but it's usually pretty close, and even if you have to make some changes its still usually quicker than translating everything by hand.

    0 讨论(0)
  • 2021-01-25 05:42

    Simple answer: Yes. You should use PInvoke.

    0 讨论(0)
提交回复
热议问题