Exemplo n.º 1
0
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));
    }
}
Exemplo n.º 3
0
/// <summary>
/// Unregister power setting notification.
/// </summary>
/// <returns></returns>
BOOL PowerSchemes::UnRegisterPowerStatus( ) 
{
	return	UnregisterPowerSettingNotification(hNotify);
}