1

I am having trouble finding a way to force any display resolution/timing I want in my C# program. I am running Windows 7 with a GeForce 210 graphics card. My current method to achieve these custom resolutions is to use the driver GUI to manually add the custom resolutions and then use Windows calls to change to those resolutions but I need a way to add new custom resolutions in real time. I have looked into the NVAPI but I was not able to find a way to do this. I also looked into the command line tool for the graphics driver but I was not able to get it to work. My last resort is to rewrite the values in registry but I would really like to avoid that. I am willing to use a different programming language or a third party tool as long as I can invoke it from the command line via my program. Can anyone point me in the right direction?

Thanks in advance.

Update (8/16/2011): I have been working on this problem with NVIDIA and they are providing me with an advanced NVAPI that will allow me to recreate the functionality of their driver. They also confirmed that the basic version of NVAPI that they provide will not do this.

mxgg250
  • 705
  • 8
  • 13
  • Have you tried http://developer.nvidia.com/? Last time I checked they were pretty good over there. – Patrick Hughes Jul 26 '11 at 19:06
  • I've looked through the NVAPI and Nvidia graphics sdk 11 and wasn't able to find anything. I applied for their registered developer program and posted this question on their forums but have not had a response to either in two and a half weeks. They can obviously do this since their driver does it, but I'm not sure how they are doing it or if they make that functionality of the graphics card available to outside developers. – mxgg250 Jul 26 '11 at 19:16
  • mxgg250, can you give any pointers on a fast track way to get in contact with NVidia to get the NDA version? I've searched online and it seems their site developer.nvidia.com puts you in a loop and essentially cannot request the NDA version. I think it would benefit quite a few people if you could share your experience in getting Nvidia to work with you for the NDA flavor. Thanks. – ScottN Feb 13 '12 at 06:54
  • I would recommend you start by becoming a registered: developer and then asking their technical support for help with getting the NDA version. However, getting it is not an easy task. I was fortunate enough to have a contact at NVIDIA that pushed things along for me and it still took nearly three months before I actually had the API. Share with them what you are working on because it really helps if they find your project interesting. If all goes well for you then your company will have to sign an NDA before NVIDIA releases any information. – mxgg250 Feb 18 '12 at 00:05
  • I hope that information can be of help. I forgot/didn't have time to update my progress on this post but the NDA version of the API gave me to tools I needed to solve my problem. – mxgg250 Feb 18 '12 at 00:07

2 Answers2

1

You could try using ChangeDisplaySettings

I'm not sure if it will have all the options provided by the nvidia panel, but certainly the basics like resolution, refresh rate, screen orientation, etc. I've used it myself in the past to dynamically change screen orientation (rotate to landscape/portrait) on a click of a button.

Egor
  • 1,622
  • 12
  • 26
  • That is what I'm currently using to switch between supported resolutions. I believe it reads the registry to see what is supported and will only switch to it if the resolution is found. If I'm unable to find another way to do this, I may resort to editing the registry values and then using ChangeDisplaySettings. – mxgg250 Jul 26 '11 at 19:21
  • Can you not create a DevMode struct and set •dmPelsWidth •dmPelsHeight to whatever you want? – Egor Jul 26 '11 at 19:23
  • That will only allow you to change to supported display modes. I am trying to ignore whether the setting is supported or not and force the switch. – mxgg250 Jul 26 '11 at 19:31
1

I was able to solve this problem by using the NDA version of the NVAPI. It still was not trivial but all of the tools are there.

mxgg250
  • 705
  • 8
  • 13