コード例 #1
0
        /// <summary>Registers the application to receive power setting notifications for the specific power setting event.</summary>
        /// <param name="handle">Handle indicating where the power setting notifications are to be sent.</param>
        /// <param name="powerSetting">The GUID of the power setting for which notifications are to be sent.</param>
        /// <returns>Returns a notification handle for unregistering power notifications.</returns>
        internal static int RegisterPowerSettingNotification(IntPtr handle, Guid powerSetting)
        {
            var outHandle = PowerManagementNativeMethods.RegisterPowerSettingNotification(
                handle,
                ref powerSetting,
                0);

            return(outHandle);
        }
コード例 #2
0
 /// <summary>
 /// Registers the application to receive power setting notifications
 /// for the specific power setting event.
 /// </summary>
 /// <param name="handle">Handle indicating where the power setting
 /// notifications are to be sent.</param>
 /// <param name="powerSetting">The GUID of the power setting for
 /// which notifications are to be sent.</param>
 /// <returns>Returns a notification handle for unregistering
 /// power notifications.</returns>
 internal static int RegisterPowerSettingNotification(IntPtr handle, Guid powerSetting) => PowerManagementNativeMethods.RegisterPowerSettingNotification(handle, ref powerSetting, 0);