void DisableBatteryNotifications() { if (sPowerHandle) { UnregisterPowerSettingNotification(sPowerHandle); sPowerHandle = nullptr; } if (sCapacityHandle) { UnregisterPowerSettingNotification(sCapacityHandle); sCapacityHandle = nullptr; } if (sHWnd) { DestroyWindow(sHWnd); sHWnd = nullptr; } }
ScreenLockListenerWin::~ScreenLockListenerWin() { HWND h = reinterpret_cast<HWND>(static_cast<QWidget*>(parent())->winId()); WTSUnRegisterSessionNotification(h); if (m_powerNotificationHandle) { UnregisterPowerSettingNotification(reinterpret_cast<HPOWERNOTIFY>(m_powerNotificationHandle)); } }
/// <summary> /// Unregister power setting notification. /// </summary> /// <returns></returns> BOOL PowerSchemes::UnRegisterPowerStatus( ) { return UnregisterPowerSettingNotification(hNotify); }