Windows 7 Rotating the Display Programmatically


I work for a lab at a university. We reimage 30 Windows 7 machines each semester. We use HP LP1965 widescreen monitors and Nvidia Quadro NVS 290 video cards. These monitors can rotate to profile, which is the way they are in the lab. Each machine has two monitors. We use WAIK (Windows Automated Installation Kit) to build answer files for the base image, install the image on a test machine and install all the programs we need. At that point we sysprep the machine, take the image, and deploy it to the lab computers via Windows Deployment Services

Does anyone know how to programmatically rotate the display and have the rotation persist?
What We’ve Already Done

1. Looked through the registry for any orientation or display device information regarding orientation. Nothing pertinent was found. Windows 7 doesn’t have/use the GDI\Rotate key registry entry I’ve seen on some tablet pc’s
2. Used code provided by Microsoft to rotate the display using DEVMODE ( The problem with it is that it does not persist.
3. Used SysInternals to monitor the processes for when I changed the rotation. I found shell32.dll seemed to be used but didn’t find any good information in the dll that could help me.
4. Used a registry monitor when I changed the display orientation (Control Panel\All Control Panel Items\Display\Screen Resolution) and tried to pinpoint the change in the registry. I couldn’t identify anything useful
5. Looked to set screen orientation in a Windows 7 answer file, but found nothing except width and height.
6. We have changed the orientation on the test machine and then sysprep’ed for OOBE and that doesn’t persist the orientation.

This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.