tags:

views:

36

answers:

1

I was wondering if there was an event that is triggered when a laptop or desktop goes into sleep mode.

An example would be: When a user is working on his/her laptop and he/she flips the monitor down, the laptop goes into sleep mode.

Or when a user goes to Start → Shutdown → Sleep.

Are there any events built into .NET that determine this?

+2  A: 

Check this CodeProject article and these MSDN reference articles.

To find out C# DLLImport declarations visit pinvoke.net

UPD

Also check here

Eugene Cheverda
I'm not necessarily looking for power management tools or change the power... i'm looking for when the computer sleeps or is on idle for a long time and the computer changes.
Kevin
RegisterPowerSettingNotification function will help you. Then in WndProc method you should check Message value.
Eugene Cheverda
See update, by link provided source code how to handle it in C#.
Eugene Cheverda