views:

52

answers:

2

I'm wondering if it's possible to catch Windows 7 Sleep/Suspend Messages.

http://stackoverflow.com/questions/727154/cant-catch-sleep-suspend-messages-winxp

A: 

Use PInvoke to call the Win32 API RegisterPowerSettingNotification. Details here.

Duncan Bayne
A: 

Doesn't SystemEvents.PowerModeChanged work for you?

Best

Vagaus
Yes, but can I cancel it?
James_Dude
No. At least I don't see a way to cancel it.
Vagaus