StephaneLenclud@159: // PowerManager.h StephaneLenclud@159: StephaneLenclud@159: #pragma once StephaneLenclud@159: StephaneLenclud@159: using namespace System; StephaneLenclud@159: using namespace System::Windows::Forms; StephaneLenclud@159: StephaneLenclud@159: namespace PowerManager StephaneLenclud@159: { StephaneLenclud@159: public delegate void PowerManagerDelegate(); StephaneLenclud@159: Stephane@160: public ref class SettingNotifier StephaneLenclud@159: { StephaneLenclud@159: public: Stephane@160: //Constructors Stephane@160: SettingNotifier(IntPtr aHandle, Boolean aService); Stephane@160: SettingNotifier(IntPtr aHandle); StephaneLenclud@159: // StephaneLenclud@159: void WndProc(Message% aMessage); StephaneLenclud@159: StephaneLenclud@159: event PowerManagerDelegate^ OnMonitorPowerOn StephaneLenclud@159: { StephaneLenclud@159: void add(PowerManagerDelegate^ d); StephaneLenclud@159: void remove(PowerManagerDelegate^ d); StephaneLenclud@159: private: StephaneLenclud@159: void raise(); StephaneLenclud@159: } StephaneLenclud@159: StephaneLenclud@159: event PowerManagerDelegate^ OnMonitorPowerOff StephaneLenclud@159: { StephaneLenclud@159: void add(PowerManagerDelegate^ d); StephaneLenclud@159: void remove(PowerManagerDelegate^ d); StephaneLenclud@159: private: StephaneLenclud@159: void raise(); StephaneLenclud@159: } StephaneLenclud@159: StephaneLenclud@159: private: StephaneLenclud@159: void Construct(IntPtr aHandle, Boolean aService); StephaneLenclud@159: // Stephane@160: HPOWERNOTIFY RegisterPowerSettingNotification(LPCGUID aGuid); StephaneLenclud@159: StephaneLenclud@159: private: StephaneLenclud@159: PowerManagerDelegate^ iMonitorPowerOnDelegate; StephaneLenclud@159: PowerManagerDelegate^ iMonitorPowerOffDelegate; StephaneLenclud@159: StephaneLenclud@159: StephaneLenclud@159: private: StephaneLenclud@159: /// Window or Service handle StephaneLenclud@159: IntPtr iHandle; StephaneLenclud@159: /// Specify whether we run as Window or a Service StephaneLenclud@159: Boolean iIsService; StephaneLenclud@159: /// StephaneLenclud@159: int iMonitorPowerObserverCount; Stephane@160: HPOWERNOTIFY iMonitorPowerHandle; StephaneLenclud@159: }; StephaneLenclud@159: }