2008/06/29 02:47


가끔 노트북으로 다운로드를 걸어놓거나 공부를 할때 모니터를 끌수있으면 좋겠다는 생각이 들었다.
(노트북 기능키에 모니터 끄기가 있는 노트북도 있지만 내껀 없다. ㅠㅠ)
물론 화면보호기가 작동되어 설정한 시간이 지나면 자동으로 꺼지긴 하지만 내가 원할때 끄고 싶었다.
그래서 자료를 찾아본 결과 역시 윈도우 메시지를 날려주면 된다.

모니터 OFF Message는 WM_SYSCOMMAND메시지를 날려주면되는데

WPARAM에 SC_MONITORPOWER을 설정하고 LPARAM에 1 이나 2를 설정해주면된다.

다음은 MSDN의 내용

wParam
Specifies the type of system command requested. This parameter can be one of the following values.

SC_MONITORPOWER
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

 아래는 구현된 실제 코드 내용


Posted by 세라피안

트랙백 주소 - http://serapian.pe.kr/trackback/187 관련글 쓰기

댓글을 달아 주세요