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); }
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); }
public override void Dispose() { DeviceNotificationHelper.UnRegisterMonitorDeviceNotification(); }
public override void Dispose() { DeviceNotificationHelper.UnregisterPowerSettingNotification(); }