You may be able to do this with the ChangeDisplaySettingsEx API, by setting the dmDisplayOrientation accordingly. However, I note that the current documentation for the API doesn't mention being able to use DM_DISPLAYORIENTATION, when I feel sure it used to in the past - possibly because some display drivers didn't play the game properly.
Is it possible to trigger the Screen Rotation feature built into Windows 10?

Mugsy's RapSheet
196
Reputation points
I have a Windows 10 tablet. The screen automatically rotates if I turn the tablet sideways.
I'd like to be able to trigger screen rotation via code (preferably VB.Net.) Is this possible, and if so, how?
TIA
Windows for business | Windows Client for IT Pros | User experience | Other
28,658 questions