Rotating displays programmatically in Windows XP? (C++/Qt and WindowsAPI)

前端 未结 1 1204
南笙
南笙 2021-01-21 19:39

So, essentially, we\'re writing a service-level application that can alter attributes of various user-level settings. I\'m working on the display portion right now.

We\

相关标签:
1条回答
  • 2021-01-21 20:33

    The whole Display and Monitor thing in XP isn't as clear cut as they are in WDDM. While you can enumerate monitors "attached" to a display, you can't change the mode of the monitor by calling ChangeDisplaySettingsEx. To change the display mode, you call CDSE with the display, e.g. "\\.\Display1" or something like that. I spent a good chunk of time playing with these functions on XP in a previous life and I don't think you can do what you want to do with them.

    As far as I know, screen rotation is an implemention detail of the display driver under XP, and there is no standard way to do this from user space. Some Intel drivers list portrait modes when you call EnumDisplaySettings. By setting your display to one of these modes, you end up with a rotated screen.

    In short, there is no standard way to do this for all graphics card vendors. But you maybe able to do the same thing their utility apps do to achieve the effect.

    Under Windows 7, rotation and mirroring is provided by the OS. This link should give you the details of how things work under Win7. There isn't a equivalent things for XP I'm afraid.

    0 讨论(0)
提交回复
热议问题