How to get the screen auto-rotate's status?

前端 未结 5 1526
谎友^
谎友^ 2020-12-10 09:18

How to get the screen auto-rotate\'s status (disable or enable) by Regetry or ACPI in windows8?

I need to disable screen auto-rotate, and I will use winkey + O to c

5条回答
  •  时光取名叫无心
    2020-12-10 09:20

    The registry and Windows+O hotkey work at the system level, tweaking a user setting. Applications aren't supposed to mess with it. There is an application-level way to set autorotation preferences, and once the user closes your app or switches to a different one, then their existing settings (or the other app's) take over.

    MSDN has a good example of using the relevant APIs here: https://code.msdn.microsoft.com/windowsapps/Auto-Rotation-Preferences-87ae2902

    If your app has only one autorotation preference that it keeps throughout its lifetime, then it is simplest to just set it in your manifest. There are a few options there that you don't get with the APIs such as supporting both landscape and landscape flipped.

提交回复
热议问题