Exemple #1
0
        public PowerNotificationService()
        {
            SystemEvents.PowerModeChanged += OnPowerModeChanged;
            RegisterClass(nameof(PowerNotificationService));
            var msgWinHandel = WindowMessageApiImports.CreateWindowEx(0, nameof(PowerNotificationService), "", 0, 0, 0, 0, 0, HwinConstants.HWND_MESSAGE, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            DeviceNotificationHelper.RegisterPowerSettingNotification(msgWinHandel);
        }
Exemple #2
0
        public DeviceChangedNotificationService()
        {
            SystemEvents.DisplaySettingsChanged += (_, _) => Debug.WriteLine("@@@@@@@@@@@@@@@@ Settings Changed");

            RegisterClass(nameof(DeviceChangedNotificationService));
            var msgWinHandel = WindowMessageApiImports.CreateWindowEx(0, nameof(DeviceChangedNotificationService), "", 0, 0, 0, 0, 0, HwinConstants.HWND_MESSAGE, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            DeviceNotificationHelper.RegisterMonitorDeviceNotification(msgWinHandel);
        }
Exemple #3
0
 public override void Dispose()
 {
     DeviceNotificationHelper.UnRegisterMonitorDeviceNotification();
 }
Exemple #4
0
 public override void Dispose()
 {
     DeviceNotificationHelper.UnregisterPowerSettingNotification();
 }