如果您想要更改自动旋转状态,以下内容可能会有所帮助:
//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);