From: <che...@us...> - 2010-09-17 16:46:17
|
Revision: 3790 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3790&view=rev Author: chef_koch Date: 2010-09-17 16:46:08 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/ListeningTo/ trunk/plugins/ListeningTo/Build/ trunk/plugins/ListeningTo/Build/build.bat trunk/plugins/ListeningTo/Build/build.log trunk/plugins/ListeningTo/Build/filever.exe trunk/plugins/ListeningTo/ListeningTo/ trunk/plugins/ListeningTo/ListeningTo/Helper/ trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo/ trunk/plugins/ListeningTo/ListeningTo/ListeningTo/PlayingInfo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo/SendPlayingInfo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo.csproj trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.Designer.cs trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.cs trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.resx trunk/plugins/ListeningTo/ListeningTo/Properties/ trunk/plugins/ListeningTo/ListeningTo/Properties/AssemblyInfo.cs trunk/plugins/ListeningTo/ListeningTo/Properties/Resources.Designer.cs trunk/plugins/ListeningTo/ListeningTo/Properties/Resources.resx trunk/plugins/ListeningTo/ListeningTo/Settings.cs trunk/plugins/ListeningTo/ListeningTo/img/ trunk/plugins/ListeningTo/ListeningTo/img/ListeningTo_disabled.png trunk/plugins/ListeningTo/ListeningTo/img/ListeningTo_enabled.png trunk/plugins/ListeningTo/ListeningTo.5.1.ReSharper trunk/plugins/ListeningTo/ListeningTo.sln trunk/plugins/ListeningTo/ListeningToRepeater/ trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.Designer.cs trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.cs trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.resx trunk/plugins/ListeningTo/ListeningToRepeater/Helper/ trunk/plugins/ListeningTo/ListeningToRepeater/Helper/ClientServer.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/ trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/Network.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/ProcessHelper.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/SystemRegistry.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/Win32.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/ trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/PlayingInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/SendPlayingInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningToRepeater.csproj trunk/plugins/ListeningTo/ListeningToRepeater/Program.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/ trunk/plugins/ListeningTo/ListeningToRepeater/Properties/AssemblyInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/Resources.Designer.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/Resources.resx trunk/plugins/ListeningTo/ListeningToRepeater/iconPlaying.ico trunk/plugins/ListeningTo/MpeRelease/ trunk/plugins/ListeningTo/releases/ Added: trunk/plugins/ListeningTo/Build/build.bat =================================================================== --- trunk/plugins/ListeningTo/Build/build.bat (rev 0) +++ trunk/plugins/ListeningTo/Build/build.bat 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,28 @@ +@ECHO OFF + + +REM Select program path based on current machine environment +set ProgramDir=%ProgramFiles% +if not "%ProgramFiles(x86)%".=="". set ProgramDir=%ProgramFiles(x86)% + + +REM set logfile where the infos are written to, and clear that file +set LOG=build.log +echo. > %LOG% + + +echo. +echo -= MusicBrainzRating =- +echo -=====================- +echo. + + +echo. +echo Building MusicBrainzRating... +"%WINDIR%\Microsoft.NET\Framework\v3.5\MSBUILD.exe" /target:Rebuild /property:Configuration=Release;AllowUnsafeBlocks=true "..\MusicBrainzRating.sln" >> %LOG% + + +echo. +echo Building MpeExtension package... +"%ProgramDir%\Team MediaPortal\MediaPortal\MpeMaker.exe" "..\MpeRelease\MusicBrainzRating.xmp2" /B /UpdateXML >> %LOG% + Added: trunk/plugins/ListeningTo/Build/build.log =================================================================== --- trunk/plugins/ListeningTo/Build/build.log (rev 0) +++ trunk/plugins/ListeningTo/Build/build.log 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,63 @@ + +Microsoft (R)-Buildmodul, Version 3.5.30729.4926 +[Microsoft .NET Framework, Version 2.0.50727.4927] +Copyright (C) Microsoft Corporation 2007. Alle Rechte vorbehalten. + +Build started 29.06.2010 12:53:01. +Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" on node 0 (Rebuild target(s)). + Building solution configuration "Release|Any CPU". +Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (1) is building "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (2) on node 0 (Rebuild target(s)). +Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5". +CoreClean: + Das Verzeichnis "obj\Release\" wird erstellt. +PrepareForBuild: + Das Verzeichnis "bin\Release\" wird erstellt. +CoreResGen: + Die Ressourcendatei MusicBrainzRatingConfig.resx wird zu obj\Release\MusicBrainzRating.MusicBrainzRatingConfig.resources verarbeitet. + Die Ressourcendatei Properties\Resources.resx wird zu obj\Release\MusicBrainzRating.Properties.Resources.resources verarbeitet. +HelperClasses\MusicBrainzService.cs(33,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.host" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(34,9): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.port" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(35,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.pathPrefix" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(36,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.realm" wurde ein Wert zugewiesen, der aber nie verwendet wird. +_CopyFilesMarkedCopyLocal: + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll" in "bin\Release\Core.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Databases\bin\Release\Databases.dll" in "bin\Release\Databases.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Dialogs\bin\Release\Dialogs.dll" in "bin\Release\Dialogs.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.Base\taglib-sharp.dll" in "bin\Release\taglib-sharp.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Utils.dll" in "bin\Release\Utils.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Ionic.Zip.dll" in "bin\Release\Ionic.Zip.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\DirectShowLib.dll" in "bin\Release\DirectShowLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\edtftpnet-1.2.2.dll" in "bin\Release\edtftpnet-1.2.2.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Interop.WMPLib.dll" in "bin\Release\Interop.WMPLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Interop.SHDocVw.dll" in "bin\Release\Interop.SHDocVw.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\BassRegistration.dll" in "bin\Release\BassRegistration.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Bass.Net.dll" in "bin\Release\Bass.Net.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Databases\bin\Release\CSScriptLibrary.dll" in "bin\Release\CSScriptLibrary.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\AxInterop.WMPLib.dll" in "bin\Release\AxInterop.WMPLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\MediaPortal.Support.dll" in "bin\Release\MediaPortal.Support.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\MediaPortal.Support.pdb" in "bin\Release\MediaPortal.Support.pdb" kopiert. +CopyFilesToOutputDirectory: + Die Datei wird von "obj\Release\MusicBrainzRating.dll" in "bin\Release\MusicBrainzRating.dll" kopiert. + MusicBrainzRating -> D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\bin\Release\MusicBrainzRating.dll +Done Building Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (Rebuild target(s)). +Done Building Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (Rebuild target(s)). + +Build succeeded. + +"D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (Rebuild target) (1) -> +"D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (Rebuild target) (2) -> +(CoreCompile target) -> + HelperClasses\MusicBrainzService.cs(33,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.host" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(34,9): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.port" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(35,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.pathPrefix" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(36,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.realm" wurde ein Wert zugewiesen, der aber nie verwendet wird. + + 4 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:07.97 +MpeMaker version: 1.0.8.25985 +Build started at 12:53:14 +Building "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\MusicBrainzRating.xmp2" +Output: "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\MusicBrainzRating.mpe1" +Writing UpdateXML to "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\update.xml" Added: trunk/plugins/ListeningTo/Build/filever.exe =================================================================== (Binary files differ) Property changes on: trunk/plugins/ListeningTo/Build/filever.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace ListeningToRepeater.HelperClasses +{ + class Server + { + private TcpListener tcpListener; + private Thread listenThread; + + public delegate void DoSomething(string text); + public event DoSomething OnDoSomething; + + public Server() + { + this.tcpListener = new TcpListener(IPAddress.Any, 3000); + } + + public bool IsStarted + { + get + { + if (listenThread == null) return false; + + return listenThread.IsAlive; + } + } + + private void ListenForClients() + { + this.tcpListener.Start(); + + while (true) + { + TcpClient client; + + try + { + //blocks until a client has connected to the server + client = this.tcpListener.AcceptTcpClient(); + } + catch (SocketException) + { + break; + } + + //create a thread to handle communication + //with connected client + Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm)); + clientThread.Start(client); + } + } + + private void HandleClientComm(object client) + { + TcpClient tcpClient = (TcpClient)client; + NetworkStream clientStream = tcpClient.GetStream(); + + byte[] message = new byte[4096]; + int bytesRead; + + while (true) + { + bytesRead = 0; + + try + { + //blocks until a client sends a message + bytesRead = clientStream.Read(message, 0, 4096); + } + catch + { + //a socket error has occured + break; + } + + if (bytesRead == 0) + { + //the client has disconnected from the server + break; + } + + //message has successfully been received + ASCIIEncoding encoder = new ASCIIEncoding(); + string newMsg = encoder.GetString(message, 0, bytesRead); + System.Diagnostics.Debug.WriteLine(newMsg); + + if (OnDoSomething != null) + OnDoSomething(newMsg); + } + + tcpClient.Close(); + } + + public void Start() + { + if (IsStarted) return; + + this.listenThread = new Thread(new ThreadStart(ListenForClients)); + listenThread.Start(); + } + + public void Stop() + { + if (!IsStarted) return; + + tcpListener.Stop(); + } + + + } +} Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,135 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 Team MediaPortal +// http://www.team-mediaportal.com +// +// This Program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This Program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU Make; see the file COPYING. If not, write to +// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +// http://www.gnu.org/copyleft/gpl.html + +#endregion + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Permissions; + +namespace IrssUtils +{ + /// <summary> + /// Provides access to Win32 Network functions. + /// </summary> + public static class Network + { + #region Constants + + private const int MAX_PREFERRED_LENGTH = -1; + + private const int SV_TYPE_SERVER = 2; + private const int SV_TYPE_WORKSTATION = 1; + + #endregion Constants + + #region Structures + + [StructLayout(LayoutKind.Sequential)] + private struct _SERVER_INFO_100 + { + public int sv100_platform_id; + [MarshalAs(UnmanagedType.LPWStr)] public string sv100_name; + } + + #endregion Structures + + #region Interop + + [DllImport("netapi32.dll", CharSet = CharSet.Auto, SetLastError = true), SuppressUnmanagedCodeSecurity] + private static extern int NetServerEnum( + string ServerName, // must be null + int Level, + ref IntPtr Buf, + int PrefMaxLen, + out int EntriesRead, + out int TotalEntries, + int ServerType, + string Domain, // null for login domain + out int ResumeHandle + ); + + [DllImport("netapi32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity] + private static extern int NetApiBufferFree(IntPtr pBuf); + + #endregion Interop + + #region Methods + + /// <summary> + /// Get a list of all computer names on the LAN, except for the local host. + /// </summary> + /// <param name="includeLocalMachine">Include this computer in the list.</param> + /// <returns>List of LAN computer names.</returns> + [EnvironmentPermission(SecurityAction.Demand, Read = "COMPUTERNAME")] + public static List<string> GetComputers(bool includeLocalMachine) + { + try + { + List<string> networkComputers = new List<string>(); + + IntPtr buffer = IntPtr.Zero; + IntPtr tmpBuffer = IntPtr.Zero; + int entriesRead = 0; + int totalEntries = 0; + int resHandle = 0; + int sizeofINFO = Marshal.SizeOf(typeof (_SERVER_INFO_100)); + + int ret = NetServerEnum( + null, + 100, + ref buffer, + MAX_PREFERRED_LENGTH, + out entriesRead, + out totalEntries, + SV_TYPE_WORKSTATION, // | SV_TYPE_SERVER + null, + out resHandle); + + if (ret == 0) + { + for (int i = 0; i < totalEntries; i++) + { + tmpBuffer = new IntPtr((int) buffer + (i * sizeofINFO)); + _SERVER_INFO_100 svrInfo = (_SERVER_INFO_100) Marshal.PtrToStructure(tmpBuffer, typeof (_SERVER_INFO_100)); + + if (includeLocalMachine || + !svrInfo.sv100_name.Equals(Environment.MachineName, StringComparison.OrdinalIgnoreCase)) + networkComputers.Add(svrInfo.sv100_name); + } + } + + NetApiBufferFree(buffer); + + if (networkComputers.Count > 0) + return networkComputers; + } + catch + { + } + + return null; + } + + #endregion Methods + } +} \ No newline at end of file Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,68 @@ +using System; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace IrssUtils +{ + public static class ProcessHelper + { + /// <summary> + /// Checks if the Process is already running. + /// </summary> + /// <returns>true if process is already running.</returns> + public static bool IsProcessAlreadyRunning() + { + return IsProcessAlreadyRunning(true); + } + + /// <summary> + /// Checks if the Process is already running. + /// </summary> + /// <param name="activateMainForm">If true, the mainForm will be activated, if process is already running.</param> + /// <returns>true if process is already running.</returns> + public static bool IsProcessAlreadyRunning(bool activateMainForm) + { + Process process = RunningInstance(); + if (process == null) return false; + + // activates the main form of the application + if (activateMainForm && process.MainWindowHandle != IntPtr.Zero) + ShowWindow(process.MainWindowHandle, SW_SHOWNORMAL); + + return true; + } + + public static Process RunningInstance() + { + Process current = Process.GetCurrentProcess(); + Process[] processes = Process.GetProcessesByName(current.ProcessName); + + // Loop through the running processes in with the same name + foreach (Process process in processes) + { + // Ignore the current process + if (process.Id == current.Id) continue; + + // Make sure that the process is running from the same exe file. + // todo: is this really needed??? + //if (process.MainModule.FileName == current.MainModule.FileName) + //{ + // Return the other process instance. + return process; + //} + } + + // No other instance was found, return null + return null; + } + + #region InterOp + + private const int SW_SHOWNORMAL = 1; + [DllImport("user32.dll")] + private static extern IntPtr ShowWindow(IntPtr hwnd, int nCmdShow); + + #endregion + } +} Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,100 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 Team MediaPortal +// http://www.team-mediaportal.com +// +// This Program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This Program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU Make; see the file COPYING. If not, write to +// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +// http://www.gnu.org/copyleft/gpl.html + +#endregion + +using System; +using System.Security.Permissions; +using Microsoft.Win32; + +namespace IrssUtils +{ + /// <summary> + /// Used for accessing the Windows System Registry. + /// </summary> + [RegistryPermission(SecurityAction.Demand, Read = "HKEY_CURRENT_USER\\SOFTWARE", Write = "HKEY_CURRENT_USER\\SOFTWARE" + )] + [RegistryPermission(SecurityAction.Demand, Read = "HKEY_LOCAL_MACHINE\\Software")] + public static class SystemRegistry + { + #region Constants + + private const string AutoRunPath = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; + private const string SoftwarePath = @"HKEY_LOCAL_MACHINE\Software\IR Server Suite"; + + #endregion Constants + + #region Methods + + /// <summary> + /// Get the install folder for IR Server Suite. + /// </summary> + /// <returns>String containing the Install Folder (no trailing slash).</returns> + public static string GetInstallFolder() + { + return Registry.GetValue(SoftwarePath, "Install_Dir", null) as string; + } + + /// <summary> + /// Returns a boolean value indicating if there is an auto-run in place for the specified name. + /// </summary> + /// <param name="name">Auto-run program name.</param> + /// <returns>If key of name exists return true else return false.</returns> + public static bool GetAutoRun(string name) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + string value = Registry.GetValue(AutoRunPath, name, null) as string; + + return !String.IsNullOrEmpty(value); + } + + /// <summary> + /// Setup an auto-run in the system registry. + /// </summary> + /// <param name="name">Auto-run program name.</param> + /// <param name="executablePath">Executable Path for program.</param> + public static void SetAutoRun(string name, string executablePath) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (String.IsNullOrEmpty(executablePath)) + throw new ArgumentNullException("executablePath"); + + Registry.SetValue(AutoRunPath, name, executablePath, RegistryValueKind.String); + } + + /// <summary> + /// Remove an auto-run from the system registry. + /// </summary> + /// <param name="name">Auto-run program name.</param> + public static void RemoveAutoRun(string name) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + Registry.SetValue(AutoRunPath, name, String.Empty, RegistryValueKind.String); + } + + #endregion Methods + } +} \ No newline at end of file Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,2876 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 Team MediaPortal +// http://www.team-mediaportal.com +// +// This Program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This Program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU Make; see the file COPYING. If not, write to +// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +// http://www.gnu.org/copyleft/gpl.html + +#endregion + +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace IrssUtils +{ + /// <summary> + /// Win32 native method class. + /// </summary> + [CLSCompliant(false)] + public static class Win32 + { + #region Constants + + private const int GCL_HICON = -14; + private const int GCL_HICONSM = -34; + + + private const int ICON_BIG = 1; + private const int ICON_SMALL = 0; + + /// <summary> + /// Maximum length of unmanaged Windows Path strings. + /// </summary> + private const int MAX_PATH = 260; + + /// <summary> + /// Maximum length of unmanaged Typename. + /// </summary> + private const int MAX_TYPE = 80; + + private const int MINIMIZE_ALL = 419; + private const int MINIMIZE_ALL_UNDO = 416; + private const int WPF_RESTORETOMAXIMIZED = 2; + + + /// <summary>Required to enable or disable the privileges in an access token.</summary> + private const int TOKEN_ADJUST_PRIVILEGES = 0x20; + /// <summary>Required to query an access token.</summary> + private const int TOKEN_QUERY = 0x8; + /// <summary>The privilege is enabled.</summary> + private const int SE_PRIVILEGE_ENABLED = 0x2; + /// <summary>Specifies that the function should search the system message-table resource(s) for the requested message.</summary> + private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x1000; + /// <summary>Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.</summary> + private const int EWX_FORCE = 4; + + + #endregion Constants + + #region Enumerations + + #region AppCommand enum + + /// <summary> + /// Windows Message App Commands. + /// </summary> + public enum AppCommand + { + /// <summary> + /// APPCOMMAND_BROWSER_BACKWARD + /// </summary> + APPCOMMAND_BROWSER_BACKWARD = 1, + /// <summary> + /// APPCOMMAND_BROWSER_FORWARD + /// </summary> + APPCOMMAND_BROWSER_FORWARD = 2, + /// <summary> + /// APPCOMMAND_BROWSER_REFRESH + /// </summary> + APPCOMMAND_BROWSER_REFRESH = 3, + /// <summary> + /// APPCOMMAND_BROWSER_STOP + /// </summary> + APPCOMMAND_BROWSER_STOP = 4, + /// <summary> + /// APPCOMMAND_BROWSER_SEARCH + /// </summary> + APPCOMMAND_BROWSER_SEARCH = 5, + /// <summary> + /// APPCOMMAND_BROWSER_FAVORITES + /// </summary> + APPCOMMAND_BROWSER_FAVORITES = 6, + /// <summary> + /// APPCOMMAND_BROWSER_HOME + /// </summary> + APPCOMMAND_BROWSER_HOME = 7, + /// <summary> + /// APPCOMMAND_VOLUME_MUTE + /// </summary> + APPCOMMAND_VOLUME_MUTE = 8, + /// <summary> + /// APPCOMMAND_VOLUME_DOWN + /// </summary> + APPCOMMAND_VOLUME_DOWN = 9, + /// <summary> + /// APPCOMMAND_VOLUME_UP + /// </summary> + APPCOMMAND_VOLUME_UP = 10, + /// <summary> + /// APPCOMMAND_MEDIA_NEXTTRACK + /// </summary> + APPCOMMAND_MEDIA_NEXTTRACK = 11, + /// <summary> + /// APPCOMMAND_MEDIA_PREVIOUSTRACK + /// </summary> + APPCOMMAND_MEDIA_PREVIOUSTRACK = 12, + /// <summary> + /// APPCOMMAND_MEDIA_STOP + /// </summary> + APPCOMMAND_MEDIA_STOP = 13, + /// <summary> + /// APPCOMMAND_MEDIA_PLAY_PAUSE + /// </summary> + APPCOMMAND_MEDIA_PLAY_PAUSE = 4143, + /// <summary> + /// APPCOMMAND_MEDIA_PLAY + /// </summary> + APPCOMMAND_MEDIA_PLAY = 4142, + /// <summary> + /// APPCOMMAND_MEDIA_PAUSE + /// </summary> + APPCOMMAND_MEDIA_PAUSE = 4143, + /// <summary> + /// APPCOMMAND_MEDIA_RECORD + /// </summary> + APPCOMMAND_MEDIA_RECORD = 4144, + /// <summary> + /// APPCOMMAND_MEDIA_FASTFORWARD + /// </summary> + APPCOMMAND_MEDIA_FASTFORWARD = 4145, + /// <summary> + /// APPCOMMAND_MEDIA_REWIND + /// </summary> + APPCOMMAND_MEDIA_REWIND = 4146, + /// <summary> + /// APPCOMMAND_MEDIA_CHANNEL_UP + /// </summary> + APPCOMMAND_MEDIA_CHANNEL_UP = 4147, + /// <summary> + /// APPCOMMAND_MEDIA_CHANNEL_DOWN + /// </summary> + APPCOMMAND_MEDIA_CHANNEL_DOWN = 4148, + } + + #endregion + + #region ExitWindows enum + + /// <summary> + /// Exit Windows method. + /// </summary> + [Flags] + public enum ExitWindows + { + /// <summary> + /// LogOff + /// </summary> + LogOff = 0, + /// <summary> + /// ShutDown + /// </summary> + ShutDown = 1, + /// <summary> + /// Reboot + /// </summary> + Reboot = 2, + /// <summary> + /// PowerOff + /// </summary> + PowerOff = 8, + } + + #endregion + + #region GWL enum + + /// <summary> + /// GWL. + /// </summary> + public enum GWL + { + /// <summary> + /// WndProc. + /// </summary> + GWL_WNDPROC = (-4), + /// <summary> + /// HInstance. + /// </summary> + GWL_HINSTANCE = (-6), + /// <summary> + /// hWnd Parent. + /// </summary> + GWL_HWNDPARENT = (-8), + /// <summary> + /// Style. + /// </summary> + GWL_STYLE = (-16), + /// <summary> + /// Extended Style. + /// </summary> + GWL_EXSTYLE = (-20), + /// <summary> + /// User Data. + /// </summary> + GWL_USERDATA = (-21), + /// <summary> + /// ID. + /// </summary> + GWL_ID = (-12), + } + + #endregion + + #region SendMessageTimeoutFlags enum + + /// <summary> + /// Send Windows Message with Timeout Flags. + /// </summary> + [Flags] + public enum SendMessageTimeoutFlags + { + /// <summary> + /// Normal. + /// </summary> + SMTO_NORMAL = 0x0000, + /// <summary> + /// Block. + /// </summary> + SMTO_BLOCK = 0x0001, + /// <summary> + /// Abort if hung. + /// </summary> + SMTO_ABORTIFHUNG = 0x0002, + /// <summary> + /// To timeout if not hung. + /// </summary> + SMTO_NOTIMEOUTIFNOTHUNG = 0x0008, + } + + #endregion + + #region ShutdownReasons enum + + /// <summary> + /// Shutdown Reasons. + /// </summary> + [Flags] + public enum ShutdownReasons + { + /// <summary> + /// MajorApplication + /// </summary> + MajorApplication = 0x00040000, + /// <summary> + /// MajorHardware + /// </summary> + MajorHardware = 0x00010000, + /// <summary> + /// MajorLegacyApi + /// </summary> + MajorLegacyApi = 0x00070000, + /// <summary> + /// MajorOperatingSystem + /// </summary> + MajorOperatingSystem = 0x00020000, + /// <summary> + /// MajorOther + /// </summary> + MajorOther = 0x00000000, + /// <summary> + /// MajorPower + /// </summary> + MajorPower = 0x00060000, + /// <summary> + /// MajorSoftware + /// </summary> + MajorSoftware = 0x00030000, + /// <summary> + /// MajorSystem + /// </summary> + MajorSystem = 0x00050000, + + /// <summary> + /// MinorBlueScreen + /// </summary> + MinorBlueScreen = 0x0000000F, + /// <summary> + /// MinorCordUnplugged + /// </summary> + MinorCordUnplugged = 0x0000000b, + /// <summary> + /// MinorDisk + /// </summary> + MinorDisk = 0x00000007, + /// <summary> + /// MinorEnvironment + /// </summary> + MinorEnvironment = 0x0000000c, + /// <summary> + /// MinorHardwareDriver + /// </summary> + MinorHardwareDriver = 0x0000000d, + /// <summary> + /// MinorHotfix + /// </summary> + MinorHotfix = 0x00000011, + /// <summary> + /// MinorHung + /// </summary> + MinorHung = 0x00000005, + /// <summary> + /// MinorInstallation + /// </summary> + MinorInstallation = 0x00000002, + /// <summary> + /// MinorMaintenance + /// </summary> + MinorMaintenance = 0x00000001, + /// <summary> + /// MinorMMC + /// </summary> + MinorMMC = 0x00000019, + /// <summary> + /// MinorNetworkConnectivity + /// </summary> + MinorNetworkConnectivity = 0x00000014, + /// <summary> + /// MinorNetworkCard + /// </summary> + MinorNetworkCard = 0x00000009, + /// <summary> + /// MinorOther + /// </summary> + MinorOther = 0x00000000, + /// <summary> + /// MinorOtherDriver + /// </summary> + MinorOtherDriver = 0x0000000e, + /// <summary> + /// MinorPowerSupply + /// </summary> + MinorPowerSupply = 0x0000000a, + /// <summary> + /// MinorProcessor + /// </summary> + MinorProcessor = 0x00000008, + /// <summary> + /// MinorReconfig + /// </summary> + MinorReconfig = 0x00000004, + /// <summary> + /// MinorSecurity + /// </summary> + MinorSecurity = 0x00000013, + /// <summary> + /// MinorSecurityFix + /// </summary> + MinorSecurityFix = 0x00000012, + /// <summary> + /// MinorSecurityFixUninstall + /// </summary> + MinorSecurityFixUninstall = 0x00000018, + /// <summary> + /// MinorServicePack + /// </summary> + MinorServicePack = 0x00000010, + /// <summary> + /// MinorServicePackUninstall + /// </summary> + MinorServicePackUninstall = 0x00000016, + /// <summary> + /// MinorTermSrv + /// </summary> + MinorTermSrv = 0x00000020, + /// <summary> + /// MinorUnstable + /// </summary> + MinorUnstable = 0x00000006, + /// <summary> + /// MinorUpgrade + /// </summary> + MinorUpgrade = 0x00000003, + /// <summary> + /// MinorWMI + /// </summary> + MinorWMI = 0x00000015, + + /// <summary> + /// FlagUserDefined + /// </summary> + FlagUserDefined = 0x40000000, + + //FlagPlanned = 0x80000000, + } + + #endregion + + #region SysCommand enum + + /// <summary> + /// Windows Message System Commands. + /// </summary> + public enum SysCommand + { + /// <summary> + /// SC_SIZE + /// </summary> + SC_SIZE = 0xF000, + /// <summary> + /// SC_MOVE + /// </summary> + SC_MOVE = 0xF010, + /// <summary> + /// SC_MINIMIZE + /// </summary> + SC_MINIMIZE = 0xF020, + /// <summary> + /// SC_MAXIMIZE + /// </summary> + SC_MAXIMIZE = 0xF030, + /// <summary> + /// SC_NEXTWINDOW + /// </summary> + SC_NEXTWINDOW = 0xF040, + /// <summary> + /// SC_PREVWINDOW + /// </summary> + SC_PREVWINDOW = 0xF050, + /// <summary> + /// SC_CLOSE + /// </summary> + SC_CLOSE = 0xF060, + /// <summary> + /// SC_VSCROLL + /// </summary> + SC_VSCROLL = 0xF070, + /// <summary> + /// SC_HSCROLL + /// </summary> + SC_HSCROLL = 0xF080, + /// <summary> + /// SC_MOUSEMENU + /// </summary> + SC_MOUSEMENU = 0xF090, + /// <summary> + /// SC_KEYMENU + /// </summary> + SC_KEYMENU = 0xF100, + /// <summary> + /// SC_ARRANGE + /// </summary> + SC_ARRANGE = 0xF110, + /// <summary> + /// SC_RESTORE + /// </summary> + SC_RESTORE = 0xF120, + /// <summary> + /// SC_TASKLIST + /// </summary> + SC_TASKLIST = 0xF130, + /// <summary> + /// SC_SCREENSAVE + /// </summary> + SC_SCREENSAVE = 0xF140, + /// <summary> + /// SC_HOTKEY + /// </summary> + SC_HOTKEY = 0xF150, + /// <summary> + /// SC_DEFAULT + /// </summary> + SC_DEFAULT = 0xF160, + /// <summary> + /// SC_MONITORPOWER + /// </summary> + SC_MONITORPOWER = 0xF170, + /// <summary> + /// SC_CONTEXTHELP + /// </summary> + SC_CONTEXTHELP = 0xF180, + /// <summary> + /// SC_SEPARATOR + /// </summary> + SC_SEPARATOR = 0xF00F, + + /// <summary> + /// SCF_ISSECURE + /// </summary> + SCF_ISSECURE = 0x00000001, + + /// <summary> + /// SC_ICON + /// </summary> + SC_ICON = SC_MINIMIZE, + /// <summary> + /// SC_ZOOM + /// </summary> + SC_ZOOM = SC_MAXIMIZE, + } + + #endregion + + #region WindowExStyles enum + + /// <summary> + /// Win32 Window Extended Styles. + /// </summary> + [Flags] + public enum WindowExStyles + { + /// <summary> + /// Specifies that a window created with this style accepts drag-drop files. + /// </summary> + WS_EX_ACCEPTFILES = 0x00000010, + /// <summary> + /// Forces a top-level window onto the taskbar when the window is visible. + /// </summary> + WS_EX_APPWINDOW = 0x00040000, + /// <summary> + /// Specifies that a window has a border with a sunken edge. + /// </summary> + WS_EX_CLIENTEDGE = 0x00000200, + /// <summary> + /// Windows XP: Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. + /// </summary> + WS_EX_COMPOSITED = 0x02000000, + /// <summary> + /// Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window. + /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. + /// </summary> + WS_EX_CONTEXTHELP = 0x00000400, + /// <summary> + /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. + /// </summary> + WS_EX_CONTROLPARENT = 0x00010000, + /// <summary> + /// Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter. + /// </summary> + WS_EX_DLGMODALFRAME = 0x00000001, + /// <summary> + /// Windows 2000/XP: Creates a layered window. Be aware that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. + /// </summary> + WS_EX_LAYERED = 0x00080000, + /// <summary> + /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. + /// </summary> + WS_EX_LAYOUTRTL = 0x00400000, + /// <summary> + /// Creates a window that has generic left-aligned properties. This is the default. + /// </summary> + WS_EX_LEFT = 0x00000000, + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored. + /// </summary> + WS_EX_LEFTSCROLLBAR = 0x00004000, + /// <summary> + /// The window text is displayed using left-to-right reading-order properties. This is the default. + /// </summary> + WS_EX_LTRREADING = 0x00000000, + /// <summary> + /// Creates a multiple-document interface (MDI) child window. + /// </summary> + WS_EX_MDICHILD = 0x00000040, + /// <summary> + /// Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. + /// To activate the window, use the SetActiveWindow or SetForegroundWindow function. + /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style. + /// </summary> + WS_EX_NOACTIVATE = 0x08000000, + /// <summary> + /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows. + /// </summary> + WS_EX_NOINHERITLAYOUT = 0x00100000, + /// <summary> + /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed. + /// </summary> + WS_EX_NOPARENTNOTIFY = 0x00000004, + /// <summary> + /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles. + /// </summary> + WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE, + /// <summary> + /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles. + /// </summary> + WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, + /// <summary> + /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored. + /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. + /// </summary> + WS_EX_RIGHT = 0x00001000, + /// <summary> + /// Vertical scroll bar (if present) is to the right of the client area. This is the default. + /// </summary> + WS_EX_RIGHTSCROLLBAR = 0x00000000, + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored. + /// </summary> + WS_EX_RTLREADING = 0x00002000, + /// <summary> + /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input. + /// </summary> + WS_EX_STATICEDGE = 0x00020000, + /// <summary> + /// Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE. + /// </summary> + WS_EX_TOOLWINDOW = 0x00000080, + /// <summary> + /// Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function. + /// </summary> + WS_EX_TOPMOST = 0x00000008, + /// <summary> + /// Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted. + /// To achieve transparency without these restrictions, use the SetWindowRgn function. + /// </summary> + WS_EX_TRANSPARENT = 0x00000020, + /// <summary> + /// Specifies that a window has a border with a raised edge. + /// </summary> + WS_EX_WINDOWEDGE = 0x00000100 + } + + #endregion + + #region WindowsMessage enum + + /// <summary> + /// Windows Message types. + /// </summary> + public enum WindowsMessage + { + /// <summary> + /// WM_ACTIVATE + /// </summary> + WM_ACTIVATE = 0x6, + /// <summary> + /// WM_ACTIVATEAPP + /// </summary> + WM_ACTIVATEAPP = 0x1C, + /// <summary> + /// WM_AFXFIRST + /// </summary> + WM_AFXFIRST = 0x360, + /// <summary> + /// WM_AFXLAST + /// </summary> + WM_AFXLAST = 0x37F, + /// <summary> + /// WM_APP + /// </summary> + WM_APP = 0x8000, + /// <summary> + /// WM_APPCOMMAND + /// </summary> + WM_APPCOMMAND = 0x319, + /// <summary> + /// WM_ASKCBFORMATNAME + /// </summary> + WM_ASKCBFORMATNAME = 0x30C, + /// <summary> + /// WM_CANCELJOURNAL + /// </summary> + WM_CANCELJOURNAL = 0x4B, + /// <summary> + /// WM_CANCELMODE + /// </summary> + WM_CANCELMODE = 0x1F, + /// <summary> + /// WM_CAPTURECHANGED + /// </summary> + WM_CAPTURECHANGED = 0x215, + /// <summary> + /// WM_CHANGECBCHAIN + /// </summary> + WM_CHANGECBCHAIN = 0x30D, + /// <summary> + /// WM_CHAR + /// </summary> + WM_CHAR = 0x102, + /// <summary> + /// + /// </summary> + WM_CHARTOITEM = 0x2F, + /// <summary> + /// + /// </summary> + WM_CHILDACTIVATE = 0x22, + /// <summary> + /// + /// </summary> + WM_CLEAR = 0x303, + /// <summary> + /// + /// </summary> + WM_CLOSE = 0x10, + /// <summary> + /// + /// </summary> + WM_COMMAND = 0x111, + /// <summary> + /// + /// </summary> + WM_COMPACTING = 0x41, + /// <summary> + /// + /// </summary> + WM_COMPAREITEM = 0x39, + /// <summary> + /// + /// </summary> + WM_CONTEXTMENU = 0x7B, + /// <summary> + /// + /// </summary> + WM_COPY = 0x301, + /// <summary> + /// + /// </summary> + WM_COPYDATA = 0x4A, + /// <summary> + /// + /// </summary> + WM_CREATE = 0x1, + /// <summary> + /// + /// </summary> + WM_CTLCOLORBTN = 0x135, + /// <summary> + /// + /// </summary> + WM_CTLCOLORDLG = 0x136, + /// <summary> + /// + /// </summary> + WM_CTLCOLOREDIT = 0x133, + /// <summary> + /// + /// </summary> + WM_CTLCOLORLISTBOX = 0x134, + /// <summary> + /// + /// </summary> + WM_CTLCOLORMSGBOX = 0x132, + /// <summary> + /// + /// </summary> + WM_CTLCOLORSCROLLBAR = 0x137, + /// <summary> + /// + /// </summary> + WM_CTLCOLORSTATIC = 0x138, + /// <summary> + /// + /// </summary> + WM_CUT = 0x300, + /// <summary> + /// + /// </summary> + WM_DEADCHAR = 0x103, + /// <summary> + /// + /// </summary> + WM_DELETEITEM = 0x2D, + /// <summary> + /// + /// </summary> + WM_DESTROY = 0x2, + /// <summary> + /// + /// </summary> + WM_DESTROYCLIPBOARD = 0x307, + /// <summary> + /// + /// </summary> + WM_DEVICECHANGE = 0x219, + /// <summary> + /// + /// </summary> + WM_DEVMODECHANGE = 0x1B, + /// <summary> + /// + /// </summary> + WM_DISPLAYCHANGE = 0x7E, + /// <summary> + /// + /// </summary> + WM_DRAWCLIPBOARD = 0x308, + /// <summary> + /// + /// </summary> + WM_DRAWITEM = 0x2B, + /// <summary> + /// + /// </summary> + WM_DROPFILES = 0x233, + /// <summary> + /// + /// </summary> + WM_ENABLE = 0xA, + /// <summary> + /// + /// </summary> + WM_ENDSESSION = 0x16, + /// <summary> + /// + /// </summary> + WM_ENTERIDLE = 0x121, + /// <summary> + /// + /// </summary> + WM_ENTERMENULOOP = 0x211, + /// <summary> + /// + /// </summary> + WM_ENTERSIZEMOVE = 0x231, + /// <summary> + /// + /// </summary> + WM_ERASEBKGND = 0x14, + /// <summary> + /// + /// </summary> + WM_EXITMENULOOP = 0x212, + /// <summary> + /// + /// </summary> + WM_EXITSIZEMOVE = 0x232, + /// <summary> + /// + /// </summary> + WM_FONTCHANGE = 0x1D, + /// <summary> + /// + /// </summary> + WM_GETDLGCODE = 0x87, + /// <summary> + /// + /// </summary> + WM_GETFONT = 0x31, + /// <summary> + /// + /// </summary> + WM_GETHOTKEY = 0x33, + /// <summary> + /// + /// </summary> + WM_GETICON = 0x7F, + /// <summary> + /// + /// </summary> + WM_GETMINMAXINFO = 0x24, + /// <summary> + /// + /// </summary> + WM_GETOBJECT = 0x3D, + /// <summary> + /// + /// </summary> + WM_GETSYSMENU = 0x313, + /// <summary> + /// + /// </summary> + WM_GETTEXT = 0xD, + /// <summary> + /// + /// </summary> + WM_GETTEXTLENGTH = 0xE, + /// <summary> + /// + /// </summary> + WM_HANDHELDFIRST = 0x358, + /// <summary> + /// + /// </summary> + WM_HANDHELDLAST = 0x35F, + /// <summary> + /// + /// </summary> + WM_HELP = 0x53, + /// <summary> + /// + /// </summary> + WM_HOTKEY = 0x312, + /// <summary> + /// + /// </summary> + WM_HSCROLL = 0x114, + /// <summary> + /// + /// </summary> + WM_HSCROLLCLIPBOARD = 0x30E, + /// <summary> + /// + /// </summary> + WM_ICONERASEBKGND = 0x27, + /// <summary> + /// + /// </summary> + WM_IME_CHAR = 0x286, + /// <summary> + /// + /// </summary> + WM_IME_COMPOSITION = 0x10F, + /// <summary> + /// + /// </summary> + WM_IME_COMPOSITIONFULL = 0x284, + /// <summary> + /// + /// </summary> + WM_IME_CONTROL = 0x283, + /// <summary> + /// + /// </summary> + WM_IME_ENDCOMPOSITION = 0x10E, + /// <summary> + /// + /// </summary> + WM_IME_KEYDOWN = 0x290, + /// <summary> + /// + /// </summary> + WM_IME_KEYLAST = 0x10F, + /// <summary> + /// + /// </summary> + WM_IME_KEYUP = 0x291, + /// <summary> + /// + /// </summary> + WM_IME_NOTIFY = 0x282, + /// <summary> + /// + /// </summary> + WM_IME_REQUEST = 0x288, + /// <summary> + /// + /// </summary> + WM_IME_SELECT = 0x285, + /// <summary> + /// + /// </summary> + WM_IME_SETCONTEXT = 0x281, + /// <summary> + /// + /// </summary> + WM_IME_STARTCOMPOSITION = 0x10D, + /// <summary> + /// + /// </summary> + WM_INITDIALOG = 0x110, + /// <summary> + /// + /// </summary> + WM_INITMENU = 0x116, + /// <summary> + /// + /// </summary> + WM_INITMENUPOPUP = 0x117, + /// <summary> + /// + /// </summary> + WM_INPUTLANGCHANGE = 0x51, + /// <summary> + /// + /// </summary> + WM_INPUTLANGCHANGEREQUEST = 0x50, + /// <summary> + /// + /// </summary> + WM_KEYDOWN = 0x100, + /// <summary> + /// + /// </summary> + WM_KEYFIRST = 0x100, + /// <summary> + /// + /// </summary> + WM_KEYLAST = 0x108, + /// <summary> + /// + /// </summary> + WM_KEYUP = 0x101, + /// <summary> + /// + /// </summary> + WM_KILLFOCUS = 0x8, + /// <summary> + /// + /// </summary> + WM_LBUTTONDBLCLK = 0x203, + /// <summary> + /// + /// </summary> + WM_LBUTTONDOWN = 0x201, + /// <summary> + /// + /// </summary> + WM_LBUTTONUP = 0x202, + /// <summary> + /// + /// </summary> + WM_MBUTTONDBLCLK = 0x209, + /// <summary> + /// + /// </summary> + WM_MBUTTONDOWN = 0x207, + /// <summary> + /// + /// </summary> + WM_MBUTTONUP = 0x208, + /// <summary> + /// + /// </summary> + WM_MDIACTIVATE = 0x222, + /// <summary> + /// + /// </summary> + WM_MDICASCADE = 0x227, + /// <summary> + /// + /// </summary> + WM_MDICREATE = 0x220, + /// <summary> + /// + /// </summary> + WM_MDIDESTROY = 0x221, + /// <summary> + /// + /// </summary> + WM_MDIGETACTIVE = 0x229, + /// <summary> + /// + /// </summary> + WM_MDIICONARRANGE = 0x228, + /// <summary> + /// + /// </summary> + WM_MDIMAXIMIZE = 0x225, + /// <summary> + /// + /// </summary> + WM_MDINEXT = 0x224, + /// <summary> + /// + /// </summary> + WM_MDIREFRESHMENU = 0x234, + /// <summary> + /// + /// </summary> + WM_MDIRESTORE = 0x223, + /// <summary> + /// + /// </summary> + WM_MDISETMENU = 0x230, + /// <summary> + /// + /// </summary> + WM_MDITILE = 0x226, + /// <summary> + /// + /// </summary> + WM_MEASUREITEM = 0x2C, + /// <summary> + /// + /// </summary> + WM_MENUCHAR = 0x120, + /// <summary> + /// + /// </summary> + WM_MENUCOMMAND = 0x126, + /// <summary> + /// + /// </summary> + WM_MENUDRAG = 0x123, + /// <summary> + /// + /// </summary> + WM_MENUGETOBJECT = 0x124, + /// <summary> + /// + /// </summary> + WM_MENURBUTTONUP = 0x122, + /// <summary> + /// + /// </summary> + WM_MENUSELECT = 0x11F, + /// <summary> + /// + /// </summary> + WM_MOUSEACTIVATE = 0x21, + /// <summary> + /// + /// </summary> + WM_MOUSEFIRST = 0x200, + /// <summary> + /// + /// </summary> + WM_MOUSEHOVER = 0x2A1, + /// <summary> + /// + /// </summary> + WM_MOUSELAST = 0x20A, + /// <summary> + /// + /// </summary> + WM_MOUSELEAVE = 0x2A3, + /// <summary> + /// + /// </summary> + WM_MOUSEMOVE = 0x200, + /// <summary> + /// + /// </summary> + WM_MOUSEWHEEL = 0x20A, + /// <summary> + /// + /// </summary> + WM_MOVE = 0x3, + /// <summary> + /// + /// </summary> + WM_MOVING = 0x216, + /// <summary> + /// + /// </summary> + WM_NCACTIVATE = 0x86, + /// <summary> + /// + /// </summary> + WM_NCCALCSIZE = 0x83, + /// <summary> + /// + /// </summary> + WM_NCCREATE = 0x81, + /// <summary> + /// + /// </summary> + WM_NCDESTROY = 0x82, + /// <summary> + /// + /// </summary> + WM_NCHITTEST = 0x84, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONDBLCLK = 0xA3, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONDOWN = 0xA1, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONUP = 0xA2, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONDBLCLK = 0xA9, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONDOWN = 0xA7, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONUP = 0xA8, + /// <summary> + /// + /// </summary> + WM_NCMOUSEHOVER = 0x2A0, + /// <summary> + /// + /// </summary> + WM_NCMOUSELEAVE = 0x2A2, + /// <summary> + /// + /// </summary> + WM_NCMOUSEMOVE = 0xA0, + /// <summary> + /// + /// </summary> + WM_NCPAINT = 0x85, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONDBLCLK = 0xA6, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONDOWN = 0xA4, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONUP = 0xA5, + /// <summary> + /// + /// </summary> + WM_NEXTDLGCTL = 0x28, + /// <summary> + /// + /// </summary> + WM_NEXTMENU = 0x213, + /// <summary> + /// + /// </summary> + WM_NOTIFY = 0x4E, + /// <summary> + /// + /// </summary> + WM_NOTIFYFORMAT = 0x55, + /// <summary> + /// + /// </summary> + WM_NULL = 0x0, + /// <summary> + /// + /// </summary> + WM_PAINT = 0xF, + /// <summary> + /// + /// </summary> + WM_PAINTCLIPBOARD = 0x309, + /// <summary> + /// + /// </summary> + WM_PAINTICON = 0x26, + /// <summary> + /// + /// </summary> + WM_PALETTECHANGED = 0x311, + /// <summary> + /// + /// </summary> + WM_PALETTEISCHANGING = 0x310, + /// <summary> + /// + /// </summary> + WM_PARENTNOTIFY = 0x210, + /// <summary> + /// + /// </summary> + WM_PASTE = 0x302, + /// <summary> + /// + /// </summary> + WM_PENWINFIRST = 0x380, + /// <summary> + /// + /// </summary> + WM_PENWINLAST = 0x38F, + /// <summary> + /// + /// </summary> + WM_POWER = 0x48, + /// <summary> + /// + /// </summary> + WM_PRINT = 0x317, + /// <summary> + /// + /// </summary> + WM_PRINTCLIENT = 0x318, + /// <summary> + /// + /// </summary> + WM_QUERYDRAGICON = 0x37, + /// <summary> + ... [truncated message content] |