enumDO에 정의되어 있는 모드를 차례대로 변환 합니다.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[CODE type=c++]
#include <windows.h>
#include "EzLotator.h"
DWORD getDisplayOrientation(DEVMODE* pDevmode);
void setDisplayOrientation(DEVMODE* pDevmode, DWORD angle);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
DEVMODE devmode = {0,};
DWORD enumDO[] = { DMDO_0, DMDO_90 };
DWORD currentDO = getDisplayOrientation(&devmode);
int countEDO = sizeof(enumDO)/sizeof(enumDO[0])-1;
int i=0;
for(i=0; i<countEDO; i++)
if ( currentDO == enumDO[i] )
break;
if ( i<countEDO )
{
setDisplayOrientation( &devmode, enumDO[++i] );
}
else
{
setDisplayOrientation( &devmode, enumDO[0] );
}
return 0;
}
DWORD getDisplayOrientation(DEVMODE* pDevmode)
{
pDevmode->dmSize = sizeof(DEVMODE);
pDevmode->dmFields = DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(NULL, pDevmode, NULL, CDS_TEST, 0);
return pDevmode->dmDisplayOrientation;
}
void setDisplayOrientation(DEVMODE* pDevmode, DWORD angle)
{
getDisplayOrientation( pDevmode );
pDevmode->dmDisplayOrientation = angle;
ChangeDisplaySettingsEx(NULL, pDevmode, NULL, CDS_RESET, 0);
}
[/HTML][/CODE]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[CODE type=c++]
#include <windows.h>
#include "EzLotator.h"
DWORD getDisplayOrientation(DEVMODE* pDevmode);
void setDisplayOrientation(DEVMODE* pDevmode, DWORD angle);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
DEVMODE devmode = {0,};
DWORD enumDO[] = { DMDO_0, DMDO_90 };
DWORD currentDO = getDisplayOrientation(&devmode);
int countEDO = sizeof(enumDO)/sizeof(enumDO[0])-1;
int i=0;
for(i=0; i<countEDO; i++)
if ( currentDO == enumDO[i] )
break;
if ( i<countEDO )
{
setDisplayOrientation( &devmode, enumDO[++i] );
}
else
{
setDisplayOrientation( &devmode, enumDO[0] );
}
return 0;
}
DWORD getDisplayOrientation(DEVMODE* pDevmode)
{
pDevmode->dmSize = sizeof(DEVMODE);
pDevmode->dmFields = DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(NULL, pDevmode, NULL, CDS_TEST, 0);
return pDevmode->dmDisplayOrientation;
}
void setDisplayOrientation(DEVMODE* pDevmode, DWORD angle)
{
getDisplayOrientation( pDevmode );
pDevmode->dmDisplayOrientation = angle;
ChangeDisplaySettingsEx(NULL, pDevmode, NULL, CDS_RESET, 0);
}
[/HTML][/CODE]
반응형
'Dev > Mobile' 카테고리의 다른 글
PDA용 우편번호 검색 프로그램 소스 (0) | 2007.07.06 |
---|---|
mobile개발 (0) | 2006.08.08 |
How To Use CeRapiInvoke (0) | 2005.09.13 |
PDA에서 외장 메모리 삽입/삭제 시 이벤트 (0) | 2005.09.02 |
WinCE에서 폰트 설치 및 삭제 (0) | 2005.03.02 |