요걸 찾아서 해봤는데 실행이 안되는거 있죠. ㅜ.ㅜ
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
// 모니터 켜기
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// 모니터 끄기(Saver mode)
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 0);
end;
end.
윈2000서버 에서만 안되는건지 아님 다른 이유가 있는 건지 궁금하군요.
전원관리에서 설정하면 잘 꺼지거든요. 근데 왜 안되는 거죠?
윈2000서버에서는 강제 종료또한 안되는 것 같던데 이또한 O/S때문인가요?
그럼 O/S 때문이면 방법이 없는 건지 알고 싶습니다.
> 요걸 찾아서 해봤는데 실행이 안되는거 있죠. ㅜ.ㅜ
> unit Unit1;
>
> interface
>
> uses
> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
> StdCtrls;
>
> type
> TForm1 = class(TForm)
> Button1: TButton;
> Button2: TButton;
> procedure Button1Click(Sender: TObject);
> procedure Button2Click(Sender: TObject);
> private
> { Private declarations }
> public
> { Public declarations }
> end;
>
> var
> Form1: TForm1;
>
> implementation
> {$R *.DFM}
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
> // 모니터 켜기
> SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1);
> end;
>
> procedure TForm1.Button2Click(Sender: TObject);
> begin
> // 모니터 끄기(Saver mode)
> SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 0);
> end;
>
> end.
>
> 윈2000서버 에서만 안되는건지 아님 다른 이유가 있는 건지 궁금하군요.
> 전원관리에서 설정하면 잘 꺼지거든요. 근데 왜 안되는 거죠?
> 윈2000서버에서는 강제 종료또한 안되는 것 같던데 이또한 O/S때문인가요?
> 그럼 O/S 때문이면 방법이 없는 건지 알고 싶습니다.
/////////////////////////////////////////////////////////////////////////////
한국인의 실험정신입니다.
메세지 센드의 Message.LPARAM부분 즉, SendMessage함수에서 마지막인자 값을 다른것 사용해보세요. 1로...
모니터 끄기 SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1);
서두에서와 같이 기냥 테스트했으므로 설명은 못함...