помогите в кубики перевести
In Vista you can register for a callback for when the Lid Close Action changes. This is done by calling RegisterPowerSettingNotification (see http://msdn2.microsoft.com/en-us/library/aa373196.aspx for details). The GUID for this power setting you're interested in is GUID_LIDCLOSE_ACTION. This is defined in wdm.h in the Platform SDK.
Once registered, a WM_POWERBROADCAST will be sent to your application with wParam set to PBT_POWERSETTINGCHANGE. This event is sent anytime the value for the lid close action changes. The lParam contains a pointer to a POWERBROADCAST_SETTING structure (see http://msdn2.microsoft.com/en-us/library/aa372723.aspx) containing information on the setting change.
Stephen [MS]