본문 바로가기
C & C++/C & C++

[Tip] 모니터 끄기

by izen8 2011. 4. 18.
반응형
// 모니터 끄기
PostMessage( WM_SYSCOMMAND, SC_MONITORPOWER, 2 );
/// SystemParametersInfo()의 Power Parameters를 사용.

// SendMessage()함수를 WM_SYSCOMMAND와 SC_MONITORPOWER 인자를 사용

//MonitorOff
::SendMessage(this->m_hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1);

//MonitorOn
::SendMessage(this->m_hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1);

{
// Sets the state of the display.
// This command supports devices that have power-saving features,
// such as a battery-powered personal computer.
// The lParam parameter can have the following values:
// 1 - the display is going to low power
// 2 - the display is being shut off

PostMessage( WM_SYSCOMMAND, SC_MONITORPOWER, 2 );

반응형

'C & C++ > C & C++' 카테고리의 다른 글

[Tip] 기본 프린트 셋팅 가져오기  (0) 2011.04.18
[Tip] 프린터 등록정보 안띄우고 인쇄 하는 방법  (0) 2011.04.18
[MFC] Window Message  (0) 2011.04.15
자료 타입  (0) 2011.04.14
프로그램이 실행된 폴더 구하기  (0) 2011.04.14

댓글