Thanks for your participation.
According to your description, I think it would be better to move this thread to Windows Desktop SDK forum. There might be more experts specific to your question.
Furthermore, you can refer to this page: Changing Screen Orientation Programmatically The sample code uses ChangeDisplaySettings. You may try it.
Your understanding will be appreciated.