From: <an...@us...> - 2007-04-07 14:39:24
|
Revision: 295 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=295&view=rev Author: and-81 Date: 2007-04-07 07:39:22 -0700 (Sat, 07 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/Win32.cs Modified: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.0")] -[assembly: AssemblyFileVersionAttribute("1.0.3.0")] +[assembly: AssemblyVersion("1.0.3.1")] +[assembly: AssemblyFileVersionAttribute("1.0.3.1")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -27,7 +27,7 @@ #region Constants - public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal 0.2.2.0 + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.3.1 for MediaPortal 0.2.2.0 + SVN"; public const int MessageModeCommand = 0x0018; @@ -2218,12 +2218,23 @@ try { if (proc.MainModule.FileName == commands[0]) + { windowHandle = proc.MainWindowHandle; + break; + } } catch { } } + + // if it wasn't an application, try a class + if (windowHandle == IntPtr.Zero) + windowHandle = Win32.FindWindow(commands[0], null); + + // if still not found, try window title + if (windowHandle == IntPtr.Zero) + windowHandle = Win32.FindWindow(null, commands[0]); } if (windowHandle == IntPtr.Zero) Modified: trunk/plugins/MCEReplacement/Win32.cs =================================================================== --- trunk/plugins/MCEReplacement/Win32.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/Win32.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -35,11 +35,14 @@ #region Interop [DllImport("user32")] - public static extern IntPtr GetForegroundWindow(); + internal static extern IntPtr GetForegroundWindow(); [DllImport("user32", SetLastError = false)] - public static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + internal static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + [DllImport("user32", SetLastError = true)] + internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + #endregion Interop } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |