如何获取屏幕自动旋转的状态? [英] How to get the screen auto-rotate's status?

查看:21
本文介绍了如何获取屏幕自动旋转的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

windows8 中如何通过 Regetry 或 ACPI 获取屏幕自动旋转的状态(禁用或启用)?

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

我需要禁用屏幕自动旋转,我将使用winkey + O更改屏幕自动旋转控制.

I need to disable screen auto-rotate, and I will use winkey + O to change the screen auto-rotate control.

有人有类似的经历吗?

推荐答案

如果您想更改自动旋转状态,以下可能会有所帮助:

Below maybe helpful if you want to change auto-rotate status:

//C++
typedef BOOL (WINAPI* SETAUTOROTATION)(BOOL bEnable);

SETAUTOROTATION SetAutoRotation = (SETAUTOROTATION)GetProcAddress(GetModuleHandle(TEXT("user32.dll")), (LPCSTR)2507);
if(SetAutoRotation != NULL)
{
  SetAutoRotation(TRUE);
}

//C#
[DllImport("user32.dll", EntryPoint = "#2507")]
extern static bool SetAutoRotation(bool bEnable);

SetAutoRotation(true);

这篇关于如何获取屏幕自动旋转的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆