turn monitor off

I would like to keep the monitor off for the period
when my
application is running. I used
::SendMessage(HWND_BROADCAST,
WM_SYSCOMMAND, (WPARAM)SC_MONITORPOWER, 2) to turn the
monitor off.

The problem i am facing now is if someone touches the
keyboard or move
the mouse, the monitor will be on. How to keep the
monitor off all the
time?

I guess I have to do it in the device driver level?
Any help is
appreciated!
~~Henry.


Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

Why do you turn off the monitor? What happens if you could disable the
keyboard/mouse and the user wants to kill your application, or if it
crashes?

Zoltan


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Exactly. Think of the user experience for this. There is a reason you
can’t disable turning the monitor back on via input, it could make the
machine appear locked to the user when it really is not.

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Zoltan Csizmadia [mailto:xxxxx@yahoo.com]
Sent: Thursday, February 28, 2002 12:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

Why do you turn off the monitor? What happens if you could disable the
keyboard/mouse and the user wants to kill your application, or if it
crashes?

Zoltan


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

This problem was actually the reason I started device driver
programming. (Though in my case it was so I could turn off the screen of my
stupid laptop when I closed the lid.) You have to send
IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE to \Device\Video0. You could do
this from user mode if you somehow get a handle to that device (which as far
as I know is impossible.) As input you give it a pointer to a ULONG that
holds one of the VideoPowerXxx enums and as output give it NULL.

The only way I found to get access to that device was to use
IoAttachDevice, reference the pointer it returns, and then use
IoDetachDevice. (Which is probably a really bad way of getting the pointer,
anyone know of a better way?)

Hope this helps; use at your own risk.

-brian
----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Thursday, February 28, 2002 3:19 PM
Subject: [ntdev] RE: turn monitor off

Exactly. Think of the user experience for this. There is a reason you
can’t disable turning the monitor back on via input, it could make the
machine appear locked to the user when it really is not.

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Zoltan Csizmadia [mailto:xxxxx@yahoo.com]
Sent: Thursday, February 28, 2002 12:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

Why do you turn off the monitor? What happens if you could disable the
keyboard/mouse and the user wants to kill your application, or if it
crashes?

Zoltan

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: argus@vt.edu
To unsubscribe send a blank email to %%email.unsub%%

Check out IoGetDeviceObjectPointer. The DDK example kbdclass contains
code which uses this function. Note that this will send a create file
to the object in question and if \device\video0 can get pnp removed, you
have to register for notifications on the file handle (kbdclass also
does this) so that you can close it.

d

This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: Brian [mailto:argus@vt.edu]
Sent: Thursday, February 28, 2002 12:32 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

This problem was actually the reason I started device driver
programming. (Though in my case it was so I could turn off the screen
of my stupid laptop when I closed the lid.) You have to send
IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE to \Device\Video0. You could
do this from user mode if you somehow get a handle to that device (which
as far as I know is impossible.) As input you give it a pointer to a
ULONG that holds one of the VideoPowerXxx enums and as output give it
NULL.

The only way I found to get access to that device was to use
IoAttachDevice, reference the pointer it returns, and then use
IoDetachDevice. (Which is probably a really bad way of getting the
pointer, anyone know of a better way?)

Hope this helps; use at your own risk.

-brian
----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Thursday, February 28, 2002 3:19 PM
Subject: [ntdev] RE: turn monitor off

Exactly. Think of the user experience for this. There is a reason you
can’t disable turning the monitor back on via input, it could make the
machine appear locked to the user when it really is not.

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Zoltan Csizmadia [mailto:xxxxx@yahoo.com]
Sent: Thursday, February 28, 2002 12:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

Why do you turn off the monitor? What happens if you could disable the
keyboard/mouse and the user wants to kill your application, or if it
crashes?

Zoltan

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: argus@vt.edu
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

I’m … pretty sure I tried that function. Even that didn’t work for
video0. I don’t think it responds to create IRP’s. (Or it responds with
STATUS_INVALID_DEVICE_REQUEST). I may be wrong, though; it’s been over half
a year since I worked with that problem.

-brian
----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Thursday, February 28, 2002 4:05 PM
Subject: [ntdev] RE: turn monitor off

Check out IoGetDeviceObjectPointer. The DDK example kbdclass contains
code which uses this function. Note that this will send a create file
to the object in question and if \device\video0 can get pnp removed, you
have to register for notifications on the file handle (kbdclass also
does this) so that you can close it.

d

This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: Brian [mailto:argus@vt.edu]
Sent: Thursday, February 28, 2002 12:32 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

This problem was actually the reason I started device driver
programming. (Though in my case it was so I could turn off the screen
of my stupid laptop when I closed the lid.) You have to send
IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE to \Device\Video0. You could
do this from user mode if you somehow get a handle to that device (which
as far as I know is impossible.) As input you give it a pointer to a
ULONG that holds one of the VideoPowerXxx enums and as output give it
NULL.

The only way I found to get access to that device was to use
IoAttachDevice, reference the pointer it returns, and then use
IoDetachDevice. (Which is probably a really bad way of getting the
pointer, anyone know of a better way?)

Hope this helps; use at your own risk.

-brian
----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Thursday, February 28, 2002 3:19 PM
Subject: [ntdev] RE: turn monitor off

Exactly. Think of the user experience for this. There is a reason you
can’t disable turning the monitor back on via input, it could make the
machine appear locked to the user when it really is not.

D

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Zoltan Csizmadia [mailto:xxxxx@yahoo.com]
Sent: Thursday, February 28, 2002 12:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: turn monitor off

Why do you turn off the monitor? What happens if you could disable the
keyboard/mouse and the user wants to kill your application, or if it
crashes?

Zoltan

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: argus@vt.edu
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: argus@vt.edu
To unsubscribe send a blank email to %%email.unsub%%

A helper user app is a best solution for such.

----- Original Message -----
From: “noil sg”
To: “NT Developers Interest List”
Sent: Thursday, February 28, 2002 10:49 PM
Subject: [ntdev] turn monitor off

> I would like to keep the monitor off for the period
> when my
> application is running. I used
> ::SendMessage(HWND_BROADCAST,
> WM_SYSCOMMAND, (WPARAM)SC_MONITORPOWER, 2) to turn the
> monitor off.
>
> The problem i am facing now is if someone touches the
> keyboard or move
> the mouse, the monitor will be on. How to keep the
> monitor off all the
> time?
>
> I guess I have to do it in the device driver level?
> Any help is
> appreciated!
> ~~Henry.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>