From: <an...@us...> - 2007-02-10 10:33:26
|
Revision: 109 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=109&view=rev Author: and-81 Date: 2007-02-10 02:33:25 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj trunk/plugins/MCEReplacementTray/Setup.cs trunk/plugins/MCEReplacementTray/Tray.cs Added Paths: ----------- trunk/plugins/MCEReplacementTray/Win32.cs Modified: trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj =================================================================== --- trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-10 10:33:25 UTC (rev 109) @@ -61,6 +61,7 @@ <Compile Include="Tray.cs"> <SubType>Form</SubType> </Compile> + <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Properties\Resources.resx"> Modified: trunk/plugins/MCEReplacementTray/Setup.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Setup.cs 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/Setup.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -68,23 +68,23 @@ protected override void WndProc(ref Message m) { // Handle Suspend & Resume ... - if (m.Msg == Tray.WM_POWERBROADCAST) + if (m.Msg == Win32.WM_POWERBROADCAST) { switch (m.WParam.ToInt32()) { - case Tray.PBT_APMQUERYSUSPEND: - case Tray.PBT_APMQUERYSTANDBY: + case Win32.PBT_APMQUERYSUSPEND: + case Win32.PBT_APMQUERYSTANDBY: MceIrApi.Suspend(); break; - case Tray.PBT_APMRESUMEAUTOMATIC: + case Win32.PBT_APMRESUMEAUTOMATIC: MceIrApi.Resume(); break; } } // Handle button presses ... - if (m.Msg == Tray.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) + if (m.Msg == Win32.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) { int keyCode = m.LParam.ToInt32() & 0xFFFF; Modified: trunk/plugins/MCEReplacementTray/Tray.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -62,30 +62,6 @@ #endregion Properties - #region Constants - - public const int WM_USER = 0x0400; - - public const int WM_POWERBROADCAST = 0x0218; - - public const int PBT_APMQUERYSUSPEND = 0x0000; - public const int PBT_APMQUERYSTANDBY = 0x0001; - //public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; - //public const int PBT_APMQUERYSTANDBYFAILED = 0x0003; - public const int PBT_APMSUSPEND = 0x0004; - //public const int PBT_APMSTANDBY = 0x0005; - - public const int PBT_APMRESUMECRITICAL = 0x0006; - public const int PBT_APMRESUMESUSPEND = 0x0007; - public const int PBT_APMRESUMESTANDBY = 0x0008; - //public const int PBTF_APMRESUMEFROMFAILURE = 0x00000001; - //public const int PBT_APMBATTERYLOW = 0x0009; - //public const int PBT_APMPOWERSTATUSCHANGE = 0x000A; - //public const int PBT_APMOEMEVENT = 0x000B; - public const int PBT_APMRESUMEAUTOMATIC = 0x0012; - - #endregion Constants - #region Constructor public Tray() @@ -275,18 +251,18 @@ protected override void WndProc(ref Message m) { // Handle Suspend & Resume ... - if (m.Msg == WM_POWERBROADCAST) + if (m.Msg == Win32.WM_POWERBROADCAST) { switch (m.WParam.ToInt32()) { - case PBT_APMQUERYSUSPEND: - case PBT_APMQUERYSTANDBY: + case Win32.PBT_APMQUERYSUSPEND: + case Win32.PBT_APMQUERYSTANDBY: if (MceIrApi.InUse) MceIrApi.Suspend(); TrayIcon.Visible = false; break; - case PBT_APMRESUMEAUTOMATIC: + case Win32.PBT_APMRESUMEAUTOMATIC: if (MceIrApi.InUse) MceIrApi.Resume(); TrayIcon.Visible = true; @@ -295,7 +271,7 @@ } // Handle button presses ... - if (m.Msg == WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) + if (m.Msg == Win32.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) { int keyCode = m.LParam.ToInt32() & 0xFFFF; if (keyCode == TriggerButton) Added: trunk/plugins/MCEReplacementTray/Win32.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Win32.cs (rev 0) +++ trunk/plugins/MCEReplacementTray/Win32.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -0,0 +1,36 @@ +using System; + +namespace MCEReplacementTray +{ + + public static class Win32 + { + + #region Constants + + public const int WM_USER = 0x0400; + public const int WM_APP = 0x8000; + + public const int WM_POWERBROADCAST = 0x0218; + + public const int PBT_APMQUERYSUSPEND = 0x0000; + public const int PBT_APMQUERYSTANDBY = 0x0001; + //public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; + //public const int PBT_APMQUERYSTANDBYFAILED = 0x0003; + public const int PBT_APMSUSPEND = 0x0004; + //public const int PBT_APMSTANDBY = 0x0005; + + public const int PBT_APMRESUMECRITICAL = 0x0006; + public const int PBT_APMRESUMESUSPEND = 0x0007; + public const int PBT_APMRESUMESTANDBY = 0x0008; + //public const int PBTF_APMRESUMEFROMFAILURE = 0x00000001; + //public const int PBT_APMBATTERYLOW = 0x0009; + //public const int PBT_APMPOWERSTATUSCHANGE = 0x000A; + //public const int PBT_APMOEMEVENT = 0x000B; + public const int PBT_APMRESUMEAUTOMATIC = 0x0012; + + #endregion Constants + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |