📄 rotate.cpp
字号:
// rotate.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
// HKEY hRegKey;
// DWORD status;
// DWORD ValType;
// DWORD ValLen;
DWORD Rotation = 0;
DEVMODE devmode = {0};
devmode.dmSize = sizeof(DEVMODE);
devmode.dmFields = DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(NULL, &devmode, 0, CDS_TEST, NULL);
switch(devmode.dmDisplayOrientation)
{
case DMDO_0:
devmode.dmDisplayOrientation = DMDO_90; //ˮƽģʽ
Rotation = 90;
break;
case DMDO_90:
devmode.dmDisplayOrientation = DMDO_180;
Rotation = 180;
break;
case DMDO_180:
devmode.dmDisplayOrientation = DMDO_270;
Rotation = 270;
break;
case DMDO_270:
devmode.dmDisplayOrientation = DMDO_0;
Rotation = 0;
break;
default :
devmode.dmDisplayOrientation = DMDO_0;
Rotation = 0;
}
devmode.dmFields = DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(NULL, &devmode, NULL, 0, NULL);
// status = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
// TEXT("System\\GDI\\Rotation"),
// 0, 0, &hRegKey);
// if (ERROR_SUCCESS == status)
// {
// ValLen = sizeof(DWORD);
// if (ERROR_SUCCESS == RegSetValueEx (hRegKey, TEXT("Angle"), NULL, REG_DWORD, (PBYTE)&Rotation, ValLen))
// RegCloseKey(hRegKey);
// }
// RegFlushKey(HKEY_LOCAL_MACHINE);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -