views:

70

answers:

1

Is it possible to change the power-saving behaviour of a laptop computer on lid close from hibernate/standby/shutdown to Do Nothing from the .NET Framework?

Edit: it would appear that by setting the value to Standby and blocking the standby from my application, the lid close event can be detected, which is what I'm really after.

I found this question which deals with detecting lid close, but it boils down to using a standby event or writing a driver.

A: 

Yes, you can use the WMI classes.

Take a look here to an introduction to WMI

Note that you can also use Application.SetSuspendState, but this method only allows you to suspend or hibernate. So I guess it doesn't match your needs...

About the lid, there seems to be a way to detect if the lid is closed or not...

nrocha
AFAIK you need to write a driver to detect the `SYS_BUTTON_LID` message via `IOCTL_GET_SYS_BUTTON_EVENT`, but that would warrant a separate question.
FreshCode