Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rotate screen on Vista from within program

Started by Prune Apr 24, 2009 at 5:59 PM 2 replies 2k views
Original Post
Prune
Prune
On Windows one could just run a shell command: system("rundll32 NvCpl.dll,dtcfg rotate 0 270"); However, on Vista I get Error: API not supported on this version of Windows. So, how do I rotate the screen from within my program??
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)
frob
frob
What you were doing was not appropriate for the general case.

Your old method assumed that you had NvCPL.dll installed (That's the NVidia control panel), that it was the 32-bit dll, that it was the current driver for the video card, that dtcfg and the other commands were correct, and that the screen was not rotated to begin with.


For a proper way to do this in code look at the msdn article: Changing Screen Orientation Programmatically which describes how to use the ChangeDisplaySettingsEx function to rotate the display.
Prune
Prune
Quote:
Original post by frob
What you were doing was not appropriate for the general case.

I'm not writing software for the general case. All units on which the software will be deployed are put together and set up by us.

Quote:
For a proper way to do this in code

Does not work, and EnumDisplaySettingsEx() shows only 0 for allowable display orientation; clearly, the NVIDIA driver does not expose rotation to this Microsoft interface; the control applet must be using some other API.
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.