Browse Source

mxg:包含文件

mengxiangge 6 years ago
parent
commit
8d1f176d38
100 changed files with 25309 additions and 0 deletions
  1. 97 0
      PackageUpdater/Microsoft.Drawing/Classes/ClipGraphics.cs
  2. 356 0
      PackageUpdater/Microsoft.Drawing/Classes/DoubleBufferedGraphics.cs
  3. 132 0
      PackageUpdater/Microsoft.Drawing/Classes/LockedBitmapData.cs
  4. 49 0
      PackageUpdater/Microsoft.Drawing/Classes/PixelOffsetModeGraphics.cs
  5. 49 0
      PackageUpdater/Microsoft.Drawing/Classes/SmoothingModeGraphics.cs
  6. 49 0
      PackageUpdater/Microsoft.Drawing/Classes/TextRenderingHintGraphics.cs
  7. 69 0
      PackageUpdater/Microsoft.Drawing/Classes/TranslateGraphics.cs
  8. 42 0
      PackageUpdater/Microsoft.Drawing/Interfaces/IWindow.cs
  9. 76 0
      PackageUpdater/Microsoft.Drawing/Microsoft.Drawing.csproj
  10. 35 0
      PackageUpdater/Microsoft.Drawing/Properties/AssemblyInfo.cs
  11. 486 0
      PackageUpdater/Microsoft.Drawing/Structs/ColorVector.cs
  12. 207 0
      PackageUpdater/Microsoft.Drawing/Structs/ColorVectorConverter.cs
  13. 115 0
      PackageUpdater/Microsoft.Drawing/Util/BufferedGraphicsEx.cs
  14. 91 0
      PackageUpdater/Microsoft.Drawing/Util/GraphicsEx.cs
  15. 47 0
      PackageUpdater/Microsoft.Drawing/Util/PointEx.cs
  16. 264 0
      PackageUpdater/Microsoft.Drawing/Util/RectangleEx.cs
  17. 55 0
      PackageUpdater/Microsoft.Drawing/Util/SizeEx.cs
  18. 155 0
      PackageUpdater/Microsoft.Win32/Microsoft.Win32.csproj
  19. 15 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/AC_SRC.cs
  20. 43 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/AW.cs
  21. 19 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/BKMODE.cs
  22. 17 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/BOOLEAN.cs
  23. 15 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CCHILDREN.cs
  24. 59 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CS.cs
  25. 11 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CW.cs
  26. 55 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DCX.cs
  27. 73 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DS.cs
  28. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DriverStringOptions.cs
  29. 17269 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ERROR.cs
  30. 31 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/FLASHW.cs
  31. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/FORMAT_MESSAGE.cs
  32. 19 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GA.cs
  33. 51 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GCL.cs
  34. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GRADIENT_FILL.cs
  35. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GW.cs
  36. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GWL.cs
  37. 13 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HANDLE.cs
  38. 17 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HKL.cs
  39. 123 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HT.cs
  40. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HWND.cs
  41. 11 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/INFINITE.cs
  42. 19 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/INPUT.cs
  43. 49 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/IOC.cs
  44. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/KEYEVENTF.cs
  45. 27 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/KLF.cs
  46. 25 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MA.cs
  47. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MK.cs
  48. 19 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MMIO.cs
  49. 17 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MOUSEDATA.cs
  50. 63 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MOUSEEVENTF.cs
  51. 13 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/NULL.cs
  52. 63 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/OBJID.cs
  53. 59 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/RDW.cs
  54. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/RGN.cs
  55. 67 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ROP.cs
  56. 85 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SB.cs
  57. 66 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SBM.cs
  58. 107 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SC.cs
  59. 27 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SCR.cs
  60. 31 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SIF.cs
  61. 102 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SIO.cs
  62. 387 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SM.cs
  63. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SND.cs
  64. 11 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SOMAXCONN.cs
  65. 135 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SS.cs
  66. 139 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/STATE_SYSTEM.cs
  67. 59 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SW.cs
  68. 67 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SWP.cs
  69. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTDT.cs
  70. 43 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTF.cs
  71. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTI.cs
  72. 143 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTM.cs
  73. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTN.cs
  74. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTS.cs
  75. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ULW.cs
  76. 847 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/VK.cs
  77. 19 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WAVE_FORMAT.cs
  78. 948 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WM.cs
  79. 122 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WS.cs
  80. 49 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WSAID.cs
  81. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WSA_FLAG.cs
  82. 116 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WS_EX.cs
  83. 31 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_ACCEPTEX.cs
  84. 29 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_CONNECTEX.cs
  85. 23 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_DISCONNECTEX.cs
  86. 75 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/BLENDFUNCTION.cs
  87. 54 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/COMBOBOXINFO.cs
  88. 31 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/COPYDATASTRUCT.cs
  89. 35 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/CURSORINFO.cs
  90. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/FLASHWINFO.cs
  91. 37 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/GRADIENT_RECT.cs
  92. 43 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/GRADIENT_TRIANGLE.cs
  93. 30 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/HARDWAREINPUT.cs
  94. 38 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/INPUT.cs
  95. 39 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/KEYBDINPUT.cs
  96. 38 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MINMAXINFO.cs
  97. 38 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MMCKINFO.cs
  98. 43 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MOUSEINPUT.cs
  99. 31 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/NMHDR.cs
  100. 0 0
      PackageUpdater/Microsoft.Win32/NativeMethods/Structs/PAINTSTRUCT.cs

+ 97 - 0
PackageUpdater/Microsoft.Drawing/Classes/ClipGraphics.cs

@@ -0,0 +1,97 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 暂时修改绘图剪切区,释放时改为原来剪切区
+    /// </summary>
+    public sealed class ClipGraphics : DisposableMini
+    {
+        private Region m_OldClip;           //原始的剪切区
+        private Graphics m_Graphics;        //要修改剪切区的绘图对象
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="g">提供剪切区的绘图对象</param>
+        /// <param name="combineMode">组合模式</param>
+        public ClipGraphics(Graphics graphics, Graphics g, CombineMode combineMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldClip = graphics.Clip;
+            graphics.SetClip(g, combineMode);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="path">提供剪切区的路径</param>
+        /// <param name="combineMode">组合模式</param>
+        public ClipGraphics(Graphics graphics, GraphicsPath path, CombineMode combineMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldClip = graphics.Clip;
+            graphics.SetClip(path, combineMode);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="rect">提供剪切区的矩形</param>
+        /// <param name="combineMode">组合模式</param>
+        public ClipGraphics(Graphics graphics, Rectangle rect, CombineMode combineMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldClip = graphics.Clip;
+            graphics.SetClip(rect, combineMode);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="rect">提供剪切区的矩形</param>
+        /// <param name="combineMode">组合模式</param>
+        public ClipGraphics(Graphics graphics, RectangleF rect, CombineMode combineMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldClip = graphics.Clip;
+            graphics.SetClip(rect, combineMode);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="region">提供剪切区的图形</param>
+        /// <param name="combineMode">组合模式</param>
+        public ClipGraphics(Graphics graphics, Region region, CombineMode combineMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldClip = graphics.Clip;
+            graphics.SetClip(region, combineMode);
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Graphics != null)
+            {
+                this.m_Graphics.SetClip(this.m_OldClip, CombineMode.Replace);
+                this.m_Graphics = null;
+            }
+            if (this.m_OldClip != null)
+            {
+                this.m_OldClip.Dispose();
+                this.m_OldClip = null;
+            }
+        }
+    }
+}

+ 356 - 0
PackageUpdater/Microsoft.Drawing/Classes/DoubleBufferedGraphics.cs

@@ -0,0 +1,356 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Windows.Forms;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 双缓冲区
+    /// </summary>
+    public class DoubleBufferedGraphics : Disposable
+    {
+        private const int PRE_ALLOC = 10;               //预分配大小
+        private bool m_IsCreating;                      //是否正在创建缓冲区
+        private IWindow m_Owner;                        //拥有该缓冲区的窗口
+        private Graphics m_OwnerGraphics;               //拥有该缓冲区的窗口的绘图画面
+        private BufferedGraphics m_BufferedGraphics;    //缓冲区
+
+
+        #region 构造函数
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="owner">拥有者</param>
+        public DoubleBufferedGraphics(IWindow owner)
+        {
+            this.m_Owner = owner;
+        }
+
+        #endregion
+
+
+        #region 字段属性
+
+        private CompositingMode m_CompositingMode = CompositingMode.SourceOver;
+        /// <summary>
+        /// 获取一个值,该值指定如何将合成图像绘制到此 System.Drawing.Graphics。
+        /// </summary>
+        public CompositingMode CompositingMode
+        {
+            get
+            {
+                return this.m_CompositingMode;
+            }
+            set
+            {
+                if (value != this.m_CompositingMode)
+                {
+                    this.m_CompositingMode = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.CompositingMode = value;
+                }
+            }
+        }
+
+        private CompositingQuality m_CompositingQuality = CompositingQuality.Default;
+        /// <summary>
+        /// 获取或设置绘制到此 System.Drawing.Graphics 的合成图像的呈现质量。
+        /// </summary>
+        public CompositingQuality CompositingQuality
+        {
+            get
+            {
+                return this.m_CompositingQuality;
+            }
+            set
+            {
+                if (value != this.m_CompositingQuality)
+                {
+                    this.m_CompositingQuality = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.CompositingQuality = value;
+                }
+            }
+        }
+
+        private InterpolationMode m_InterpolationMode = InterpolationMode.Bilinear;
+        /// <summary>
+        /// 获取或设置与此 System.Drawing.Graphics 关联的插补模式。
+        /// </summary>
+        public InterpolationMode InterpolationMode
+        {
+            get
+            {
+                return this.m_InterpolationMode;
+            }
+            set
+            {
+                if (value != this.m_InterpolationMode)
+                {
+                    this.m_InterpolationMode = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.InterpolationMode = value;
+                }
+            }
+        }
+
+        private PixelOffsetMode m_PixelOffsetMode = PixelOffsetMode.Default;
+        /// <summary>
+        /// 获取或设置一个值,该值指定在呈现此 System.Drawing.Graphics 的过程中像素如何偏移。
+        /// </summary>
+        public PixelOffsetMode PixelOffsetMode
+        {
+            get
+            {
+                return this.m_PixelOffsetMode;
+            }
+            set
+            {
+                if (value != this.m_PixelOffsetMode)
+                {
+                    this.m_PixelOffsetMode = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.PixelOffsetMode = value;
+                }
+            }
+        }
+
+        private SmoothingMode m_SmoothingMode = SmoothingMode.None;
+        /// <summary>
+        /// 获取或设置此 System.Drawing.Graphics 的呈现质量。
+        /// </summary>
+        public SmoothingMode SmoothingMode
+        {
+            get
+            {
+                return this.m_SmoothingMode;
+            }
+            set
+            {
+                if (value != this.m_SmoothingMode)
+                {
+                    this.m_SmoothingMode = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.SmoothingMode = value;
+                }
+            }
+        }
+
+        private int m_TextContrast = 4;
+        /// <summary>
+        /// 获取或设置呈现文本的灰度校正值。
+        /// </summary>
+        public int TextContrast
+        {
+            get
+            {
+                return this.m_TextContrast;
+            }
+            set
+            {
+                if (value != this.m_TextContrast)
+                {
+                    this.m_TextContrast = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.TextContrast = value;
+                }
+            }
+        }
+
+        private TextRenderingHint m_TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
+        /// <summary>
+        /// 获取或设置与此 System.Drawing.Graphics 关联的文本的呈现模式。
+        /// </summary>
+        public TextRenderingHint TextRenderingHint
+        {
+            get
+            {
+                return this.m_TextRenderingHint;
+            }
+            set
+            {
+                if (value != this.m_TextRenderingHint)
+                {
+                    this.m_TextRenderingHint = value;
+                    if (this.m_BufferedGraphics != null)
+                        this.m_BufferedGraphics.Graphics.TextRenderingHint = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// 缓冲区绘图对象
+        /// </summary>
+        public Graphics Graphics
+        {
+            get
+            {
+                return this.m_BufferedGraphics.Graphics;
+            }
+        }
+
+        private Size m_Size = Size.Empty;
+        /// <summary>
+        /// 获取缓冲区的虚拟画布大小。
+        /// </summary>
+        public Size Size
+        {
+            get
+            {
+                return this.m_Size;
+            }
+        }
+
+        #endregion
+
+
+        #region 私有方法
+
+        /// <summary>
+        /// 初始化绘图画面
+        /// </summary>
+        /// <param name="g">绘图画面</param>
+        private void InitGraphics(Graphics g)
+        {
+            g.CompositingMode = this.m_CompositingMode;
+            g.CompositingQuality = this.m_CompositingQuality;
+            g.InterpolationMode = this.m_InterpolationMode;
+            g.PixelOffsetMode = this.m_PixelOffsetMode;
+            g.SmoothingMode = this.m_SmoothingMode;
+            g.TextContrast = this.m_TextContrast;
+            g.TextRenderingHint = this.m_TextRenderingHint;
+        }
+
+        #endregion
+
+
+        #region 公共方法
+
+        /// <summary>
+        /// 开始渲染
+        /// </summary>
+        /// <returns>成功返回true,否则返回false</returns>
+        public bool Prepare()
+        {
+            //检查资源
+            this.CheckDisposed();
+
+            //检查资源
+            this.m_Owner.CheckDisposed();
+
+            //判断句柄
+            if (!this.m_Owner.IsHandleCreated)
+                return false;
+
+            //判断可见
+            if (!this.m_Owner.Visible)
+                return false;
+
+            //判断大小
+            Size wndSize = this.m_Owner.Size;
+            if (wndSize.Width <= 0 || (wndSize.Height <= 0))
+                return false;
+
+            //已创建
+            Size bufferSize = this.m_Size;
+            if (this.m_BufferedGraphics != null
+                && bufferSize.Width >= wndSize.Width && bufferSize.Width <= wndSize.Width + PRE_ALLOC
+                && bufferSize.Height >= wndSize.Height && bufferSize.Height <= wndSize.Height + PRE_ALLOC)
+                return true;
+
+            //预分配
+            if (bufferSize.Width < wndSize.Width)
+                wndSize.Width += PRE_ALLOC;
+            if (bufferSize.Height < wndSize.Height)
+                wndSize.Height += PRE_ALLOC;
+
+            //设置状态
+            if (this.m_IsCreating)
+                return false;
+            this.m_IsCreating = true;
+
+            //缓冲上下文
+            BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current;
+            bufferedGraphicsContext.MaximumBuffer = wndSize;
+
+            //执行创建
+            if (this.m_OwnerGraphics == null)
+                this.m_OwnerGraphics = this.m_Owner.CreateGraphics();
+            if (this.m_BufferedGraphics != null)
+                this.m_BufferedGraphics.Dispose();
+            this.m_BufferedGraphics = bufferedGraphicsContext.Allocate(this.m_OwnerGraphics, new Rectangle(0, 0, wndSize.Width, wndSize.Height));
+
+            //初始化绘图对象
+            this.InitGraphics(this.m_BufferedGraphics.Graphics);
+            this.m_Size = wndSize;
+
+            //不创建
+            this.m_IsCreating = false;
+            return true;
+        }
+
+        /// <summary>
+        /// 在目标设备上混合渲染
+        /// </summary>
+        /// <param name="g">目标设备渲染数据</param>
+        public void BlendRender(Graphics g)
+        {
+            BufferedGraphicsEx.BlendRender(this.m_BufferedGraphics, g);
+        }
+
+        /// <summary>
+        /// 在目标设备上混合渲染
+        /// </summary>
+        /// <param name="e">目标设备渲染数据</param>
+        public void BlendRender(PaintEventArgs e)
+        {
+            BufferedGraphicsEx.BlendRender(this.m_BufferedGraphics, e.Graphics, e.ClipRectangle);
+        }
+
+        /// <summary>
+        /// 在目标设备上复制渲染
+        /// </summary>
+        /// <param name="g">目标设备渲染数据</param>
+        public void Render(Graphics g)
+        {
+            this.m_BufferedGraphics.Render(g);
+        }
+
+        /// <summary>
+        /// 在目标设备上复制渲染
+        /// </summary>
+        /// <param name="e">目标设备渲染数据</param>
+        public void Render(PaintEventArgs e)
+        {
+            BufferedGraphicsEx.Render(this.m_BufferedGraphics, e.Graphics, e.ClipRectangle);
+        }
+
+        #endregion
+
+
+        #region 释放资源
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_BufferedGraphics != null)
+            {
+                this.m_BufferedGraphics.Dispose();
+                this.m_BufferedGraphics = null;
+            }
+            if (this.m_OwnerGraphics != null)
+            {
+                this.m_OwnerGraphics.Dispose();
+                this.m_OwnerGraphics = null;
+            }
+            this.m_Owner = null;//取消引用
+        }
+
+        #endregion
+    }
+}

+ 132 - 0
PackageUpdater/Microsoft.Drawing/Classes/LockedBitmapData.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 位图的属性,已锁定
+    /// </summary>
+    public sealed class LockedBitmapData : DisposableMini
+    {
+        private Bitmap m_Bitmap;//位图
+        private BitmapData m_BitmapData;//属性
+
+        /// <summary>
+        /// 获取或设置返回此 System.Drawing.Imaging.BitmapData 对象的 System.Drawing.Bitmap 对象中像素信息的格式。
+        /// </summary>
+        public PixelFormat PixelFormat
+        {
+            get
+            {
+                return this.m_BitmapData.PixelFormat;
+            }
+            set
+            {
+                this.m_BitmapData.PixelFormat = value;
+            }
+        }
+
+        /// <summary>
+        /// 获取或设置 System.Drawing.Bitmap 对象的像素宽度。这也可以看作是一个扫描行中的像素数。
+        /// </summary>
+        public int Width
+        {
+            get
+            {
+                return this.m_BitmapData.Width;
+            }
+            set
+            {
+                this.m_BitmapData.Width = value;
+            }
+        }
+
+        /// <summary>
+        /// 获取或设置 System.Drawing.Bitmap 对象的像素高度。有时也称作扫描行数。
+        /// </summary>
+        public int Height
+        {
+            get
+            {
+                return this.m_BitmapData.Height;
+            }
+            set
+            {
+                this.m_BitmapData.Height = value;
+            }
+        }
+
+        /// <summary>
+        /// 获取或设置 System.Drawing.Bitmap 对象的跨距宽度(也称为扫描宽度)。
+        /// </summary>
+        public int Stride
+        {
+            get
+            {
+                return this.m_BitmapData.Stride;
+            }
+            set
+            {
+                this.m_BitmapData.Stride = value;
+            }
+        }
+
+        /// <summary>
+        /// 获取或设置位图中第一个像素数据的地址。它也可以看成是位图中的第一个扫描行。
+        /// </summary>
+        public IntPtr Scan0
+        {
+            get
+            {
+                return this.m_BitmapData.Scan0;
+            }
+            set
+            {
+                this.m_BitmapData.Scan0 = value;
+            }
+        }
+
+        /// <summary>
+        /// 保留。不要使用。
+        /// </summary>
+        public int Reserved
+        {
+            get
+            {
+                return this.m_BitmapData.Reserved;
+            }
+            set
+            {
+                this.m_BitmapData.Reserved = value;
+            }
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="bitmap">位图</param>
+        /// <param name="flags">读写模式</param>
+        /// <param name="format">像素格式</param>
+        public LockedBitmapData(Bitmap bitmap, ImageLockMode flags, PixelFormat format)
+        {
+            this.m_Bitmap = bitmap;
+            Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
+            this.m_BitmapData = this.m_Bitmap.LockBits(rect, flags, format);
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Bitmap != null)
+            {
+                this.m_Bitmap.UnlockBits(this.m_BitmapData);
+                this.m_Bitmap = null;
+                this.m_BitmapData = null;
+            }
+        }
+    }
+}

+ 49 - 0
PackageUpdater/Microsoft.Drawing/Classes/PixelOffsetModeGraphics.cs

@@ -0,0 +1,49 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 暂时修改绘图对象的像素偏移模式,释放时改为原来模式
+    /// </summary>
+    public sealed class PixelOffsetModeGraphics : DisposableMini
+    {
+        private PixelOffsetMode m_OldMode;  //原始的像素偏移模式
+        private Graphics m_Graphics;        //要修改像素偏移模式的绘图对象
+
+        /// <summary>
+        /// 构造函数,暂时修改为默认像素偏移
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        public PixelOffsetModeGraphics(Graphics graphics)
+            : this(graphics, PixelOffsetMode.Default)
+        {
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="newMode">新像素偏移模式</param>
+        public PixelOffsetModeGraphics(Graphics graphics, PixelOffsetMode newMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldMode = graphics.PixelOffsetMode;
+            graphics.PixelOffsetMode = newMode;
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Graphics != null)
+            {
+                this.m_Graphics.PixelOffsetMode = this.m_OldMode;
+                this.m_Graphics = null;
+            }
+            this.m_OldMode = PixelOffsetMode.Default;
+        }
+    }
+}

+ 49 - 0
PackageUpdater/Microsoft.Drawing/Classes/SmoothingModeGraphics.cs

@@ -0,0 +1,49 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 暂时修改绘图对象的平滑模式,释放时改为原来模式
+    /// </summary>
+    public sealed class SmoothingModeGraphics : DisposableMini
+    {
+        private SmoothingMode m_OldMode;    //原始的平滑模式
+        private Graphics m_Graphics;        //要修改平滑模式的绘图对象
+
+        /// <summary>
+        /// 构造函数,暂时修改为抗锯齿
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        public SmoothingModeGraphics(Graphics graphics)
+            : this(graphics, SmoothingMode.AntiAlias)
+        {
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="newMode">新平滑模式</param>
+        public SmoothingModeGraphics(Graphics graphics, SmoothingMode newMode)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldMode = graphics.SmoothingMode;
+            graphics.SmoothingMode = newMode;
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Graphics != null)
+            {
+                this.m_Graphics.SmoothingMode = this.m_OldMode;
+                this.m_Graphics = null;
+            }
+            this.m_OldMode = SmoothingMode.Default;
+        }
+    }
+}

+ 49 - 0
PackageUpdater/Microsoft.Drawing/Classes/TextRenderingHintGraphics.cs

@@ -0,0 +1,49 @@
+using System.Drawing;
+using System.Drawing.Text;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 暂时修改绘图对象的文本呈现模式,释放时改为原来模式
+    /// </summary>
+    public sealed class TextRenderingHintGraphics : DisposableMini
+    {
+        private TextRenderingHint m_OldHint;    //原始的文本呈现模式
+        private Graphics m_Graphics;            //要修改文本呈现模式的绘图对象
+
+        /// <summary>
+        /// 构造函数,暂时修改为抗锯齿
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        public TextRenderingHintGraphics(Graphics graphics)
+            : this(graphics, TextRenderingHint.AntiAlias)
+        {
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="newHint">新文本呈现模式</param>
+        public TextRenderingHintGraphics(Graphics graphics, TextRenderingHint newHint)
+        {
+            this.m_Graphics = graphics;
+            this.m_OldHint = graphics.TextRenderingHint;
+            graphics.TextRenderingHint = newHint;
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Graphics != null)
+            {
+                this.m_Graphics.TextRenderingHint = this.m_OldHint;
+                this.m_Graphics = null;
+            }
+            this.m_OldHint = TextRenderingHint.SystemDefault;
+        }
+    }
+}

+ 69 - 0
PackageUpdater/Microsoft.Drawing/Classes/TranslateGraphics.cs

@@ -0,0 +1,69 @@
+using System.Drawing;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 平移变换
+    /// </summary>
+    public sealed class TranslateGraphics : DisposableMini
+    {
+        private int m_X;                    //水平平移
+        private int m_Y;                    //垂直平移
+        private Graphics m_Graphics;        //要修改剪切区的绘图对象
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="x">水平偏移像素</param>
+        /// <param name="y">垂直偏移像素</param>
+        public TranslateGraphics(Graphics graphics, int x, int y)
+        {
+            this.m_Graphics = graphics;
+            this.m_X = x;
+            this.m_Y = y;
+            this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="p">偏移量</param>
+        public TranslateGraphics(Graphics graphics, Point p)
+        {
+            this.m_Graphics = graphics;
+            this.m_X = p.X;
+            this.m_Y = p.Y;
+            this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
+        }
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="graphics">绘图对象</param>
+        /// <param name="s">偏移量</param>
+        public TranslateGraphics(Graphics graphics, Size s)
+        {
+            this.m_Graphics = graphics;
+            this.m_X = s.Width;
+            this.m_Y = s.Height;
+            this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
+        }
+
+        /// <summary>
+        /// 释放资源
+        /// </summary>
+        /// <param name="disposing">释放托管资源为true,否则为false</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (this.m_Graphics != null)
+            {
+                this.m_Graphics.TranslateTransform(-this.m_X, -this.m_Y);
+                this.m_Graphics = null;
+            }
+            this.m_X = 0;
+            this.m_Y = 0;
+        }
+    }
+}

+ 42 - 0
PackageUpdater/Microsoft.Drawing/Interfaces/IWindow.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 与 Win32 窗口关联的控件接口
+    /// </summary>
+    public interface IWindow : IWin32Window, IDisposable, IDisposed, IDisposeState
+    {
+        /// <summary>
+        /// 获取一个值,该值指示控件是否有与它关联的句柄。
+        /// </summary>
+        bool IsHandleCreated
+        {
+            get;
+        }
+
+        /// <summary>
+        /// 获取一个值,该值指示是否显示该控件及其所有子控件。
+        /// </summary>
+        bool Visible
+        {
+            get;
+        }
+
+        /// <summary>
+        /// 获取控件的高度和宽度。
+        /// </summary>
+        Size Size
+        {
+            get;
+        }
+
+        /// <summary>
+        /// 为控件创建绘图画面。
+        /// </summary>
+        /// <returns>绘图画面</returns>
+        Graphics CreateGraphics();
+    }
+}

+ 76 - 0
PackageUpdater/Microsoft.Drawing/Microsoft.Drawing.csproj

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{2421B8B6-355E-4E6E-8955-1BEB1A4C1B84}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Microsoft.Drawing</RootNamespace>
+    <AssemblyName>Microsoft.Drawing</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\_Output\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>..\_Output\Debug\Microsoft.Drawing.XML</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\_Output\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>..\_Output\Release\Microsoft.Drawing.XML</DocumentationFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Classes\ClipGraphics.cs" />
+    <Compile Include="Classes\DoubleBufferedGraphics.cs" />
+    <Compile Include="Classes\LockedBitmapData.cs" />
+    <Compile Include="Classes\PixelOffsetModeGraphics.cs" />
+    <Compile Include="Classes\SmoothingModeGraphics.cs" />
+    <Compile Include="Classes\TextRenderingHintGraphics.cs" />
+    <Compile Include="Classes\TranslateGraphics.cs" />
+    <Compile Include="Interfaces\IWindow.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Structs\ColorVector.cs" />
+    <Compile Include="Structs\ColorVectorConverter.cs" />
+    <Compile Include="Util\BufferedGraphicsEx.cs" />
+    <Compile Include="Util\GraphicsEx.cs" />
+    <Compile Include="Util\PointEx.cs" />
+    <Compile Include="Util\RectangleEx.cs" />
+    <Compile Include="Util\SizeEx.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Microsoft.Win32\Microsoft.Win32.csproj">
+      <Project>{b1d6b045-127c-47fc-adf2-ce3957f4d694}</Project>
+      <Name>Microsoft.Win32</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Microsoft\Microsoft.csproj">
+      <Project>{f2a4d4c2-a948-4351-9d46-117f372ab4a4}</Project>
+      <Name>Microsoft</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 35 - 0
PackageUpdater/Microsoft.Drawing/Properties/AssemblyInfo.cs

@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Microsoft.Drawing")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("北京维富友科技发展有限公司")]
+[assembly: AssemblyProduct("Microsoft.Drawing")]
+[assembly: AssemblyCopyright("Copyright © 北京维富友科技发展有限公司 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("80a5a30e-9819-4bcc-99d8-e6b470dc79ef")]
+
+// 程序集的版本信息由下面四个值组成: 
+//
+//      主版本
+//      次版本 
+//      生成号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: 
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.1.5.0")]
+[assembly: AssemblyFileVersion("1.1.5.0")]

+ 486 - 0
PackageUpdater/Microsoft.Drawing/Structs/ColorVector.cs

@@ -0,0 +1,486 @@
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 颜色向量,只支持加减操作,不支持乘除操作
+    /// Copyright (c) JajaSoft
+    /// </summary>
+    [Serializable, StructLayout(LayoutKind.Sequential), ComVisible(true), TypeConverter(typeof(ColorVectorConverter))]
+    public struct ColorVector
+    {
+        #region 静态
+
+        /// <summary>
+        /// A=0,R=0,G=0,B=0
+        /// </summary>
+        public static readonly ColorVector Empty;
+
+        /// <summary>
+        /// 静态构造
+        /// </summary>
+        static ColorVector()
+        {
+            Empty = new ColorVector();
+        }
+
+        /// <summary>
+        /// 生成Long,各占16位共64位
+        /// </summary>
+        /// <param name="alpha">A</param>
+        /// <param name="red">R</param>
+        /// <param name="green">G</param>
+        /// <param name="blue">B</param>
+        /// <returns>长整型数值</returns>
+        private static long MakeLong(int alpha, int red, int green, int blue)
+        {
+            ulong ulA = (ulong)(alpha & ushort.MaxValue);
+            ulong ulR = (ulong)(red & ushort.MaxValue);
+            ulong ulG = (ulong)(green & ushort.MaxValue);
+            ulong ulB = (ulong)(blue & ushort.MaxValue);
+            return (long)((ulA << 0x30) | (ulR << 0x20) | (ulG << 0x10) | ulB);
+        }
+
+
+        /// <summary>
+        /// 从一个64位整数创建ColorVector结构
+        /// </summary>
+        /// <param name="value">64位整数</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(long value)
+        {
+            return new ColorVector(value);
+        }
+
+        /// <summary>
+        /// 从一个Color结构创建ColorVector结构
+        /// </summary>
+        /// <param name="color">Color结构</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(Color color)
+        {
+            return new ColorVector(color.A, color.R, color.G, color.B);
+        }
+
+        /// <summary>
+        /// 从一个Color结构创建ColorVector结构,但Alpha使用指定的值
+        /// </summary>
+        /// <param name="alpha">Alpha指定值</param>
+        /// <param name="color">Color结构</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(int alpha, Color color)
+        {
+            return new ColorVector(alpha, color.R, color.G, color.B);
+        }
+
+        /// <summary>
+        /// 从一个ColorVector结构创建ColorVector结构,但Alpha使用指定值
+        /// </summary>
+        /// <param name="alpha">Alpha指定值</param>
+        /// <param name="vector">ColorVector结构</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(int alpha, ColorVector vector)
+        {
+            return new ColorVector(alpha, vector.R, vector.G, vector.B);
+        }
+
+        /// <summary>
+        /// 从三个16位整数创建ColorVector结构,Alpha使用0
+        /// </summary>
+        /// <param name="red">Red值</param>
+        /// <param name="green">Green值</param>
+        /// <param name="blue">Blue值</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(int red, int green, int blue)
+        {
+            return new ColorVector(0, red, green, blue);
+        }
+
+        /// <summary>
+        /// 从四个16位整数创建ColorVector结构
+        /// </summary>
+        /// <param name="alpha">Alpha值</param>
+        /// <param name="red">Red值</param>
+        /// <param name="green">Green值</param>
+        /// <param name="blue">Blue值</param>
+        /// <returns>ColorVector结构</returns>
+        public static ColorVector FromArgb(int alpha, int red, int green, int blue)
+        {
+            return new ColorVector(alpha, red, green, blue);
+        }
+
+        #endregion
+
+
+        #region 字段属性
+
+        //64位值
+        private long Value;
+
+        /// <summary>
+        /// Alpha分量上的偏移量
+        /// </summary>
+        public short A
+        {
+            get
+            {
+                return (short)((this.Value >> 0x30) & ushort.MaxValue);
+            }
+        }
+
+        /// <summary>
+        /// 红色分量上的偏移量
+        /// </summary>
+        public short R
+        {
+            get
+            {
+                return (short)((this.Value >> 0x20) & ushort.MaxValue);
+            }
+        }
+
+        /// <summary>
+        /// 绿色分量上的偏移量
+        /// </summary>
+        public short G
+        {
+            get
+            {
+                return (short)((this.Value >> 0x10) & ushort.MaxValue);
+            }
+        }
+
+        /// <summary>
+        /// 蓝色分量上的偏移量
+        /// </summary>
+        public short B
+        {
+            get
+            {
+                return (short)(this.Value & ushort.MaxValue);
+            }
+        }
+
+        #endregion
+
+
+        #region 构造函数
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="value">长整型数值</param>
+        private ColorVector(long value)
+        {
+            this.Value = value;
+        }
+
+        /// <summary>
+        /// 构造函数,各占16位.short(-32768,32767)
+        /// </summary>
+        /// <param name="alpha">A</param>
+        /// <param name="red">R</param>
+        /// <param name="green">G</param>
+        /// <param name="blue">B</param>
+        private ColorVector(int alpha, int red, int green, int blue)
+            : this(MakeLong(alpha, red, green, blue))
+        {
+        }
+
+        #endregion
+
+
+        #region 公共方法
+
+        /// <summary>
+        /// 获取Hash值
+        /// </summary>
+        /// <returns>返回</returns>
+        public override int GetHashCode()
+        {
+            return this.Value.GetHashCode();
+        }
+
+        /// <summary>
+        /// 转换为字符串
+        /// </summary>
+        /// <returns>字符串</returns>
+        public override string ToString()
+        {
+            StringBuilder builder = new StringBuilder(0x20);
+            builder.Append(base.GetType().Name);
+            builder.Append(" [");
+            if (this == ColorVector.Empty)
+            {
+                builder.Append("Empty");
+            }
+            else
+            {
+                builder.Append("A=");
+                builder.Append(this.A);
+                builder.Append(", R=");
+                builder.Append(this.R);
+                builder.Append(", G=");
+                builder.Append(this.G);
+                builder.Append(", B=");
+                builder.Append(this.B);
+            }
+            builder.Append("]");
+            return builder.ToString();
+        }
+
+        /// <summary>
+        /// 判断两个是否相等
+        /// </summary>
+        /// <param name="obj">目标对象</param>
+        /// <returns>相等返回true,否则返回false</returns>
+        public override bool Equals(object obj)
+        {
+            if (obj is ColorVector)
+            {
+                ColorVector vector = (ColorVector)obj;
+                return this == vector;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 转换为颜色
+        /// </summary>
+        /// <returns>颜色</returns>
+        public Color ToColor()
+        {
+            return Color.FromArgb(MathEx.Clamp(this.A, (byte)0, (byte)255),
+                MathEx.Clamp(this.R, (byte)0, (byte)255),
+                MathEx.Clamp(this.G, (byte)0, (byte)255),
+                MathEx.Clamp(this.B, (byte)0, (byte)255));
+        }
+
+        #endregion
+
+
+        #region 操作符
+
+        /// <summary>
+        /// 等于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>相等返回true,否则返回false</returns>
+        public static bool operator ==(ColorVector left, ColorVector right)
+        {
+            return left.Value == right.Value;
+        }
+
+        /// <summary>
+        /// 等于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>不等返回true,否则返回false</returns>
+        public static bool operator !=(ColorVector left, ColorVector right)
+        {
+            return !(left == right);
+        }
+
+        /// <summary>
+        /// 大于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>A,R,G,B全部大于返回true,否则返回false</returns>
+        public static bool operator >(ColorVector left, ColorVector right)
+        {
+            return left.A > right.A
+                && left.R > right.R
+                && left.G > right.G
+                && left.B > right.B;
+        }
+
+        /// <summary>
+        /// 大于等于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>A,R,G,B全部大于等于返回true,否则返回false</returns>
+        public static bool operator >=(ColorVector left, ColorVector right)
+        {
+            return left.A >= right.A
+                && left.R >= right.R
+                && left.G >= right.G
+                && left.B >= right.B;
+        }
+
+        /// <summary>
+        /// 小于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>A,R,G,B全部小于返回true,否则返回false</returns>
+        public static bool operator <(ColorVector left, ColorVector right)
+        {
+            return left.A < right.A
+                && left.R < right.R
+                && left.G < right.G
+                && left.B < right.B;
+        }
+
+        /// <summary>
+        /// 小于等于
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>A,R,G,B全部小于等于返回true,否则返回false</returns>
+        public static bool operator <=(ColorVector left, ColorVector right)
+        {
+            return left.A <= right.A
+                && left.R <= right.R
+                && left.G <= right.G
+                && left.B <= right.B;
+        }
+
+        /// <summary>
+        /// 两个颜色向量相加
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator +(ColorVector left, ColorVector right)
+        {
+            return new ColorVector(left.A + right.A, left.R + right.R, left.G + right.G, left.B + right.B);
+        }
+
+        /// <summary>
+        /// 颜色加上颜色向量
+        /// </summary>
+        /// <param name="left">颜色</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色</returns>
+        public static Color operator +(Color left, ColorVector right)
+        {
+            return Color.FromArgb(MathEx.Clamp(left.A + right.A, (byte)0, (byte)255),
+                MathEx.Clamp(left.R + right.R, (byte)0, (byte)255),
+                MathEx.Clamp(left.G + right.G, (byte)0, (byte)255),
+                MathEx.Clamp(left.B + right.B, (byte)0, (byte)255));
+        }
+
+        /// <summary>
+        /// 两个颜色向量相减
+        /// </summary>
+        /// <param name="left">左值</param>
+        /// <param name="right">右值</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator -(ColorVector left, ColorVector right)
+        {
+            return new ColorVector(left.A - right.A, left.R - right.R, left.G - right.G, left.B - right.B);
+        }
+
+        /// <summary>
+        /// 颜色减去颜色向量
+        /// </summary>
+        /// <param name="left">颜色</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色</returns>
+        public static Color operator -(Color left, ColorVector right)
+        {
+            return Color.FromArgb(MathEx.Clamp(left.A - right.A, (byte)0, (byte)255),
+                MathEx.Clamp(left.R - right.R, (byte)0, (byte)255),
+                MathEx.Clamp(left.G - right.G, (byte)0, (byte)255),
+                MathEx.Clamp(left.B - right.B, (byte)0, (byte)255));
+        }
+
+        /// <summary>
+        /// 颜色向量乘以浮点数
+        /// </summary>
+        /// <param name="left">颜色向量</param>
+        /// <param name="right">浮点数</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator *(ColorVector left, float right)
+        {
+            return new ColorVector((int)(left.A * right), (int)(left.R * right), (int)(left.G * right), (int)(left.B * right));
+        }
+
+        /// <summary>
+        /// 浮点数乘以颜色向量
+        /// </summary>
+        /// <param name="left">浮点数</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator *(float left, ColorVector right)
+        {
+            return new ColorVector((int)(left * right.A), (int)(left * right.R), (int)(left * right.G), (int)(left * right.B));
+        }
+
+        /// <summary>
+        /// 颜色向量乘以整数
+        /// </summary>
+        /// <param name="left">颜色向量</param>
+        /// <param name="right">浮点数</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator *(ColorVector left, int right)
+        {
+            return new ColorVector(left.A * right, left.R * right, left.G * right, left.B * right);
+        }
+
+        /// <summary>
+        /// 整数乘以颜色向量
+        /// </summary>
+        /// <param name="left">整数</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator *(int left, ColorVector right)
+        {
+            return new ColorVector(left * right.A, left * right.R, left * right.G, left * right.B);
+        }
+
+        /// <summary>
+        /// 颜色向量除以浮点数
+        /// </summary>
+        /// <param name="left">颜色向量</param>
+        /// <param name="right">浮点数</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator /(ColorVector left, float right)
+        {
+            return new ColorVector((int)(left.A / right), (int)(left.R / right), (int)(left.G / right), (int)(left.B / right));
+        }
+
+        /// <summary>
+        /// 浮点数除以颜色向量
+        /// </summary>
+        /// <param name="left">浮点数</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator /(float left, ColorVector right)
+        {
+            return new ColorVector((int)(left / right.A), (int)(left / right.R), (int)(left / right.G), (int)(left / right.B));
+        }
+
+        /// <summary>
+        /// 颜色向量除以整数
+        /// </summary>
+        /// <param name="left">颜色向量</param>
+        /// <param name="right">整数</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator /(ColorVector left, int right)
+        {
+            return new ColorVector(left.A / right, left.R / right, left.G / right, left.B / right);
+        }
+
+        /// <summary>
+        /// 整数除以颜色向量
+        /// </summary>
+        /// <param name="left">整数</param>
+        /// <param name="right">颜色向量</param>
+        /// <returns>返回新颜色向量</returns>
+        public static ColorVector operator /(int left, ColorVector right)
+        {
+            return new ColorVector(left / right.A, left / right.R, left / right.G, left / right.B);
+        }
+
+        #endregion
+    }
+}

+ 207 - 0
PackageUpdater/Microsoft.Drawing/Structs/ColorVectorConverter.cs

@@ -0,0 +1,207 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.ComponentModel.Design.Serialization;
+using System.Globalization;
+using System.Reflection;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 颜色向量转换类
+    /// Copyright (c) JajaSoft
+    /// </summary>
+    public class ColorVectorConverter : TypeConverter
+    {
+        /// <summary>
+        /// 返回该转换器是否可以使用指定的上下文将给定类型的对象转换为此转换器的类型。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="sourceType">一个 System.Type,表示要转换的类型。</param>
+        /// <returns>如果该转换器能够执行转换,则为 true;否则为 false。</returns>
+        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+        {
+            return ((sourceType == typeof(string)) || base.CanConvertFrom(context, sourceType));
+        }
+
+        /// <summary>
+        /// 返回此转换器是否可以使用指定的上下文将该对象转换为指定的类型。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="destinationType">一个 System.Type,表示要转换到的类型。</param>
+        /// <returns>如果该转换器能够执行转换,则为 true;否则为 false。</returns>
+        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+        {
+            return ((destinationType == typeof(InstanceDescriptor)) || base.CanConvertTo(context, destinationType));
+        }
+
+        /// <summary>
+        /// 使用指定的上下文和区域性信息将给定的对象转换为此转换器的类型。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="culture">用作当前区域性的 System.Globalization.CultureInfo。</param>
+        /// <param name="value">要转换的 System.Object。</param>
+        /// <returns>表示转换的 value 的 System.Object。</returns>
+        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+        {
+            //NULL
+            string str = value as string;
+            if (str == null)
+                return base.ConvertFrom(context, culture, value);
+
+            //空字符串
+            string trimStr = str.Trim();
+            if (trimStr.Length <= 0)
+                return ColorVector.Empty;
+
+            //区域分隔符
+            if (culture == null)
+                culture = CultureInfo.CurrentCulture;
+            char ch = culture.TextInfo.ListSeparator[0];
+
+            //类型转换器
+            TypeConverter longConverter = TypeDescriptor.GetConverter(typeof(long));
+            TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int));
+
+            //不含分隔符
+            if (trimStr.IndexOf(ch) == -1)
+            {
+                if (((trimStr[0] == '#') &&
+                    (trimStr.Length == 13 || trimStr.Length == 17)) ||
+                    ((trimStr.StartsWith("0x") || trimStr.StartsWith("0X") || trimStr.StartsWith("&h") || trimStr.StartsWith("&H")) &&
+                    (trimStr.Length == 14 || trimStr.Length == 18)))
+                    return ColorVector.FromArgb((long)longConverter.ConvertFromString(trimStr));
+            }
+            else//包含分隔符
+            {
+                string[] strArray = trimStr.Split(new char[] { ch });
+                int[] numArray = new int[strArray.Length];
+                for (int i = 0; i < numArray.Length; i++)
+                    numArray[i] = (int)intConverter.ConvertFromString(context, culture, strArray[i]);
+
+                switch (numArray.Length)
+                {
+                    case 3:
+                        return ColorVector.FromArgb(numArray[0], numArray[1], numArray[2]);
+
+                    case 4:
+                        return ColorVector.FromArgb(numArray[0], numArray[1], numArray[2], numArray[3]);
+                }
+            }
+
+            throw new ArgumentException("无效的颜色向量");
+        }
+
+        /// <summary>
+        /// 使用指定的上下文和区域性信息将给定的值对象转换为指定的类型。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="culture">System.Globalization.CultureInfo。如果传递 null,则采用当前区域性。</param>
+        /// <param name="value">要转换的 System.Object。</param>
+        /// <param name="destinationType">value 参数要转换成的 System.Type。</param>
+        /// <returns>表示转换的 value 的 System.Object。</returns>
+        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+        {
+            if (destinationType == null)
+            {
+                throw new ArgumentNullException("destinationType");
+            }
+            if (value is ColorVector)
+            {
+                if (destinationType == typeof(string))//转换为string
+                {
+                    ColorVector colorVector = (ColorVector)value;
+
+                    if (culture == null)
+                        culture = CultureInfo.CurrentCulture;
+
+                    string separator = culture.TextInfo.ListSeparator + " ";
+                    TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int));
+
+                    string[] strArray = new string[4];
+                    strArray[0] = intConverter.ConvertToString(context, culture, colorVector.A);
+                    strArray[1] = intConverter.ConvertToString(context, culture, colorVector.R);
+                    strArray[2] = intConverter.ConvertToString(context, culture, colorVector.G);
+                    strArray[3] = intConverter.ConvertToString(context, culture, colorVector.B);
+                    return string.Join(separator, strArray);
+                }
+                if (destinationType == typeof(InstanceDescriptor))
+                {
+                    MemberInfo member = null;
+                    object[] arguments = null;
+                    ColorVector colorVector2 = (ColorVector)value;
+                    if (colorVector2 == ColorVector.Empty)
+                    {
+                        member = typeof(ColorVector).GetField("Empty");
+                    }
+                    else
+                    {
+                        member = typeof(ColorVector).GetMethod("FromArgb", new Type[] { typeof(int), typeof(int), typeof(int), typeof(int) });
+                        arguments = new object[] { colorVector2.A, colorVector2.R, colorVector2.G, colorVector2.B };
+                    }
+
+                    if (member != null)
+                        return new InstanceDescriptor(member, arguments);
+                }
+            }
+            return base.ConvertTo(context, culture, value, destinationType);
+        }
+
+
+        /// <summary>
+        /// 在已知对象的属性 (Property) 值集的情况下,使用指定的上下文创建与此 System.ComponentModel.TypeConverter 关联的类型的实例。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="propertyValues">新属性 (Property) 值的 System.Collections.IDictionary。</param>
+        /// <returns>一个 System.Object,表示给定的 System.Collections.IDictionary,或者如果无法创建该对象,则为 null。此方法始终返回 null。</returns>
+        public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
+        {
+            if (propertyValues == null)
+            {
+                throw new ArgumentNullException("propertyValues");
+            }
+            object alpha = propertyValues["A"];
+            object red = propertyValues["R"];
+            object green = propertyValues["G"];
+            object blue = propertyValues["B"];
+            if (((alpha == null) || (red == null) || (green == null) || (blue == null))
+                || (!(alpha is short) || !(red is short) || !(green is short) || !(blue is short)))
+            {
+                throw new ArgumentException("属性值为无效输入");
+            }
+            return ColorVector.FromArgb((int)(short)alpha, (int)(short)red, (int)(short)green, (int)(short)blue);
+        }
+
+        /// <summary>
+        /// 返回有关更改该对象上的某个值是否需要使用指定的上下文调用 System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary) 以创建新值的情况。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <returns>如果更改此对象的属性需要调用 System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary) 来创建新值,则为 true;否则为 false。</returns>
+        public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
+        {
+            return true;
+        }
+
+        /// <summary>
+        /// 使用指定的上下文返回值参数指定的数组类型的属性 (Property) 的集合。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <param name="value">一个 System.Object,指定要为其获取属性的数组类型。</param>
+        /// <param name="attributes">用作筛选器的 System.Attribute 类型数组。</param>
+        /// <returns>具有为此数据类型公开的属性的 System.ComponentModel.PropertyDescriptorCollection;或者如果没有属性,则为 null。</returns>
+        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
+        {
+            return TypeDescriptor.GetProperties(typeof(ColorVector), attributes).Sort(new string[] { "A", "R", "G", "B" });
+        }
+
+        /// <summary>
+        /// 返回此对象是否支持属性。
+        /// </summary>
+        /// <param name="context">System.ComponentModel.ITypeDescriptorContext,提供格式上下文。</param>
+        /// <returns>如果应调用 System.ComponentModel.TypeConverter.GetProperties(System.Object) 来查找此对象的属性,则为 true;否则为 false。</returns>
+        public override bool GetPropertiesSupported(ITypeDescriptorContext context)
+        {
+            return true;
+        }
+    }
+}

+ 115 - 0
PackageUpdater/Microsoft.Drawing/Util/BufferedGraphicsEx.cs

@@ -0,0 +1,115 @@
+using System;
+using System.Drawing;
+using System.Reflection;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// BufferedGraphicsEx辅助类
+    /// </summary>
+    public static class BufferedGraphicsEx
+    {
+        private static readonly FieldInfo FiTargetLoc;      //BufferedGraphics.targetLoc字段信息
+        private static readonly FieldInfo FiVirtulSize;     //BufferedGraphics.virtualSize字段信息
+
+        /// <summary>
+        /// 静态构造
+        /// </summary>
+        static BufferedGraphicsEx()
+        {
+            Type type = typeof(BufferedGraphics);
+            BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
+            FiTargetLoc = type.GetField("targetLoc", flags);
+            FiVirtulSize = type.GetField("virtualSize", flags);
+        }
+
+        /// <summary>
+        /// 获取缓冲区的目标坐标。
+        /// </summary>
+        /// <param name="bg">缓冲区。</param>
+        /// <returns>缓冲区的目标坐标</returns>
+        public static Point GetTargetLoc(BufferedGraphics bg)
+        {
+            if (bg == null)
+                throw new ArgumentNullException("bg");
+
+            return (Point)FiTargetLoc.GetValue(bg);
+        }
+
+        /// <summary>
+        /// 获取缓冲区的虚拟尺寸大小。
+        /// </summary>
+        /// <param name="bg">缓冲区。</param>
+        /// <returns>缓冲区的虚拟尺寸大小。</returns>
+        public static Size GetVirtualSize(BufferedGraphics bg)
+        {
+            if (bg == null)
+                throw new ArgumentNullException("bg");
+
+            return (Size)FiVirtulSize.GetValue(bg);
+        }
+
+        /// <summary>
+        /// 将图形缓冲区的内容写入指定的 System.Drawing.Graphics 对象。
+        /// </summary>
+        /// <param name="bgSrc">图形缓冲区,要混合的源。</param>
+        /// <param name="gDest">一个 System.Drawing.Graphics 对象,要向其中写入图形缓冲区的内容。</param>
+        /// <param name="rcDest">目标矩形。</param>
+        public static void Render(BufferedGraphics bgSrc, Graphics gDest, Rectangle rcDest)
+        {
+            //验证
+            if (bgSrc == null || gDest == null || !RectangleEx.IsVisible(rcDest))
+                return;
+
+            //反射获取私有字段 
+            Point targetLoc = (Point)FiTargetLoc.GetValue(bgSrc);
+            targetLoc.Offset(rcDest.X, rcDest.Y);
+            Size virtualSize = rcDest.Size;
+            Point sourceLoc = rcDest.Location;
+
+            //混合渲染
+            GraphicsEx.Render(bgSrc.Graphics, gDest, targetLoc, sourceLoc, virtualSize);
+        }
+
+        /// <summary>
+        /// 将图形缓冲区的内容与指定的 System.Drawing.Graphics 对象混合。(支持缓冲区Alpha通道)
+        /// </summary>
+        /// <param name="bgSrc"></param>
+        /// <param name="gDest">一个 System.Drawing.Graphics 对象,图形缓冲区要混合的目标。</param>
+        public static void BlendRender(BufferedGraphics bgSrc, Graphics gDest)
+        {
+            //验证
+            if (bgSrc == null || gDest == null)
+                return;
+
+            //反射获取私有字段
+            Point targetLoc = (Point)FiTargetLoc.GetValue(bgSrc);
+            Size virtualSize = (Size)FiVirtulSize.GetValue(bgSrc);
+
+            //混合渲染
+            GraphicsEx.BlendRender(bgSrc.Graphics, gDest, targetLoc, Point.Empty, virtualSize);
+        }
+
+        /// <summary>
+        /// 将图形缓冲区的内容与指定的 System.Drawing.Graphics 对象混合。(支持缓冲区Alpha通道)
+        /// </summary>
+        /// <param name="bgSrc">图形缓冲区,要混合的源。</param>
+        /// <param name="gDest">一个 System.Drawing.Graphics 对象,图形缓冲区要混合的目标。</param>
+        /// <param name="rcDest">目标矩形。</param>
+        public static void BlendRender(BufferedGraphics bgSrc, Graphics gDest, Rectangle rcDest)
+        {
+            //验证
+            if (bgSrc == null || gDest == null || !RectangleEx.IsVisible(rcDest))
+                return;
+
+            //反射获取私有字段
+            Point targetLoc = (Point)FiTargetLoc.GetValue(bgSrc);
+            targetLoc.Offset(rcDest.X, rcDest.Y);
+            Size virtualSize = rcDest.Size;
+            Point sourceLoc = rcDest.Location;
+
+            //混合渲染
+            GraphicsEx.BlendRender(bgSrc.Graphics, gDest, targetLoc, sourceLoc, virtualSize);
+        }
+    }
+}

+ 91 - 0
PackageUpdater/Microsoft.Drawing/Util/GraphicsEx.cs

@@ -0,0 +1,91 @@
+using System;
+using System.Drawing;
+using Microsoft.Win32;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// Graphics辅助类
+    /// </summary>
+    public static class GraphicsEx
+    {
+        /// <summary>
+        /// 复制设备内容(不支持Alpha通道)
+        /// </summary>
+        /// <param name="gSrc">原设备</param>
+        /// <param name="gDest">目标设备</param>
+        /// <param name="ptDest">源起始坐标</param>
+        /// <param name="ptSrc">目标起始坐标</param>
+        /// <param name="szBlock">复制大小</param>
+        public static void Render(Graphics gSrc, Graphics gDest, Point ptDest, Point ptSrc, Size szBlock)
+        {
+            if (gSrc == null || gDest == null)
+                return;
+
+            IntPtr hdcDest = gDest.GetHdc();
+            IntPtr hdcSrc = gSrc.GetHdc();
+            try
+            {
+                UnsafeNativeMethods.BitBlt(hdcDest, ptDest.X, ptDest.Y, szBlock.Width, szBlock.Height, hdcSrc, ptSrc.X, ptSrc.Y, NativeMethods.SRCCOPY);
+            }
+            finally
+            {
+                gSrc.ReleaseHdcInternal(hdcSrc);
+                gDest.ReleaseHdcInternal(hdcDest);
+            }
+        }
+
+        /// <summary>
+        /// 混合设备内容(支持Alpha通道)
+        /// </summary>
+        /// <param name="gSrc">原设备</param>
+        /// <param name="gDest">目标设备</param>
+        /// <param name="ptDest">源起始坐标</param>
+        /// <param name="ptSrc">目标起始坐标</param>
+        /// <param name="szBlock">复制大小</param>
+        public static void BlendRender(Graphics gSrc, Graphics gDest, Point ptDest, Point ptSrc, Size szBlock)
+        {
+            if (gSrc == null || gDest == null)
+                return;
+
+            IntPtr hdcDest = gDest.GetHdc();
+            IntPtr hdcSrc = gSrc.GetHdc();
+            try
+            {
+                UnsafeNativeMethods.GdiAlphaBlend(hdcDest, ptDest.X, ptDest.Y, szBlock.Width, szBlock.Height, hdcSrc, ptSrc.X, ptSrc.Y, szBlock.Width, szBlock.Height, NativeMethods.BLENDFUNCTION.Default);
+            }
+            finally
+            {
+                gSrc.ReleaseHdcInternal(hdcSrc);
+                gDest.ReleaseHdcInternal(hdcDest);
+            }
+        }
+
+        /// <summary>
+        /// 混合设备内容(支持Alpha通道)
+        /// </summary>
+        /// <param name="gSrc">原设备</param>
+        /// <param name="gDest">目标设备</param>
+        /// <param name="ptDest">源起始坐标</param>
+        /// <param name="ptSrc">目标起始坐标</param>
+        /// <param name="szBlock">复制大小</param>
+        /// <param name="alpha">透明度[0-255]</param>
+        public static void BlendRender(Graphics gSrc, Graphics gDest, Point ptDest, Point ptSrc, Size szBlock, byte alpha)
+        {
+            if (gSrc == null || gDest == null)
+                return;
+
+            IntPtr hdcDest = gDest.GetHdc();
+            IntPtr hdcSrc = gSrc.GetHdc();
+            try
+            {
+                UnsafeNativeMethods.GdiAlphaBlend(hdcDest, ptDest.X, ptDest.Y, szBlock.Width, szBlock.Height, hdcSrc, ptSrc.X, ptSrc.Y, szBlock.Width, szBlock.Height, new NativeMethods.BLENDFUNCTION(NativeMethods.AC_SRC_OVER, 0, alpha, NativeMethods.AC_SRC_ALPHA));
+            }
+            finally
+            {
+                gSrc.ReleaseHdcInternal(hdcSrc);
+                gDest.ReleaseHdcInternal(hdcDest);
+            }
+        }
+    }
+}

+ 47 - 0
PackageUpdater/Microsoft.Drawing/Util/PointEx.cs

@@ -0,0 +1,47 @@
+using System.Drawing;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 点帮助类
+    /// </summary>
+    public static class PointEx
+    {
+        /// <summary>
+        /// 平移指定量
+        /// </summary>
+        /// <param name="p">点</param>
+        /// <param name="size">平移量</param>
+        /// <returns>平移后的点</returns>
+        public static Point Offset(Point p, Size size)
+        {
+            p.Offset(size.Width, size.Height);
+            return p;
+        }
+
+        /// <summary>
+        /// 平移指定量
+        /// </summary>
+        /// <param name="p">点</param>
+        /// <param name="pos">平移量</param>
+        /// <returns>平移后的点</returns>
+        public static Point Offset(Point p, Point pos)
+        {
+            p.Offset(pos);
+            return p;
+        }
+
+        /// <summary>
+        /// 平移指定量
+        /// </summary>
+        /// <param name="p">点</param>
+        /// <param name="dx">水平平移量</param>
+        /// <param name="dy">垂直平移量</param>
+        /// <returns>平移后的点</returns>
+        public static Point Offset(Point p, int dx, int dy)
+        {
+            p.Offset(dx, dy);
+            return p;
+        }
+    }
+}

+ 264 - 0
PackageUpdater/Microsoft.Drawing/Util/RectangleEx.cs

@@ -0,0 +1,264 @@
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// 矩形帮助类
+    /// </summary>
+    public static class RectangleEx
+    {
+        /// <summary>
+        /// 调整矩形非空,影响原来矩形
+        /// </summary>
+        /// <param name="rect">要调整的矩形</param>
+        public static void MakeNotEmpty(ref Rectangle rect)
+        {
+            if (rect.Width < 1)
+                rect.Width = 1;
+            if (rect.Height < 1)
+                rect.Height = 1;
+        }
+
+        /// <summary>
+        /// 获取矩形是否可见
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <returns>宽度大于0并且高度大于0返回true,否则返回false</returns>
+        public static bool IsVisible(Rectangle rect)
+        {
+            return rect.Width > 0 && rect.Height > 0;
+        }
+
+        /// <summary>
+        /// 在指定的方向放大矩形,不影响原来的矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="align">方向</param>
+        /// <param name="value">放大量</param>
+        /// <returns>放大后的矩形</returns>
+        public static Rectangle Inflate(Rectangle rect, TabAlignment align, int value)
+        {
+            switch (align)
+            {
+                case TabAlignment.Top:
+                    rect.Y -= value;
+                    rect.Height += value;
+                    break;
+
+                case TabAlignment.Bottom:
+                    rect.Height += value;
+                    break;
+
+                case TabAlignment.Left:
+                    rect.X -= value;
+                    rect.Width += value;
+                    break;
+
+                case TabAlignment.Right:
+                    rect.Width += value;
+                    break;
+
+                default:
+                    break;
+            }
+
+            return rect;
+        }
+
+        /// <summary>
+        /// 在指定的方向和反向放大矩形,不影响原来的矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="align">方向</param>
+        /// <param name="value">放大量</param>
+        /// <param name="revalue">反向放大量</param>
+        /// <returns>放大后矩形</returns>
+        public static Rectangle Inflate(Rectangle rect, TabAlignment align, int value, int revalue)
+        {
+            switch (align)
+            {
+                case TabAlignment.Top:
+                    rect.Y -= value;
+                    rect.Height += value + revalue;
+                    break;
+
+                case TabAlignment.Bottom:
+                    rect.Y -= revalue;
+                    rect.Height += revalue + value;
+                    break;
+
+                case TabAlignment.Left:
+                    rect.X -= value;
+                    rect.Width += value + revalue;
+                    break;
+
+                case TabAlignment.Right:
+                    rect.X -= revalue;
+                    rect.Width += revalue + value;
+                    break;
+
+                default:
+                    break;
+            }
+
+            return rect;
+        }
+
+        /// <summary>
+        /// 在指定的方向的两侧放大矩形,不影响原来的矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="align">方向</param>
+        /// <param name="value">放大量</param>
+        /// <returns>放大后矩形</returns>
+        public static Rectangle InflateSide(Rectangle rect, TabAlignment align, int value)
+        {
+            int half = value / 2;
+            switch (align)
+            {
+                case TabAlignment.Top:
+                case TabAlignment.Bottom:
+                    rect.X -= half;
+                    rect.Width += value;
+                    break;
+
+                case TabAlignment.Left:
+                case TabAlignment.Right:
+                    rect.Y -= half;
+                    rect.Height += value;
+                    break;
+
+                default:
+                    break;
+            }
+
+            return rect;
+        }
+
+        /// <summary>
+        /// 按指定边调整矩形,使在该方向上的大小为指定值
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="align">方向</param>
+        /// <param name="value">大小</param>
+        /// <returns>调整后矩形</returns>
+        public static Rectangle Adjust(Rectangle rect, TabAlignment align, int value)
+        {
+            switch (align)
+            {
+                case TabAlignment.Top:
+                    rect.Y += (rect.Height - value);
+                    rect.Height = value;
+                    break;
+
+                case TabAlignment.Bottom:
+                    rect.Height = value;
+                    break;
+
+                case TabAlignment.Left:
+                    rect.X += (rect.Width - value);
+                    rect.Width = value;
+                    break;
+
+                case TabAlignment.Right:
+                    rect.Width = value;
+                    break;
+
+                default:
+                    break;
+            }
+
+            return rect;
+        }
+
+        /// <summary>
+        /// 调整矩形使其在指定方向上与标准矩形对齐,并加上偏移量,不影响原来的矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="rectStand">标准矩形</param>
+        /// <param name="align">方向</param>
+        /// <param name="offset">偏移量</param>
+        /// <returns>调整后的矩形</returns>
+        public static Rectangle Align(Rectangle rect, Rectangle rectStand, TabAlignment align, int offset)
+        {
+            int value;
+            switch (align)
+            {
+                case TabAlignment.Top:
+                    value = rect.Y - rectStand.Y + offset;
+                    rect.Y -= value;
+                    rect.Height += value;
+                    break;
+
+                case TabAlignment.Bottom:
+                    value = rectStand.Bottom - rect.Bottom + offset;
+                    rect.Height += value;
+                    break;
+
+                case TabAlignment.Left:
+                    value = rect.X - rectStand.X + offset;
+                    rect.X -= value;
+                    rect.Width += value;
+                    break;
+
+                case TabAlignment.Right:
+                    value = rectStand.Right - rect.Right + offset;
+                    rect.Width += value;
+                    break;
+
+                default:
+                    break;
+            }
+
+            return rect;
+        }
+
+        /// <summary>
+        /// 矩形加上Padding后的新矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="padding">外边距</param>
+        /// <returns>新矩形</returns>
+        public static Rectangle Add(Rectangle rect, Padding padding)
+        {
+            return new Rectangle(rect.Left - padding.Left, rect.Top - padding.Top, rect.Width + padding.Horizontal, rect.Height + padding.Vertical);
+        }
+
+        /// <summary>
+        /// 矩形减去Padding后的新矩形
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="padding">内边距</param>
+        /// <returns>新矩形</returns>
+        public static Rectangle Subtract(Rectangle rect, Padding padding)
+        {
+            return new Rectangle(rect.Left + padding.Left, rect.Top + padding.Top, rect.Width - padding.Horizontal, rect.Height - padding.Vertical);
+        }
+
+        /// <summary>
+        /// 将此矩形的位置调整指定的量。返回新矩形,不影响原来值。
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="pos">该位置的偏移量</param>
+        /// <returns>偏移后的新矩形</returns>
+        public static Rectangle Offset(Rectangle rect, Point pos)
+        {
+            rect.Offset(pos);
+            return rect;
+        }
+
+        /// <summary>
+        /// 将矩形的位置调整指定的量。返回新矩形,不影响原来值。
+        /// </summary>
+        /// <param name="rect">矩形</param>
+        /// <param name="x">水平偏移量</param>
+        /// <param name="y">垂直偏移量</param>
+        /// <returns>偏移后的新矩形</returns>
+        public static Rectangle Offset(Rectangle rect, int x, int y)
+        {
+            rect.Offset(x, y);
+            return rect;
+        }
+    }
+}

+ 55 - 0
PackageUpdater/Microsoft.Drawing/Util/SizeEx.cs

@@ -0,0 +1,55 @@
+using System.Drawing;
+
+namespace Microsoft.Drawing
+{
+    /// <summary>
+    /// Size 操作
+    /// </summary>
+    public static class SizeEx
+    {
+        /// <summary>
+        /// 调整大小非空,影响原来大小
+        /// </summary>
+        /// <param name="size">要调整的大小</param>
+        public static void MakeNotEmpty(ref Size size)
+        {
+            if (size.Width < 1)
+                size.Width = 1;
+            if (size.Height < 1)
+                size.Height = 1;
+        }
+
+        /// <summary>
+        /// 宽度放大倍数
+        /// </summary>
+        /// <param name="size">Size</param>
+        /// <param name="count">倍数</param>
+        /// <returns>新的Size</returns>
+        public static Size MultiplyWidth(Size size, int count)
+        {
+            return new Size(size.Width * count, size.Height);
+        }
+
+        /// <summary>
+        /// 高度放大倍数
+        /// </summary>
+        /// <param name="size">Size</param>
+        /// <param name="count">倍数</param>
+        /// <returns>新的Size</returns>
+        public static Size MultiplyHeight(Size size, int count)
+        {
+            return new Size(size.Width, size.Height * count);
+        }
+
+        /// <summary>
+        /// 宽度和高度放大倍数
+        /// </summary>
+        /// <param name="size">Size</param>
+        /// <param name="count">倍数</param>
+        /// <returns>新的Size</returns>
+        public static Size MultiplyBoth(Size size, int count)
+        {
+            return new Size(size.Width * count, size.Height * count);
+        }
+    }
+}

+ 155 - 0
PackageUpdater/Microsoft.Win32/Microsoft.Win32.csproj

@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{B1D6B045-127C-47FC-ADF2-CE3957F4D694}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Microsoft.Win32</RootNamespace>
+    <AssemblyName>Microsoft.Win32</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\_Output\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>..\_Output\Debug\Microsoft.Win32.XML</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\_Output\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>..\_Output\Release\Microsoft.Win32.XML</DocumentationFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="NativeMethods\Consts\AC_SRC.cs" />
+    <Compile Include="NativeMethods\Consts\AW.cs" />
+    <Compile Include="NativeMethods\Consts\BKMODE.cs" />
+    <Compile Include="NativeMethods\Consts\BOOLEAN.cs" />
+    <Compile Include="NativeMethods\Consts\CCHILDREN.cs" />
+    <Compile Include="NativeMethods\Consts\CS.cs" />
+    <Compile Include="NativeMethods\Consts\CW.cs" />
+    <Compile Include="NativeMethods\Consts\DCX.cs" />
+    <Compile Include="NativeMethods\Consts\DriverStringOptions.cs" />
+    <Compile Include="NativeMethods\Consts\DS.cs" />
+    <Compile Include="NativeMethods\Consts\ERROR.cs" />
+    <Compile Include="NativeMethods\Consts\FLASHW.cs" />
+    <Compile Include="NativeMethods\Consts\FORMAT_MESSAGE.cs" />
+    <Compile Include="NativeMethods\Consts\GA.cs" />
+    <Compile Include="NativeMethods\Consts\GCL.cs" />
+    <Compile Include="NativeMethods\Consts\GRADIENT_FILL.cs" />
+    <Compile Include="NativeMethods\Consts\GW.cs" />
+    <Compile Include="NativeMethods\Consts\GWL.cs" />
+    <Compile Include="NativeMethods\Consts\HANDLE.cs" />
+    <Compile Include="NativeMethods\Consts\HKL.cs" />
+    <Compile Include="NativeMethods\Consts\HT.cs" />
+    <Compile Include="NativeMethods\Consts\HWND.cs" />
+    <Compile Include="NativeMethods\Consts\INFINITE.cs" />
+    <Compile Include="NativeMethods\Consts\INPUT.cs" />
+    <Compile Include="NativeMethods\Consts\IOC.cs" />
+    <Compile Include="NativeMethods\Consts\KEYEVENTF.cs" />
+    <Compile Include="NativeMethods\Consts\KLF.cs" />
+    <Compile Include="NativeMethods\Consts\MA.cs" />
+    <Compile Include="NativeMethods\Consts\MK.cs" />
+    <Compile Include="NativeMethods\Consts\MMIO.cs" />
+    <Compile Include="NativeMethods\Consts\MOUSEDATA.cs" />
+    <Compile Include="NativeMethods\Consts\MOUSEEVENTF.cs" />
+    <Compile Include="NativeMethods\Consts\NULL.cs" />
+    <Compile Include="NativeMethods\Consts\OBJID.cs" />
+    <Compile Include="NativeMethods\Consts\RDW.cs" />
+    <Compile Include="NativeMethods\Consts\RGN.cs" />
+    <Compile Include="NativeMethods\Consts\ROP.cs" />
+    <Compile Include="NativeMethods\Consts\SB.cs" />
+    <Compile Include="NativeMethods\Consts\SBM.cs" />
+    <Compile Include="NativeMethods\Consts\SC.cs" />
+    <Compile Include="NativeMethods\Consts\SCR.cs" />
+    <Compile Include="NativeMethods\Consts\SIF.cs" />
+    <Compile Include="NativeMethods\Consts\SIO.cs" />
+    <Compile Include="NativeMethods\Consts\SM.cs" />
+    <Compile Include="NativeMethods\Consts\SND.cs" />
+    <Compile Include="NativeMethods\Consts\SOMAXCONN.cs" />
+    <Compile Include="NativeMethods\Consts\SS.cs" />
+    <Compile Include="NativeMethods\Consts\STATE_SYSTEM.cs" />
+    <Compile Include="NativeMethods\Consts\SW.cs" />
+    <Compile Include="NativeMethods\Consts\SWP.cs" />
+    <Compile Include="NativeMethods\Consts\TTDT.cs" />
+    <Compile Include="NativeMethods\Consts\TTF.cs" />
+    <Compile Include="NativeMethods\Consts\TTI.cs" />
+    <Compile Include="NativeMethods\Consts\TTM.cs" />
+    <Compile Include="NativeMethods\Consts\TTN.cs" />
+    <Compile Include="NativeMethods\Consts\TTS.cs" />
+    <Compile Include="NativeMethods\Consts\ULW.cs" />
+    <Compile Include="NativeMethods\Consts\VK.cs" />
+    <Compile Include="NativeMethods\Consts\WAVE_FORMAT.cs" />
+    <Compile Include="NativeMethods\Consts\WM.cs" />
+    <Compile Include="NativeMethods\Consts\WS.cs" />
+    <Compile Include="NativeMethods\Consts\WSAID.cs" />
+    <Compile Include="NativeMethods\Consts\WSA_FLAG.cs" />
+    <Compile Include="NativeMethods\Consts\WS_EX.cs" />
+    <Compile Include="NativeMethods\Delegates\LPFN_ACCEPTEX.cs" />
+    <Compile Include="NativeMethods\Delegates\LPFN_CONNECTEX.cs" />
+    <Compile Include="NativeMethods\Delegates\LPFN_DISCONNECTEX.cs" />
+    <Compile Include="NativeMethods\Structs\BLENDFUNCTION.cs" />
+    <Compile Include="NativeMethods\Structs\COMBOBOXINFO.cs" />
+    <Compile Include="NativeMethods\Structs\COPYDATASTRUCT.cs" />
+    <Compile Include="NativeMethods\Structs\CURSORINFO.cs" />
+    <Compile Include="NativeMethods\Structs\FLASHWINFO.cs" />
+    <Compile Include="NativeMethods\Structs\GRADIENT_RECT.cs" />
+    <Compile Include="NativeMethods\Structs\GRADIENT_TRIANGLE.cs" />
+    <Compile Include="NativeMethods\Structs\HARDWAREINPUT.cs" />
+    <Compile Include="NativeMethods\Structs\INPUT.cs" />
+    <Compile Include="NativeMethods\Structs\KEYBDINPUT.cs" />
+    <Compile Include="NativeMethods\Structs\MINMAXINFO.cs" />
+    <Compile Include="NativeMethods\Structs\MMCKINFO.cs" />
+    <Compile Include="NativeMethods\Structs\MOUSEINPUT.cs" />
+    <Compile Include="NativeMethods\Structs\NMHDR.cs" />
+    <Compile Include="NativeMethods\Structs\PAINTSTRUCT.cs" />
+    <Compile Include="NativeMethods\Structs\POINT.cs" />
+    <Compile Include="NativeMethods\Structs\RECT.cs" />
+    <Compile Include="NativeMethods\Structs\SCROLLBARINFO.cs" />
+    <Compile Include="NativeMethods\Structs\SCROLLINFO.cs" />
+    <Compile Include="NativeMethods\Structs\TOOLINFO.cs" />
+    <Compile Include="NativeMethods\Structs\TRIVERTEX.cs" />
+    <Compile Include="NativeMethods\Structs\WAVEFORMATEX.cs" />
+    <Compile Include="NativeMethods\Structs\WINDOWPOS.cs" />
+    <Compile Include="NativeMethods\Structs\WSABUF.cs" />
+    <Compile Include="NativeMethods\Structs\WSAData.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="UnsafeNativeMethods\Gdi32.cs" />
+    <Compile Include="UnsafeNativeMethods\Gdiplus.cs" />
+    <Compile Include="UnsafeNativeMethods\Kernel32.cs" />
+    <Compile Include="UnsafeNativeMethods\Msimg32.cs" />
+    <Compile Include="UnsafeNativeMethods\Shell32.cs" />
+    <Compile Include="UnsafeNativeMethods\User32.cs" />
+    <Compile Include="UnsafeNativeMethods\Winmm.cs" />
+    <Compile Include="UnsafeNativeMethods\Ws2_32.cs" />
+    <Compile Include="Util\Kernel32.cs" />
+    <Compile Include="Util\User32.cs" />
+    <Compile Include="Util\Ws2_32.cs" />
+    <Compile Include="Util\_Util.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 15 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/AC_SRC.cs

@@ -0,0 +1,15 @@
+namespace Microsoft.Win32
+{
+    //AC_SRC定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// currentlly defined blend function
+        /// </summary>
+        public const byte AC_SRC_OVER = 0x00;
+        /// <summary>
+        /// alpha format flags
+        /// </summary>
+        public const byte AC_SRC_ALPHA = 0x01;
+    }
+}

+ 43 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/AW.cs

@@ -0,0 +1,43 @@
+namespace Microsoft.Win32
+{
+    //AW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
+        /// </summary>
+        public const int AW_HOR_POSITIVE = 0x00000001;
+        /// <summary>
+        /// Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
+        /// </summary>
+        public const int AW_HOR_NEGATIVE = 0x00000002;
+        /// <summary>
+        /// Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
+        /// </summary>
+        public const int AW_VER_POSITIVE = 0x00000004;
+        /// <summary>
+        /// Animates the window from bottom to top. This flag can be use
+        /// </summary>
+        public const int AW_VER_NEGATIVE = 0x00000008;
+        /// <summary>
+        /// Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. The various direction flags have no effect.
+        /// </summary>
+        public const int AW_CENTER = 0x00000010;
+        /// <summary>
+        /// Hides the window. By default, the window is shown.
+        /// </summary>
+        public const int AW_HIDE = 0x00010000;
+        /// <summary>
+        /// Activates the window. Do not use this value with AW_HIDE.
+        /// </summary>
+        public const int AW_ACTIVATE = 0x00020000;
+        /// <summary>
+        /// Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER.
+        /// </summary>
+        public const int AW_SLIDE = 0x00040000;
+        /// <summary>
+        /// Uses a fade effect. This flag can be used only if hwnd is a top-level window.
+        /// </summary>
+        public const int AW_BLEND = 0x00080000;
+    }
+}

+ 19 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/BKMODE.cs

@@ -0,0 +1,19 @@
+namespace Microsoft.Win32
+{
+    //BKMODE定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Background remains untouched.
+        /// </summary>
+        public const int TRANSPARENT = 1;
+        /// <summary>
+        /// Background is filled with the current background color before the text, hatched brush, or pen is drawn.
+        /// </summary>
+        public const int OPAQUE = 2;
+        /// <summary>
+        /// 无效,值与OPAQUE相同
+        /// </summary>
+        public const int BKMODE_LAST = 2;
+    }
+}

+ 17 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/BOOLEAN.cs

@@ -0,0 +1,17 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //BOOLEAN定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 真
+        /// </summary>
+        public static readonly IntPtr TRUE = new IntPtr(1);
+        /// <summary>
+        /// 假
+        /// </summary>
+        public static readonly IntPtr FALSE = IntPtr.Zero;
+    }
+}

+ 15 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CCHILDREN.cs

@@ -0,0 +1,15 @@
+namespace Microsoft.Win32
+{
+    //CCHILDREN定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// TITLEBARINFO::rgstate 的最大索引
+        /// </summary>
+        public const int CCHILDREN_TITLEBAR = 5;
+        /// <summary>
+        /// SCROLLBARINFO::rgstate 的最大索引
+        /// </summary>
+        public const int CCHILDREN_SCROLLBAR = 5;
+    }
+}

File diff suppressed because it is too large
+ 59 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CS.cs


+ 11 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/CW.cs

@@ -0,0 +1,11 @@
+namespace Microsoft.Win32
+{
+    //CW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// CreateWindow x,y,nWidth,nHeight 默认值
+        /// </summary>
+        public const int CW_USEDEFAULT = unchecked((int)0x80000000);
+    }
+}

+ 55 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DCX.cs

@@ -0,0 +1,55 @@
+namespace Microsoft.Win32
+{
+    //DCX定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Returns a DC that corresponds to the window rectangle rather than the client rectangle.
+        /// </summary>
+        public const int DCX_WINDOW = 0x00000001;
+        /// <summary>
+        /// Returns a DC from the cache, rather than the OWNDC or CLASSDC window. Essentially overrides CS_OWNDC and CS_CLASSDC.
+        /// </summary>
+        public const int DCX_CACHE = 0x00000002;
+        /// <summary>
+        /// Does not reset the attributes of this DC to the default attributes when this DC is released.
+        /// </summary>
+        public const int DCX_NORESETATTRS = 0x00000004;
+        /// <summary>
+        /// Excludes the visible regions of all child windows below the window identified by hWnd.
+        /// </summary>
+        public const int DCX_CLIPCHILDREN = 0x00000008;
+        /// <summary>
+        /// Excludes the visible regions of all sibling windows above the window identified by hWnd.
+        /// </summary>
+        public const int DCX_CLIPSIBLINGS = 0x00000010;
+        /// <summary>
+        /// Uses the visible region of the parent window. The parent's WS_CLIPCHILDREN and CS_PARENTDC style bits are ignored. The origin is set to the upper-left corner of the window identified by hWnd.
+        /// </summary>
+        public const int DCX_PARENTCLIP = 0x00000020;
+        /// <summary>
+        /// The clipping region identified by hrgnClip is excluded from the visible region of the returned DC.
+        /// </summary>
+        public const int DCX_EXCLUDERGN = 0x00000040;
+        /// <summary>
+        /// The clipping region identified by hrgnClip is intersected with the visible region of the returned DC.
+        /// </summary>
+        public const int DCX_INTERSECTRGN = 0x00000080;
+        /// <summary>
+        /// DCX_EXCLUDEUPDATE
+        /// </summary>
+        public const int DCX_EXCLUDEUPDATE = 0x00000100;
+        /// <summary>
+        /// Reserved; do not use.
+        /// </summary>
+        public const int DCX_INTERSECTUPDATE = 0x00000200;
+        /// <summary>
+        /// Allows drawing even if there is a LockWindowUpdate call in effect that would otherwise exclude this window. Used for drawing during tracking.
+        /// </summary>
+        public const int DCX_LOCKWINDOWUPDATE = 0x00000400;
+        /// <summary>
+        /// Reserved; do not use.
+        /// </summary>
+        public const int DCX_VALIDATE = 0x00200000;
+    }
+}

File diff suppressed because it is too large
+ 73 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DS.cs


+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/DriverStringOptions.cs

@@ -0,0 +1,23 @@
+namespace Microsoft.Win32
+{
+    //DriverStringOptions定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Specifies that the string array contains Unicode character values. If this flag is not set, each value in array is interpreted as an index to a font glyph that defines a character to be displayed.
+        /// </summary>
+        public const int DriverStringOptionsCmapLookup = 0x00000001;
+        /// <summary>
+        /// Specifies that the string is displayed vertically.
+        /// </summary>
+        public const int DriverStringOptionsVertical = 0x00000002;
+        /// <summary>
+        /// Specifies that the glyph positions are calculated from the position of the first glyph. If this flag is not set, the glyph positions are obtained from an array of coordinates.
+        /// </summary>
+        public const int DriverStringOptionsAdvance = 0x00000004;
+        /// <summary>
+        /// Specifies that less memory should be used for cache of antialiased glyphs. This also produces lower quality. If this flag is set, more memory is used, but the quality is higher.
+        /// </summary>
+        public const int DriverStringOptionsLimitSubpixel = 0x00000008;
+    }
+}

File diff suppressed because it is too large
+ 17269 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ERROR.cs


+ 31 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/FLASHW.cs

@@ -0,0 +1,31 @@
+namespace Microsoft.Win32
+{
+    //FLASHW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Stop flashing. The system restores the window to its original state.
+        /// </summary>
+        public const int FLASHW_STOP = 0x00000000;
+        /// <summary>
+        /// Flash the window caption.
+        /// </summary>
+        public const int FLASHW_CAPTION = 0x00000001;
+        /// <summary>
+        /// Flash the taskbar button.
+        /// </summary>
+        public const int FLASHW_TRAY = 0x00000002;
+        /// <summary>
+        /// Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
+        /// </summary>
+        public const int FLASHW_ALL = 0x00000003;
+        /// <summary>
+        /// Flash continuously, until the FLASHW_STOP flag is set.
+        /// </summary>
+        public const int FLASHW_TIMER = 0x00000004;
+        /// <summary>
+        /// Flash continuously until the window comes to the foreground.
+        /// </summary>
+        public const int FLASHW_TIMERNOFG = 0x0000000C;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/FORMAT_MESSAGE.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //FORMAT_MESSAGE定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 函数会分配一个足够大的缓冲区保存格式化消息,并且通过lpBuffer指向该地址。
+        /// </summary>
+        public const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
+        /// <summary>
+        /// 消息定义中的插入序列会被一直忽略和跳过直到输出缓冲区不改变,并且Arguments会被忽略。
+        /// </summary>
+        public const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
+        /// <summary>
+        /// lpSource参数是一个指向以NULL结尾的字符串,字符串包含一个消息定义,这个消息定义可以包含插入序列。此标志最好不要和FORMAT_MESSAGE_FROM_HMODULE或者FORMAT_MESSAGE_FROM_SYSTEM使用
+        /// </summary>
+        public const int FORMAT_MESSAGE_FROM_STRING = 0x00000400;
+        /// <summary>
+        /// lpSource参数是需要去搜索的一个包含消息表的模块线程。如果lpSource是NULL,当前进程的应用图像会被搜索,这个标志不能同FORMAT_MESSAGE_FROM_STRING使用。
+        /// </summary>
+        public const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800;
+        /// <summary>
+        /// 函数会为了请求的信息而搜索系统的消息表资源。如果标志同时也指定了FORMAT_MESSAGE_FROM_HMODULE,那么函数会先在lpSource指定的模块中搜索请求的消息,如果搜索不到,就去搜索系统消息表资源。此标志不能与FORMAT_MESSAGE_FROM_STRING使用。
+        /// </summary>
+        public const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
+        /// <summary>
+        /// Arguments参数不是指向va_list结构体,但是是一个指向保存参数的数据。
+        /// </summary>
+        public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
+        /// <summary>
+        /// 掩码
+        /// </summary>
+        public const int FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF;
+    }
+}

+ 19 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GA.cs

@@ -0,0 +1,19 @@
+namespace Microsoft.Win32
+{
+    //GA定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
+        /// </summary>
+        public const uint GA_PARENT = 1;
+        /// <summary>
+        /// Retrieves the root window by walking the chain of parent windows.
+        /// </summary>
+        public const uint GA_ROOT = 2;
+        /// <summary>
+        /// Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent.
+        /// </summary>
+        public const uint GA_ROOTOWNER = 3;
+    }
+}

+ 51 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GCL.cs

@@ -0,0 +1,51 @@
+namespace Microsoft.Win32
+{
+    //GCL定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 获取或设置菜单名字符串的地址。该字符串标识与类有关的菜单资源。
+        /// </summary>
+        public const int GCL_MENUNAME = -8;
+        /// <summary>
+        /// 获取或设置与类有关的背景刷子的句柄。
+        /// </summary>
+        public const int GCL_HBRBACKGROUND = -10;
+        /// <summary>
+        /// 获取或设置与类有关的光标的句柄。
+        /// </summary>
+        public const int GCL_HCURSOR = -12;
+        /// <summary>
+        /// 获取或设置与类有关的图标的句柄。
+        /// </summary>
+        public const int GCL_HICON = -14;
+        /// <summary>
+        /// 获取或设置注册类的模块的句柄。
+        /// </summary>
+        public const int GCL_HMODULE = -16;
+        /// <summary>
+        /// 获取或设置与类中的每一个窗口相关的尺寸的字节大小。设定该值不改变已分配额外字节数。查看如何进入该内存,参看SetWindowLOng。
+        /// </summary>
+        public const int GCL_CBWNDEXTRA = -18;
+        /// <summary>
+        /// 获取或设置与类相关的尺寸的字节大小。设定该值不改变己分配的额外字节数。
+        /// </summary>
+        public const int GCL_CBCLSEXTRA = -20;
+        /// <summary>
+        /// 获取或设置与窗口类有关的窗口过程的地址。
+        /// </summary>
+        public const int GCL_WNDPROC = -24;
+        /// <summary>
+        /// 获取或设置窗口类的风格位。
+        /// </summary>
+        public const int GCL_STYLE = -26;
+        /// <summary>
+        /// 获取或设置一个 ATOM值唯一标识窗口类。这是在相同的原子RegisterClassEx函数返回。
+        /// </summary>
+        public const int GCW_ATOM = -32;
+        /// <summary>
+        /// 获取或设置一个句柄与类关联的小图标。
+        /// </summary>
+        public const int GCL_HICONSM = -34;
+    }
+}

+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GRADIENT_FILL.cs

@@ -0,0 +1,23 @@
+namespace Microsoft.Win32
+{
+    //GRADIENT_FILL定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 在该模式下,两个端点表示一个矩形。该矩形被定义成左右边界具有固定颜色(由TRIVERTEX结构指定)。GDI从上至下插入颜色,并填充内部区域。
+        /// </summary>
+        public const uint GRADIENT_FILL_RECT_H = 0x00000000;
+        /// <summary>
+        /// 在该模式下,两个端点表示一个矩形。该矩形定义其顶部和底部边界的颜色为固定值(通过TRIVERTEX结构指定),GDI从顶至底部边界插入颜色,并填充内部区域。
+        /// </summary>
+        public const uint GRADIENT_FILL_RECT_V = 0x00000001;
+        /// <summary>
+        /// 在该模式下,TRIVERTEX结构数组以及描述单个三角形的数组索引序列被传给GDI。GDI在三角形顶点之间进行线性插值,并填充内部区域。在24和32位/像素模式下,绘图是直接进行。在16、8、4和1位/像素模式中进行抖动处理。
+        /// </summary>
+        public const uint GRADIENT_FILL_TRIANGLE = 0x00000002;
+        /// <summary>
+        /// 该值无效
+        /// </summary>
+        public const uint GRADIENT_FILL_OP_FLAG = 0x000000ff;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GW.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //GW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The retrieved handle identifies the window of the same type that is highest in the Z order.If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
+        /// </summary>
+        public const uint GW_HWNDFIRST = 0;
+        /// <summary>
+        /// The retrieved handle identifies the window of the same type that is lowest in the Z order.If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
+        /// </summary>
+        public const uint GW_HWNDLAST = 1;
+        /// <summary>
+        /// The retrieved handle identifies the window below the specified window in the Z order.If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
+        /// </summary>
+        public const uint GW_HWNDNEXT = 2;
+        /// <summary>
+        /// The retrieved handle identifies the window above the specified window in the Z order.If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
+        /// </summary>
+        public const uint GW_HWNDPREV = 3;
+        /// <summary>
+        /// The retrieved handle identifies the specified window's owner window, if any. For more information, see Owned Windows.
+        /// </summary>
+        public const uint GW_OWNER = 4;
+        /// <summary>
+        /// The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the retrieved handle is NULL. The function examines only child windows of the specified window. It does not examine descendant windows.
+        /// </summary>
+        public const uint GW_CHILD = 5;
+        /// <summary>
+        /// The retrieved handle identifies the enabled popup window owned by the specified window (the search uses the first such window found using GW_HWNDNEXT); otherwise, if there are no enabled popup windows, the retrieved handle is that of the specified window.
+        /// </summary>
+        public const uint GW_ENABLEDPOPUP = 6;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/GWL.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //GWL定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Retrieves the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
+        /// </summary>
+        public const int GWL_USERDATA = -21;
+        /// <summary>
+        /// Retrieves the extended window styles.
+        /// </summary>
+        public const int GWL_EXSTYLE = -20;
+        /// <summary>
+        /// Retrieves the window styles.
+        /// </summary>
+        public const int GWL_STYLE = -16;
+        /// <summary>
+        /// Retrieves the identifier of the window.
+        /// </summary>
+        public const int GWL_ID = -12;
+        /// <summary>
+        /// Retrieves a handle to the parent window, if any.GetWindowLong return parent window handle,SetWindowLong set owner window handle.See also GetParent(if parent is NULL return owner window handle) Set Parent.Tim 2013.11.23
+        /// </summary>
+        public const int GWL_HWNDPARENT = -8;
+        /// <summary>
+        /// Retrieves a handle to the application instance.
+        /// </summary>
+        public const int GWL_HINSTANCE = -6;
+        /// <summary>
+        /// Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.
+        /// </summary>
+        public const int GWL_WNDPROC = -4;
+    }
+}

+ 13 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HANDLE.cs

@@ -0,0 +1,13 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //HANDLE定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 无效句柄值
+        /// </summary>
+        public static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
+    }
+}

+ 17 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HKL.cs

@@ -0,0 +1,17 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //HKL定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Selects the previous locale identifier in the circular list of loaded locale identifiers maintained by the system.
+        /// </summary>
+        public static readonly IntPtr HKL_PREV = IntPtr.Zero;
+        /// <summary>
+        /// Selects the next locale identifier in the circular list of loaded locale identifiers maintained by the system.
+        /// </summary>
+        public static readonly IntPtr HKL_NEXT = new IntPtr(1);
+    }
+}

+ 123 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HT.cs

@@ -0,0 +1,123 @@
+namespace Microsoft.Win32
+{
+    //HT定义,参见winuser.h
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to indicate an error).
+        /// </summary>
+        public const int HTERROR = -2;
+        /// <summary>
+        /// In a window currently covered by another window in the same thread (the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT).
+        /// </summary>
+        public const int HTTRANSPARENT = -1;
+        /// <summary>
+        /// On the screen background or on a dividing line between windows.
+        /// </summary>
+        public const int HTNOWHERE = 0;
+        /// <summary>
+        /// In a client area.
+        /// </summary>
+        public const int HTCLIENT = 1;
+        /// <summary>
+        /// In a title bar.
+        /// </summary>
+        public const int HTCAPTION = 2;
+        /// <summary>
+        /// In a window menu or in a Close button in a child window.
+        /// </summary>
+        public const int HTSYSMENU = 3;
+        /// <summary>
+        /// In a size box (same as HTGROWBOX).
+        /// </summary>
+        public const int HTSIZE = 4;
+        /// <summary>
+        /// In a size box (same as HTSIZE).
+        /// </summary>
+        public const int HTGROWBOX = HTSIZE;
+        /// <summary>
+        /// In a menu.
+        /// </summary>
+        public const int HTMENU = 5;
+        /// <summary>
+        /// In a horizontal scroll bar.
+        /// </summary>
+        public const int HTHSCROLL = 6;
+        /// <summary>
+        /// In the vertical scroll bar.
+        /// </summary>
+        public const int HTVSCROLL = 7;
+        /// <summary>
+        /// In a Minimize button.
+        /// </summary>
+        public const int HTMINBUTTON = 8;
+        /// <summary>
+        /// In a Maximize button.
+        /// </summary>
+        public const int HTMAXBUTTON = 9;
+        /// <summary>
+        /// In the left border of a resizable window (the user can click the mouse to resize the window horizontally).
+        /// </summary>
+        public const int HTLEFT = 10;
+        /// <summary>
+        /// In the right border of a resizable window (the user can click the mouse to resize the window horizontally).
+        /// </summary>
+        public const int HTRIGHT = 11;
+        /// <summary>
+        /// In the upper-horizontal border of a window.
+        /// </summary>
+        public const int HTTOP = 12;
+        /// <summary>
+        /// In the upper-left corner of a window border.
+        /// </summary>
+        public const int HTTOPLEFT = 13;
+        /// <summary>
+        /// In the upper-right corner of a window border.
+        /// </summary>
+        public const int HTTOPRIGHT = 14;
+        /// <summary>
+        /// In the lower-horizontal border of a resizable window (the user can click the mouse to resize the window vertically).
+        /// </summary>
+        public const int HTBOTTOM = 15;
+        /// <summary>
+        /// In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
+        /// </summary>
+        public const int HTBOTTOMLEFT = 16;
+        /// <summary>
+        /// In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
+        /// </summary>
+        public const int HTBOTTOMRIGHT = 17;
+        /// <summary>
+        /// In the border of a window that does not have a sizing border.
+        /// </summary>
+        public const int HTBORDER = 18;
+        /// <summary>
+        /// In a Minimize button.
+        /// </summary>
+        public const int HTREDUCE = HTMINBUTTON;
+        /// <summary>
+        /// In a Maximize button.
+        /// </summary>
+        public const int HTZOOM = HTMAXBUTTON;
+        /// <summary>
+        /// HTSIZEFIRST
+        /// </summary>
+        public const int HTSIZEFIRST = HTLEFT;
+        /// <summary>
+        /// HTSIZELAST
+        /// </summary>
+        public const int HTSIZELAST = HTBOTTOMRIGHT;
+        /// <summary>
+        /// HTOBJECT
+        /// </summary>
+        public const int HTOBJECT = 19;
+        /// <summary>
+        /// In a Close button.
+        /// </summary>
+        public const int HTCLOSE = 20;
+        /// <summary>
+        /// In a Help button.
+        /// </summary>
+        public const int HTHELP = 21;
+    }
+}

+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/HWND.cs

@@ -0,0 +1,39 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //HWND定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 桌面窗口句柄  参见MapWindowPoints
+        /// </summary>
+        public static readonly IntPtr HWND_DESKTOP = IntPtr.Zero;
+
+        /// <summary>
+        /// 将窗口置于Z序的顶部。 参见SetWindowPos
+        /// </summary>
+        public static readonly IntPtr HWND_TOP = IntPtr.Zero;
+        /// <summary>
+        /// 将窗口置于Z序的底部。如果参数hWnd标识了一个顶层窗口,则窗口失去顶级位置,并且被置在其他窗口的底部。 参见SetWindowPos
+        /// </summary>
+        public static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
+        /// <summary>
+        /// 将窗口置于所有非顶层窗口之上。即使窗口未被激活窗口也将保持顶级位置。 参见SetWindowPos
+        /// </summary>
+        public static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
+        /// <summary>
+        /// 将窗口置于所有非顶层窗口之上(即在所有顶层窗口之后)。如果窗口已经是非顶层窗口则该标志不起作用。 参见SetWindowPos
+        /// </summary>
+        public static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
+
+        /// <summary>
+        /// 消息被寄送到系统的所有顶层窗口,包括无效或不可见的非自身拥有的窗口、 被覆盖的窗口和弹出式窗口。消息不被寄送到子窗口  参见PostMessage
+        /// </summary>
+        public static readonly IntPtr HWND_BROADCAST = new IntPtr(0xFFFF);
+        /// <summary>
+        /// 如果hwndParent是HWND_MESSAGE,函数仅查找所有消息窗口。 参见FindWindowEx
+        /// </summary>
+        public static readonly IntPtr HWND_MESSAGE = new IntPtr(-3);
+    }
+}

+ 11 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/INFINITE.cs

@@ -0,0 +1,11 @@
+namespace Microsoft.Win32
+{
+    //INFINITE定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Infinite timeout
+        /// </summary>
+        public const int INFINITE = unchecked((int)0xFFFFFFFF);
+    }
+}

+ 19 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/INPUT.cs

@@ -0,0 +1,19 @@
+namespace Microsoft.Win32
+{
+    //INPUT定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The event is a mouse event. Use the mi structure of the union.
+        /// </summary>
+        public const int INPUT_MOUSE = 0;
+        /// <summary>
+        /// The event is a keyboard event. Use the ki structure of the union.
+        /// </summary>
+        public const int INPUT_KEYBOARD = 1;
+        /// <summary>
+        /// The event is a hardware event. Use the hi structure of the union.
+        /// </summary>
+        public const int INPUT_HARDWARE = 2;
+    }
+}

+ 49 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/IOC.cs

@@ -0,0 +1,49 @@
+namespace Microsoft.Win32
+{
+    //IOC定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// parameters must be &lt; 128 bytes
+        /// </summary>
+        public const int IOCPARM_MASK = 0x7F;
+        /// <summary>
+        /// no parameters
+        /// </summary>
+        public const int IOC_VOID = 0x20000000;
+        /// <summary>
+        /// copy out parameters
+        /// </summary>
+        public const int IOC_OUT = 0x40000000;
+        /// <summary>
+        /// copy in parameters
+        /// </summary>
+        public const int IOC_IN = unchecked((int)0x80000000);
+        /// <summary>
+        /// IOC_IN | IOC_OUT
+        /// </summary>
+        public const int IOC_INOUT = (IOC_IN | IOC_OUT);
+
+        /// <summary>
+        /// IOC_UNIX
+        /// </summary>
+        public const int IOC_UNIX = 0x00000000;
+        /// <summary>
+        /// IOC_WS2
+        /// </summary>
+        public const int IOC_WS2 = 0x08000000;
+        /// <summary>
+        /// IOC_PROTOCOL
+        /// </summary>
+        public const int IOC_PROTOCOL = 0x10000000;
+        /// <summary>
+        /// IOC_VENDOR
+        /// </summary>
+        public const int IOC_VENDOR = 0x18000000;
+
+        /// <summary>
+        /// IOC_WSK
+        /// </summary>
+        public const int IOC_WSK = (IOC_WS2 | 0x07000000);
+    }
+}

+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/KEYEVENTF.cs

@@ -0,0 +1,23 @@
+namespace Microsoft.Win32
+{
+    //KEYEVENTF定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// If specified, the scan code was preceded by a prefix byte that has the value 0xE0 (224).
+        /// </summary>
+        public const int KEYEVENTF_EXTENDEDKEY = 0x0001;
+        /// <summary>
+        /// If specified, the key is being released. If not specified, the key is being pressed.
+        /// </summary>
+        public const int KEYEVENTF_KEYUP = 0x0002;
+        /// <summary>
+        /// If specified, the system synthesizes a VK_PACKET keystroke. The wVk parameter must be zero. This flag can only be combined with the KEYEVENTF_KEYUP flag. For more information, see the Remarks section.
+        /// </summary>
+        public const int KEYEVENTF_UNICODE = 0x0004;
+        /// <summary>
+        /// If specified, wScan identifies the key and wVk is ignored.
+        /// </summary>
+        public const int KEYEVENTF_SCANCODE = 0x0008;
+    }
+}

File diff suppressed because it is too large
+ 27 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/KLF.cs


+ 25 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MA.cs

@@ -0,0 +1,25 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //MA定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        public static readonly IntPtr MA_ACTIVATE = new IntPtr(1);
+        /// <summary>
+        /// 
+        /// </summary>
+        public static readonly IntPtr MA_ACTIVATEANDEAT = new IntPtr(2);
+        /// <summary>
+        /// 
+        /// </summary>
+        public static readonly IntPtr MA_NOACTIVATE = new IntPtr(3);
+        /// <summary>
+        /// 
+        /// </summary>
+        public static readonly IntPtr MA_NOACTIVATEANDEAT = new IntPtr(4);
+    }
+}

+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MK.cs

@@ -0,0 +1,39 @@
+namespace Microsoft.Win32
+{
+    //MK定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// none keys were down.
+        /// </summary>
+        public const int MK_NONE = 0x0000;
+        /// <summary>
+        /// The left mouse button is down.
+        /// </summary>
+        public const int MK_LBUTTON = 0x0001;
+        /// <summary>
+        /// The right mouse button is down.
+        /// </summary>
+        public const int MK_RBUTTON = 0x0002;
+        /// <summary>
+        /// The SHIFT key is down.
+        /// </summary>
+        public const int MK_SHIFT = 0x0004;
+        /// <summary>
+        /// The CTRL key is down.
+        /// </summary>
+        public const int MK_CONTROL = 0x0008;
+        /// <summary>
+        /// The middle mouse button is down.
+        /// </summary>
+        public const int MK_MBUTTON = 0x0010;
+        /// <summary>
+        /// The first X button is down.
+        /// </summary>
+        public const int MK_XBUTTON1 = 0x0020;
+        /// <summary>
+        /// The second X button is down.
+        /// </summary>
+        public const int MK_XBUTTON2 = 0x0040;
+    }
+}

+ 19 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MMIO.cs

@@ -0,0 +1,19 @@
+namespace Microsoft.Win32
+{
+    //MMIO定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// MMIO_READ
+        /// </summary>
+        public const int MMIO_READ = 0;
+        /// <summary>
+        /// MMIO_FINDRIFF
+        /// </summary>
+        public const int MMIO_FINDRIFF = 0x20;
+        /// <summary>
+        /// MMIO_ALLOCBUF
+        /// </summary>
+        public const int MMIO_ALLOCBUF = 0x10000;
+    }
+}

+ 17 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MOUSEDATA.cs

@@ -0,0 +1,17 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //MOUSEDATA定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Set if the first X button is pressed or released.
+        /// </summary>
+        public const int XBUTTON1 = 0x0001;
+        /// <summary>
+        /// Set if the second X button is pressed or released.
+        /// </summary>
+        public const int XBUTTON2 = 0x0002;
+    }
+}

+ 63 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/MOUSEEVENTF.cs

@@ -0,0 +1,63 @@
+namespace Microsoft.Win32
+{
+    //MOUSEEVENTF定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Movement occurred.
+        /// </summary>
+        public const int MOUSEEVENTF_MOVE = 0x0001;
+        /// <summary>
+        /// The left button was pressed.
+        /// </summary>
+        public const int MOUSEEVENTF_LEFTDOWN = 0x0002;
+        /// <summary>
+        /// The left button was released.
+        /// </summary>
+        public const int MOUSEEVENTF_LEFTUP = 0x0004;
+        /// <summary>
+        /// The right button was pressed.
+        /// </summary>
+        public const int MOUSEEVENTF_RIGHTDOWN = 0x0008;
+        /// <summary>
+        /// The right button was released.
+        /// </summary>
+        public const int MOUSEEVENTF_RIGHTUP = 0x0010;
+        /// <summary>
+        /// The middle button was pressed.
+        /// </summary>
+        public const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
+        /// <summary>
+        /// The middle button was released.
+        /// </summary>
+        public const int MOUSEEVENTF_MIDDLEUP = 0x0040;
+        /// <summary>
+        /// An X button was pressed.
+        /// </summary>
+        public const int MOUSEEVENTF_XDOWN = 0x0080;
+        /// <summary>
+        /// An X button was released.
+        /// </summary>
+        public const int MOUSEEVENTF_XUP = 0x0100;
+        /// <summary>
+        /// The wheel was moved, if the mouse has a wheel. The amount of movement is specified in mouseData.
+        /// </summary>
+        public const int MOUSEEVENTF_WHEEL = 0x0800;
+        /// <summary>
+        /// The wheel was moved horizontally, if the mouse has a wheel. The amount of movement is specified in mouseData.Windows XP/2000:  This value is not supported.
+        /// </summary>
+        public const int MOUSEEVENTF_HWHEEL = 0x01000;
+        /// <summary>
+        /// The WM_MOUSEMOVE messages will not be coalesced. The default behavior is to coalesce WM_MOUSEMOVE messages.Windows XP/2000:  This value is not supported.
+        /// </summary>
+        public const int MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000;
+        /// <summary>
+        /// Maps coordinates to the entire desktop. Must be used with MOUSEEVENTF_ABSOLUTE.
+        /// </summary>
+        public const int MOUSEEVENTF_VIRTUALDESK = 0x4000;
+        /// <summary>
+        /// The dx and dy members contain normalized absolute coordinates. If the flag is not set, dxand dy contain relative data (the change in position since the last reported position). This flag can be set, or not set, regardless of what kind of mouse or other pointing device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
+        /// </summary>
+        public const int MOUSEEVENTF_ABSOLUTE = 0x8000;
+    }
+}

+ 13 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/NULL.cs

@@ -0,0 +1,13 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //NULL定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 空指针
+        /// </summary>
+        public static readonly IntPtr NULL = IntPtr.Zero;
+    }
+}

+ 63 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/OBJID.cs

@@ -0,0 +1,63 @@
+namespace Microsoft.Win32
+{
+    //OBJID定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 窗口
+        /// </summary>
+        public const int OBJID_WINDOW = 0x00000000;
+        /// <summary>
+        /// 系统菜单
+        /// </summary>
+        public const int OBJID_SYSMENU = unchecked((int)0xFFFFFFFF);
+        /// <summary>
+        /// 标题栏
+        /// </summary>
+        public const int OBJID_TITLEBAR = unchecked((int)0xFFFFFFFE);
+        /// <summary>
+        /// 菜单
+        /// </summary>
+        public const int OBJID_MENU = unchecked((int)0xFFFFFFFD);
+        /// <summary>
+        /// 客户区
+        /// </summary>
+        public const int OBJID_CLIENT = unchecked((int)0xFFFFFFFC);
+        /// <summary>
+        /// 垂直滚动条
+        /// </summary>
+        public const int OBJID_VSCROLL = unchecked((int)0xFFFFFFFB);
+        /// <summary>
+        /// 水平滚动条
+        /// </summary>
+        public const int OBJID_HSCROLL = unchecked((int)0xFFFFFFFA);
+        /// <summary>
+        /// 调整大小手柄
+        /// </summary>
+        public const int OBJID_SIZEGRIP = unchecked((int)0xFFFFFFF9);
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int OBJID_CARET = unchecked((int)0xFFFFFFF8);
+        /// <summary>
+        /// 光标
+        /// </summary>
+        public const int OBJID_CURSOR = unchecked((int)0xFFFFFFF7);
+        /// <summary>
+        /// 警告
+        /// </summary>
+        public const int OBJID_ALERT = unchecked((int)0xFFFFFFF6);
+        /// <summary>
+        /// 声音
+        /// </summary>
+        public const int OBJID_SOUND = unchecked((int)0xFFFFFFF5);
+        /// <summary>
+        /// 查询类名
+        /// </summary>
+        public const int OBJID_QUERYCLASSNAMEIDX = unchecked((int)0xFFFFFFF4);
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int OBJID_NATIVEOM = unchecked((int)0xFFFFFFF0);
+    }
+}

+ 59 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/RDW.cs

@@ -0,0 +1,59 @@
+namespace Microsoft.Win32
+{
+    //RDW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 禁用(屏蔽)重画区域
+        /// </summary>
+        public const int RDW_INVALIDATE = 0x0001;
+        /// <summary>
+        /// 即使窗口并非无效,也向其投递一条WM_PAINT消息
+        /// </summary>
+        public const int RDW_INTERNALPAINT = 0x0002;
+        /// <summary>
+        /// 重画前,先清除重画区域的背景。也必须指定RDW_INVALIDATE
+        /// </summary>
+        public const int RDW_ERASE = 0x0004;
+
+        /// <summary>
+        /// 检验重画区域
+        /// </summary>
+        public const int RDW_VALIDATE = 0x0008;
+        /// <summary>
+        /// 禁止内部生成或由这个函数生成的任何待决WM_PAINT消息。针对无效区域,仍会生成WM_PAINT消息
+        /// </summary>
+        public const int RDW_NOINTERNALPAINT = 0x0010;
+        /// <summary>
+        /// 禁止删除重画区域的背景
+        /// </summary>
+        public const int RDW_NOERASE = 0x0020;
+
+        /// <summary>
+        /// 重画操作排除子窗口(前提是它们存在于重画区域)
+        /// </summary>
+        public const int RDW_NOCHILDREN = 0x0040;
+        /// <summary>
+        /// 重画操作包括子窗口(前提是它们存在于重画区域)
+        /// </summary>
+        public const int RDW_ALLCHILDREN = 0x0080;
+
+        /// <summary>
+        /// 立即更新指定的重画区域
+        /// </summary>
+        public const int RDW_UPDATENOW = 0x0100;
+        /// <summary>
+        /// 立即删除指定的重画区域
+        /// </summary>
+        public const int RDW_ERASENOW = 0x0200;
+
+        /// <summary>
+        /// 如非客户区包含在重画区域中,则对非客户区进行更新。也必须指定RDW_INVALIDATE
+        /// </summary>
+        public const int RDW_FRAME = 0x0400;
+        /// <summary>
+        /// 禁止非客户区域重画(如果它是重画区域的一部分)。也必须指定RDW_VALIDATE
+        /// </summary>
+        public const int RDW_NOFRAME = 0x0800;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/RGN.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //RGN定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 新的剪切区域与当前剪切区域的重叠部分合并,该区域由hrgn标识。
+        /// </summary>
+        public const int RGN_AND = 1;
+        /// <summary>
+        /// 新的剪切区域与当前的剪切区域合并,并且该区域由hrgn标识。
+        /// </summary>
+        public const int RGN_OR = 2;
+        /// <summary>
+        /// 新的剪切区域与当前的剪切区域合并,并且该区域由hrgn指定,但是不包括任何重叠区域。
+        /// </summary>
+        public const int RGN_XOR = 3;
+        /// <summary>
+        /// 新的剪切区域与由hrgn定义的区域之外的区域合并。
+        /// </summary>
+        public const int RGN_DIFF = 4;
+        /// <summary>
+        /// 新的剪切区域是由hrgn标识区域的一个拷贝,这和SelectClipRgn是统一的。如果由hrgn所定义的区域为空。那么新的剪切区域就是缺省的剪切区域(缺省的剪切区域是个空区域)。
+        /// </summary>
+        public const int RGN_COPY = 5;
+        /// <summary>
+        /// 新的剪切区域与当前剪切区域的重叠部分合并,该区域由hrgn标识。
+        /// </summary>
+        public const int RGN_MIN = RGN_AND;
+        /// <summary>
+        /// 新的剪切区域是由hrgn标识区域的一个拷贝,这和SelectClipRgn是统一的。如果由hrgn所定义的区域为空。那么新的剪切区域就是缺省的剪切区域(缺省的剪切区域是个空区域)。
+        /// </summary>
+        public const int RGN_MAX = RGN_COPY;
+    }
+}

+ 67 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ROP.cs

@@ -0,0 +1,67 @@
+namespace Microsoft.Win32
+{
+    //ROP定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 将源矩形区域直接拷贝到目标矩形区域。
+        /// </summary>
+        public const int SRCCOPY = 0x00CC0020;      /* dest = source                   */
+        /// <summary>
+        /// 通过使用布尔型的OR(或)操作符将源和目标矩形区域的颜色合并。
+        /// </summary>
+        public const int SRCPAINT = 0x00EE0086;     /* dest = source OR dest           */
+        /// <summary>
+        /// 通过使用AND(与)操作符来将源和目标矩形区域内的颜色合并。
+        /// </summary>
+        public const int SRCAND = 0x008800C6;       /* dest = source AND dest          */
+        /// <summary>
+        /// 通过使用布尔型的XOR(异或)操作符将源和目标矩形区域的颜色合并。
+        /// </summary>
+        public const int SRCINVERT = 0x00660046;    /* dest = source XOR dest          */
+        /// <summary>
+        /// 通过使用AND(与)操作符将目标矩形区域颜色取反后与源矩形区域的颜色值合并。
+        /// </summary>
+        public const int SRCERASE = 0x00440328;     /* dest = source AND (NOT dest )   */
+        /// <summary>
+        /// 将源矩形区域颜色取反,于拷贝到目标矩形区域。
+        /// </summary>
+        public const int NOTSRCCOPY = 0x00330008;   /* dest = (NOT source)             */
+        /// <summary>
+        /// 使用布尔类型的OR(或)操作符组合源和目标矩形区域的颜色值,然后将合成的颜色取反。
+        /// </summary>
+        public const int NOTSRCERASE = 0x001100A6;  /* dest = (NOT src) AND (NOT dest) */
+        /// <summary>
+        /// 表示使用布尔型的AND(与)操作符将源矩形区域的颜色与特定模式组合一起。
+        /// </summary>
+        public const int MERGECOPY = 0x00C000CA;    /* dest = (source AND pattern)     */
+        /// <summary>
+        /// 通过使用布尔型的OR(或)操作符将反向的源矩形区域的颜色与目标矩形区域的颜色合并。
+        /// </summary>
+        public const int MERGEPAINT = 0x00BB0226;   /* dest = (NOT source) OR dest     */
+        /// <summary>
+        /// 将特定的模式拷贝到目标位图上。
+        /// </summary>
+        public const int PATCOPY = 0x00F00021;      /* dest = pattern                  */
+        /// <summary>
+        /// 通过使用布尔OR(或)操作符将源矩形区域取反后的颜色值与特定模式的颜色合并。然后使用OR(或)操作符将该操作的结果与目标矩形区域内的颜色合并。
+        /// </summary>
+        public const int PATPAINT = 0x00FB0A09;     /* dest = DPSnoo                   */
+        /// <summary>
+        /// 通过使用XOR(异或)操作符将源和目标矩形区域内的颜色合并。
+        /// </summary>
+        public const int PATINVERT = 0x005A0049;    /* dest = pattern XOR dest         */
+        /// <summary>
+        /// 表示使目标矩形区域颜色取反。
+        /// </summary>
+        public const int DSTINVERT = 0x00550009;    /* dest = (NOT dest)               */
+        /// <summary>
+        /// 表示使用与物理调色板的索引0相关的色彩来填充目标矩形区域,(对缺省的物理调色板而言,该颜色为黑色)。
+        /// </summary>
+        public const int BLACKNESS = 0x00000042;    /* dest = BLACK                    */
+        /// <summary>
+        /// 使用与物理调色板中索引1有关的颜色填充目标矩形区域。(对于缺省物理调色板来说,这个颜色就是白色)。
+        /// </summary>
+        public const int WHITENESS = 0x00FF0062;    /* dest = WHITE                    */
+    }
+}

+ 85 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SB.cs

@@ -0,0 +1,85 @@
+namespace Microsoft.Win32
+{
+    //SB定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Shows or hides a window's standard horizontal scroll bars.
+        /// </summary>
+        public const int SB_HORZ = 0;
+        /// <summary>
+        /// Shows or hides a window's standard vertical scroll bar.
+        /// </summary>
+        public const int SB_VERT = 1;
+        /// <summary>
+        /// Shows or hides a scroll bar control. The hwnd parameter must be the handle to the scroll bar control.
+        /// </summary>
+        public const int SB_CTL = 2;
+        /// <summary>
+        /// Shows or hides a window's standard horizontal and vertical scroll bars.
+        /// </summary>
+        public const int SB_BOTH = 3;
+
+
+        /// <summary>
+        /// Scrolls one line up.
+        /// </summary>
+        public const int SB_LINEUP = 0;
+        /// <summary>
+        /// Scrolls left by one unit.
+        /// </summary>
+        public const int SB_LINELEFT = 0;
+        /// <summary>
+        /// Scrolls one line down.
+        /// </summary>
+        public const int SB_LINEDOWN = 1;
+        /// <summary>
+        /// Scrolls right by one unit.
+        /// </summary>
+        public const int SB_LINERIGHT = 1;
+        /// <summary>
+        /// Scrolls one page up.
+        /// </summary>
+        public const int SB_PAGEUP = 2;
+        /// <summary>
+        /// Scrolls left by the width of the window.
+        /// </summary>
+        public const int SB_PAGELEFT = 2;
+        /// <summary>
+        /// Scrolls one page down.
+        /// </summary>
+        public const int SB_PAGEDOWN = 3;
+        /// <summary>
+        /// Scrolls right by the width of the window.
+        /// </summary>
+        public const int SB_PAGERIGHT = 3;
+        /// <summary>
+        /// The user has dragged the scroll box (thumb) and released the mouse button. The HIWORD indicates the position of the scroll box at the end of the drag operation.
+        /// </summary>
+        public const int SB_THUMBPOSITION = 4;
+        /// <summary>
+        /// The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The HIWORD indicates the position that the scroll box has been dragged to.
+        /// </summary>
+        public const int SB_THUMBTRACK = 5;
+        /// <summary>
+        /// Scrolls to the upper left.
+        /// </summary>
+        public const int SB_TOP = 6;
+        /// <summary>
+        /// Scrolls to the upper left.
+        /// </summary>
+        public const int SB_LEFT = 6;
+        /// <summary>
+        /// Scrolls to the lower right.
+        /// </summary>
+        public const int SB_BOTTOM = 7;
+        /// <summary>
+        /// Scrolls to the lower right.
+        /// </summary>
+        public const int SB_RIGHT = 7;
+        /// <summary>
+        /// Ends scroll.
+        /// </summary>
+        public const int SB_ENDSCROLL = 8;
+    }
+}

+ 66 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SBM.cs

@@ -0,0 +1,66 @@
+namespace Microsoft.Win32
+{
+    //SBM定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// <para>The SBM_SETPOS message is sent to set the position of the scroll box (thumb) and, if requested, redraw the scroll bar to reflect the new position of the scroll box.</para>
+        /// <para>Applications should not send this message directly.</para>
+        /// <para>Instead, they should use the SetScrollPos function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the SetScrollPos function to work properly.</para>
+        /// </summary>
+        public const int SBM_SETPOS = 0x00E0;
+        /// <summary>
+        /// <para>The SBM_GETPOS message is sent to retrieve the current position of the scroll box of a scroll bar control.</para>
+        /// <para>The current position is a relative value that depends on the current scrolling range.</para>
+        /// <para>For example, if the scrolling range is 0 through 100 and the scroll box is in the middle of the bar, the current position is 50.</para>
+        /// <para>Applications should not send this message directly. Instead, they should use the GetScrollPos function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the GetScrollPos function to function properly.</para>
+        /// </summary> 
+        public const int SBM_GETPOS = 0x00E1;
+        /// <summary>
+        /// <para>The SBM_SETRANGE message is sent to set the minimum and maximum position values for the scroll bar control.</para>
+        /// <para>Applications should not send this message directly.</para>
+        /// <para>Instead, they should use the SetScrollRange function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the SetScrollRange function to work properly.</para>
+        /// </summary> 
+        public const int SBM_SETRANGE = 0x00E2;
+        /// <summary>
+        /// An application sends the SBM_SETRANGEREDRAW message to a scroll bar control to set the minimum and maximum position values and to redraw the control.to work properly.
+        /// </summary>
+        public const int SBM_SETRANGEREDRAW = 0x00E6;
+        /// <summary>
+        /// <para>The SBM_GETRANGE message is sent to retrieve the minimum and maximum position values for the scroll bar control.</para>
+        /// <para>Applications should not send this message directly. Instead, they should use the GetScrollRange function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the GetScrollRange function to work properly.</para>
+        /// </summary>
+        public const int SBM_GETRANGE = 0x00E3;
+        /// <summary>
+        /// An application sends the SBM_ENABLE_ARROWS message to enable or disable one or both arrows of a scroll bar control.
+        /// </summary>
+        public const int SBM_ENABLE_ARROWS = 0x00E4;
+        /// <summary>
+        /// <para>The SBM_SETSCROLLINFO message is sent to set the parameters of a scroll bar.</para>
+        /// <para>Applications should not send this message directly.</para>
+        /// <para>Instead, they should use the SetScrollInfo function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the SetScrollInfo function to function properly.</para>
+        /// </summary>
+        public const int SBM_SETSCROLLINFO = 0x00E9;
+        /// <summary>
+        /// <para>The SBM_GETSCROLLINFO message is sent to retrieve the parameters of a scroll bar.</para>
+        /// <para>Applications should not send this message directly. Instead, they should use the GetScrollInfo function.</para>
+        /// <para>A window receives this message through its WindowProc function.</para>
+        /// <para>Applications which implement a custom scroll bar control must respond to these messages for the GetScrollInfo function to work properly.</para>
+        /// </summary>
+        public const int SBM_GETSCROLLINFO = 0x00EA;
+        /// <summary>
+        /// Sent by an application to retrieve information about the specified scroll bar.
+        /// </summary>
+        public const int SBM_GETSCROLLBARINFO = 0x00EB;
+    }
+}

+ 107 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SC.cs

@@ -0,0 +1,107 @@
+namespace Microsoft.Win32
+{
+    //SC定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Sizes the window.
+        /// </summary>
+        public const int SC_SIZE = 0xF000;
+        /// <summary>
+        /// Moves the window.
+        /// </summary>
+        public const int SC_MOVE = 0xF010;
+        /// <summary>
+        /// Minimizes the window.
+        /// </summary>
+        public const int SC_MINIMIZE = 0xF020;
+        /// <summary>
+        /// Maximizes the window.
+        /// </summary>
+        public const int SC_MAXIMIZE = 0xF030;
+        /// <summary>
+        /// Moves to the next window.
+        /// </summary>
+        public const int SC_NEXTWINDOW = 0xF040;
+        /// <summary>
+        /// Moves to the previous window.
+        /// </summary>
+        public const int SC_PREVWINDOW = 0xF050;
+        /// <summary>
+        /// Closes the window.
+        /// </summary>
+        public const int SC_CLOSE = 0xF060;
+        /// <summary>
+        /// Scrolls vertically.
+        /// </summary>
+        public const int SC_VSCROLL = 0xF070;
+        /// <summary>
+        /// Scrolls horizontally.
+        /// </summary>
+        public const int SC_HSCROLL = 0xF080;
+        /// <summary>
+        /// Retrieves the window menu as a result of a mouse click.
+        /// </summary>
+        public const int SC_MOUSEMENU = 0xF090;
+        /// <summary>
+        /// Retrieves the window menu as a result of a keystroke.For more information, see the Remarks section.
+        /// </summary>
+        public const int SC_KEYMENU = 0xF100;
+        /// <summary>
+        /// TODO
+        /// </summary>
+        public const int SC_ARRANGE = 0xF110;
+        /// <summary>
+        /// Restores the window to its normal position and size.
+        /// </summary>
+        public const int SC_RESTORE = 0xF120;
+        /// <summary>
+        /// Activates the Start menu.
+        /// </summary>
+        public const int SC_TASKLIST = 0xF130;
+        /// <summary>
+        /// Executes the screen saver application specified in the [boot] section of the System.ini file.
+        /// </summary>
+        public const int SC_SCREENSAVE = 0xF140;
+        /// <summary>
+        /// Activates the window associated with the application-specified hot key.The lParam parameter identifies the window to activate.
+        /// </summary>
+        public const int SC_HOTKEY = 0xF150;
+
+        //#if(WINVER >= 0x0400) //Win95
+        /// <summary>
+        /// Selects the default item; the user double-clicked the window menu.
+        /// </summary>
+        public const int SC_DEFAULT = 0xF160;
+        /// <summary>
+        /// Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.
+        /// The lParam parameter can have the following values: -1 = the display is powering on,1 = the display is going to low power, 2 = the display is being shut off
+        /// </summary>
+        public const int SC_MONITORPOWER = 0xF170;
+        /// <summary>
+        /// Changes the cursor to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message.
+        /// </summary>
+        public const int SC_CONTEXTHELP = 0xF180;
+        /// <summary>
+        /// TODO
+        /// </summary>
+        public const int SC_SEPARATOR = 0xF00F;
+        //#endif /* WINVER >= 0x0400 */
+
+        //#if(WINVER >= 0x0600) //Vista
+        /// <summary>
+        /// Indicates whether the screen saver is secure.
+        /// </summary>
+        public const int SCF_ISSECURE = 0x00000001;
+        //#endif /* WINVER >= 0x0600 */
+
+        /// <summary>
+        /// Obsolete names
+        /// </summary>
+        public const int SC_ICON = SC_MINIMIZE;
+        /// <summary>
+        /// Obsolete names
+        /// </summary>
+        public const int SC_ZOOM = SC_MAXIMIZE;
+    }
+}

+ 27 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SCR.cs

@@ -0,0 +1,27 @@
+namespace Microsoft.Win32
+{
+    //SelectClipRgn返回值定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 发生错误(以前的剪切区域不受影响)
+        /// </summary>
+        public const int ERROR = 0;
+        /// <summary>
+        /// 区域为空
+        /// </summary>
+        public const int NULLREGION = 1;
+        /// <summary>
+        /// 区域为单个矩形
+        /// </summary>
+        public const int SIMPLEREGION = 2;
+        /// <summary>
+        /// 区域为多个矩形
+        /// </summary>
+        public const int COMPLEXREGION = 3;
+        /// <summary>
+        /// 发生错误(以前的剪切区域不受影响)
+        /// </summary>
+        public const int RGN_ERROR = ERROR;
+    }
+}

+ 31 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SIF.cs

@@ -0,0 +1,31 @@
+namespace Microsoft.Win32
+{
+    //SIF定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The nMin and nMax members contain the minimum and maximum values for the scrolling range.
+        /// </summary>
+        public const uint SIF_RANGE = 0x0001;
+        /// <summary>
+        /// The nPage member contains the page size for a proportional scroll bar.
+        /// </summary>
+        public const uint SIF_PAGE = 0x0002;
+        /// <summary>
+        /// The nPos member contains the scroll box position, which is not updated while the user drags the scroll box.
+        /// </summary>
+        public const uint SIF_POS = 0x0004;
+        /// <summary>
+        /// This value is used only when setting a scroll bar's parameters. If the scroll bar's new parameters make the scroll bar unnecessary, disable the scroll bar instead of removing it.
+        /// </summary>
+        public const uint SIF_DISABLENOSCROLL = 0x0008;
+        /// <summary>
+        /// The nTrackPos member contains the current position of the scroll box while the user is dragging it.
+        /// </summary>
+        public const uint SIF_TRACKPOS = 0x0010;
+        /// <summary>
+        /// Combination of SIF_PAGE, SIF_POS, SIF_RANGE, and SIF_TRACKPOS.
+        /// </summary>
+        public const uint SIF_ALL = (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS);
+    }
+}

File diff suppressed because it is too large
+ 102 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SIO.cs


File diff suppressed because it is too large
+ 387 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SM.cs


+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SND.cs

@@ -0,0 +1,39 @@
+namespace Microsoft.Win32
+{
+    //SND定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 同步播放声音,在播放完后PlaySound函数才返回。
+        /// </summary>
+        public const int SND_SYNC = 0;
+        /// <summary>
+        /// 用异步方式播放声音,PlaySound函数在开始播放后立即返回。
+        /// </summary>
+        public const int SND_ASYNC = 1;
+        /// <summary>
+        /// 不播放缺省声音,若无此标志,则PlaySound在没找到声音时会播放缺省声音。
+        /// </summary>
+        public const int SND_NODEFAULT = 2;
+        /// <summary>
+        /// 播放载入到内存中的声音,此时pszSound是指向声音数据的指针。
+        /// </summary>
+        public const int SND_MEMORY = 4;
+        /// <summary>
+        /// 重复播放声音,必须与SND_ASYNC标志一块使用。
+        /// </summary>
+        public const int SND_LOOP = 8;
+        /// <summary>
+        /// PlaySound不打断原来的声音播出并立即返回FALSE。
+        /// </summary>
+        public const int SND_NOSTOP = 0x10;
+        /// <summary>
+        /// 停止所有与调用任务有关的声音。若参数pszSound为NULL,就停止所有的声音,否则,停止pszSound指定的声音。
+        /// </summary>
+        public const int SND_PURGE = 0x40;
+        /// <summary>
+        /// pszSound参数指定了WAVE文件名。
+        /// </summary>
+        public const int SND_FILENAME = 0x20000;
+    }
+}

+ 11 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SOMAXCONN.cs

@@ -0,0 +1,11 @@
+namespace Microsoft.Win32
+{
+    //SOMAXCONN定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Maximum queue length specifiable by listen.
+        /// </summary>
+        public const int SOMAXCONN = 0x7FFFFFFF;
+    }
+}

File diff suppressed because it is too large
+ 135 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SS.cs


+ 139 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/STATE_SYSTEM.cs

@@ -0,0 +1,139 @@
+namespace Microsoft.Win32
+{
+    //STATE_SYSTEM定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 0
+        /// </summary>
+        public const int STATE_SYSTEM_NONE = 0x00000000;
+        /// <summary>
+        /// Disabled
+        /// </summary>
+        public const int STATE_SYSTEM_UNAVAILABLE = 0x00000001;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_SELECTED = 0x00000002;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_FOCUSED = 0x00000004;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_PRESSED = 0x00000008;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_CHECKED = 0x00000010;
+        /// <summary>
+        /// 3-state checkbox or toolbar button
+        /// </summary>
+        public const int STATE_SYSTEM_MIXED = 0x00000020;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_INDETERMINATE = STATE_SYSTEM_MIXED;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_READONLY = 0x00000040;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_HOTTRACKED = 0x00000080;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_DEFAULT = 0x00000100;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_EXPANDED = 0x00000200;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_COLLAPSED = 0x00000400;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_BUSY = 0x00000800;
+        /// <summary>
+        /// Children "owned" not "contained" by parent
+        /// </summary>
+        public const int STATE_SYSTEM_FLOATING = 0x00001000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_MARQUEED = 0x00002000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_ANIMATED = 0x00004000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_INVISIBLE = 0x00008000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_OFFSCREEN = 0x00010000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_SIZEABLE = 0x00020000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_MOVEABLE = 0x00040000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_SELFVOICING = 0x00080000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_FOCUSABLE = 0x00100000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_SELECTABLE = 0x00200000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_LINKED = 0x00400000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_TRAVERSED = 0x00800000;
+        /// <summary>
+        /// Supports multiple selection
+        /// </summary>
+        public const int STATE_SYSTEM_MULTISELECTABLE = 0x01000000;
+        /// <summary>
+        /// Supports extended selection
+        /// </summary>
+        public const int STATE_SYSTEM_EXTSELECTABLE = 0x02000000;
+        /// <summary>
+        /// This information is of low priority
+        /// </summary>
+        public const int STATE_SYSTEM_ALERT_LOW = 0x04000000;
+        /// <summary>
+        /// This information is of medium priority
+        /// </summary>
+        public const int STATE_SYSTEM_ALERT_MEDIUM = 0x08000000;
+        /// <summary>
+        /// This information is of high priority
+        /// </summary>
+        public const int STATE_SYSTEM_ALERT_HIGH = 0x10000000;
+        /// <summary>
+        /// access to this is restricted
+        /// </summary>
+        public const int STATE_SYSTEM_PROTECTED = 0x20000000;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int STATE_SYSTEM_VALID = 0x3FFFFFFF;
+    }
+}

+ 59 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SW.cs

@@ -0,0 +1,59 @@
+namespace Microsoft.Win32
+{
+    //SW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 隐藏窗口并激活其他窗口。
+        /// </summary>
+        public const int SW_HIDE = 0;
+        /// <summary>
+        /// 激活并显示一个窗口。如果窗口被最小化或最大化,系统将其恢复到原来的尺寸和大小。应用程序在第一次显示窗口的时候应该指定此标志。
+        /// </summary>
+        public const int SW_SHOWNORMAL = 1;
+        /// <summary>
+        /// 激活窗口并将其最小化。
+        /// </summary>
+        public const int SW_SHOWMINIMIZED = 2;
+        /// <summary>
+        /// 最大化指定的窗口。
+        /// </summary>
+        public const int SW_MAXIMIZE = 3;
+        /// <summary>
+        /// 激活窗口并将其最大化。
+        /// </summary>
+        public const int SW_SHOWMAXIMIZED = 3;
+        /// <summary>
+        /// 以窗口最近一次的大小和状态显示窗口。激活窗口仍然维持激活状态。
+        /// </summary>
+        public const int SW_SHOWNOACTIVATE = 4;
+        /// <summary>
+        /// 在窗口原来的位置以原来的尺寸激活和显示窗口。
+        /// </summary>
+        public const int SW_SHOW = 5;
+        /// <summary>
+        /// 最小化指定的窗口并且激活在Z序中的下一个顶层窗口。
+        /// </summary>
+        public const int SW_MINIMIZE = 6;
+        /// <summary>
+        /// 窗口最小化,激活窗口仍然维持激活状态。
+        /// </summary>
+        public const int SW_SHOWMINNOACTIVE = 7;
+        /// <summary>
+        /// 以窗口原来的状态显示窗口。激活窗口仍然维持激活状态。
+        /// </summary>
+        public const int SW_SHOWNA = 8;
+        /// <summary>
+        /// 激活并显示窗口。如果窗口最小化或最大化,则系统将窗口恢复到原来的尺寸和位置。在恢复最小化窗口时,应用程序应该指定这个标志。
+        /// </summary>
+        public const int SW_RESTORE = 9;
+        /// <summary>
+        /// 依据在STARTUPINFO结构中指定的SW_FLAG标志设定显示状态,STARTUPINFO 结构是由启动应用程序的程序传递给CreateProcess函数的。
+        /// </summary>
+        public const int SW_SHOWDEFAULT = 10;
+        /// <summary>
+        /// 在WindowNT5.0中最小化窗口,即使拥有窗口的线程被挂起也会最小化。在从其他线程最小化窗口时才使用这个参数。
+        /// </summary>
+        public const int SW_FORCEMINIMIZE = 11;
+    }
+}

+ 67 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/SWP.cs

@@ -0,0 +1,67 @@
+namespace Microsoft.Win32
+{
+    //SWP定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Retains the current size (ignores the cx and cy parameters).
+        /// </summary>
+        public const uint SWP_NOSIZE = 0x0001;
+        /// <summary>
+        /// Retains the current position (ignores X and Y parameters).
+        /// </summary>
+        public const uint SWP_NOMOVE = 0x0002;
+        /// <summary>
+        /// Retains the current Z order (ignores the hWndInsertAfter parameter).
+        /// </summary>
+        public const uint SWP_NOZORDER = 0x0004;
+        /// <summary>
+        /// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
+        /// </summary>
+        public const uint SWP_NOREDRAW = 0x0008;
+        /// <summary>
+        /// Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
+        /// </summary>
+        public const uint SWP_NOACTIVATE = 0x0010;
+        /// <summary>
+        /// Draws a frame (defined in the window's class description) around the window.
+        /// </summary>
+        public const uint SWP_DRAWFRAME = 0x0020;
+        /// <summary>
+        /// Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
+        /// </summary>
+        public const uint SWP_FRAMECHANGED = 0x0020;
+        /// <summary>
+        /// Displays the window.
+        /// </summary>
+        public const uint SWP_SHOWWINDOW = 0x0040;
+        /// <summary>
+        /// Hides the window.
+        /// </summary>
+        public const uint SWP_HIDEWINDOW = 0x0080;
+        /// <summary>
+        /// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
+        /// </summary>
+        public const uint SWP_NOCOPYBITS = 0x0100;
+        /// <summary>
+        /// Does not change the owner window's position in the Z order.
+        /// </summary>
+        public const uint SWP_NOOWNERZORDER = 0x0200;
+        /// <summary>
+        /// Same as the SWP_NOOWNERZORDER flag.
+        /// </summary>
+        public const uint SWP_NOREPOSITION = 0x0200;
+        /// <summary>
+        /// Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
+        /// </summary>
+        public const uint SWP_NOSENDCHANGING = 0x0400;
+        /// <summary>
+        /// Prevents generation of the WM_SYNCPAINT message.
+        /// </summary>
+        public const uint SWP_DEFERERASE = 0x2000;
+        /// <summary>
+        /// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
+        /// </summary>
+        public const uint SWP_ASYNCWINDOWPOS = 0x4000;
+    }
+}

+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTDT.cs

@@ -0,0 +1,23 @@
+namespace Microsoft.Win32
+{
+    //TTDT定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Set all three delay times to default proportions. The autopop time will be ten times the initial time and the reshow time will be one fifth the initial time. If this flag is set, use a positive value of lParam to specify the initial time, in milliseconds. Set lParam to a negative value to return all three delay times to their default values.
+        /// </summary>
+        public const int TTDT_AUTOMATIC = 0;
+        /// <summary>
+        /// Set the amount of time it takes for subsequent tooltip windows to appear as the pointer moves from one tool to another. To return the reshow delay time to its default value, set lParam to -1.
+        /// </summary>
+        public const int TTDT_RESHOW = 1;
+        /// <summary>
+        /// Set the amount of time a tooltip window remains visible if the pointer is stationary within a tool's bounding rectangle. To return the autopop delay time to its default value, set lParam to -1.
+        /// </summary>
+        public const int TTDT_AUTOPOP = 2;
+        /// <summary>
+        /// Set the amount of time a pointer must remain stationary within a tool's bounding rectangle before the tooltip window appears. To return the initial delay time to its default value, set lParam to -1.
+        /// </summary>
+        public const int TTDT_INITIAL = 3;
+    }
+}

+ 43 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTF.cs

@@ -0,0 +1,43 @@
+namespace Microsoft.Win32
+{
+    //TTF定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Indicates that the uId member is the window handle to the tool. If this flag is not set, uId is the tool's identifier.
+        /// </summary>
+        public const int TTF_IDISHWND = 0x0001;
+        /// <summary>
+        /// Centers the tooltip window below the tool specified by the uId member.
+        /// </summary>
+        public const int TTF_CENTERTIP = 0x0002;
+        /// <summary>
+        /// Indicates that the tooltip text will be displayed in the opposite direction to the text in the parent window.
+        /// </summary>
+        public const int TTF_RTLREADING = 0x0004;
+        /// <summary>
+        /// Indicates that the tooltip control should subclass the tool's window to intercept messages, such as WM_MOUSEMOVE. If this flag is not set, you must use the TTM_RELAYEVENT message to forward messages to the tooltip control. For a list of messages that a tooltip control processes, see TTM_RELAYEVENT.
+        /// </summary>
+        public const int TTF_SUBCLASS = 0x0010;
+        /// <summary>
+        /// Version 4.70 and later. Positions the tooltip window next to the tool to which it corresponds and moves the window according to coordinates supplied by the TTM_TRACKPOSITION messages. You must activate this type of tool using the TTM_TRACKACTIVATE message.
+        /// </summary>
+        public const int TTF_TRACK = 0x0020;
+        /// <summary>
+        /// Version 4.70 and later. Positions the tooltip window at the same coordinates provided by TTM_TRACKPOSITION. This flag must be used with the TTF_TRACK flag.
+        /// </summary>
+        public const int TTF_ABSOLUTE = 0x0080;
+        /// <summary>
+        /// Version 4.70 and later. Causes the tooltip control to forward mouse event messages to the parent window. This is limited to mouse events that occur within the bounds of the tooltip window.
+        /// </summary>
+        public const int TTF_TRANSPARENT = 0x0100;
+        /// <summary>
+        /// Version 6.0 and later. Indicates that links in the tooltip text should be parsed.Note that Comctl32.dll version 6 is not redistributable but it is included in Windows XP or later. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
+        /// </summary>
+        public const int TTF_PARSELINKS = 0x1000;
+        /// <summary>
+        /// valid only on the TTN_NEEDTEXT callback
+        /// </summary>
+        public const int TTF_DI_SETITEM = 0x8000;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTI.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //TTI定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Use no icon.
+        /// </summary>
+        public const int TTI_NONE = 0;
+        /// <summary>
+        /// Use the information icon.
+        /// </summary>
+        public const int TTI_INFO = 1;
+        /// <summary>
+        /// Use the warning icon.
+        /// </summary>
+        public const int TTI_WARNING = 2;
+        /// <summary>
+        /// Use the error icon.
+        /// </summary>
+        public const int TTI_ERROR = 3;
+        /// <summary>
+        /// Use the large information icon. This is assumed to be an HICON value.
+        /// </summary>
+        public const int TTI_INFO_LARGE = 4;
+        /// <summary>
+        /// Use the large warning icon. This is assumed to be an HICON value.
+        /// </summary>
+        public const int TTI_WARNING_LARGE = 5;
+        /// <summary>
+        /// Use the large error icon. This is assumed to be an HICON value.
+        /// </summary>
+        public const int TTI_ERROR_LARGE = 6;
+    }
+}

+ 143 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTM.cs

@@ -0,0 +1,143 @@
+namespace Microsoft.Win32
+{
+    //TTM定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Activates or deactivates a tooltip control.
+        /// </summary>
+        public const int TTM_ACTIVATE = WM_USER + 1;
+        /// <summary>
+        /// Sets the initial, pop-up, and reshow durations for a tooltip control.
+        /// </summary>
+        public const int TTM_SETDELAYTIME = WM_USER + 3;
+        /// <summary>
+        /// Registers a tool with a tooltip control.
+        /// </summary>
+        public const int TTM_ADDTOOL = WM_USER + 50;
+        /// <summary>
+        /// Removes a tool from a tooltip control.
+        /// </summary>
+        public const int TTM_DELTOOL = WM_USER + 51;
+        /// <summary>
+        /// Sets a new bounding rectangle for a tool.
+        /// </summary>
+        public const int TTM_NEWTOOLRECT = WM_USER + 52;
+        /// <summary>
+        /// Passes a mouse message to a tooltip control for processing.
+        /// </summary>
+        public const int TTM_RELAYEVENT = WM_USER + 7;
+        /// <summary>
+        /// Retrieves the information that a tooltip control maintains about a tool.
+        /// </summary>
+        public const int TTM_GETTOOLINFO = WM_USER + 53;
+        /// <summary>
+        /// Sets the information that a tooltip control maintains for a tool.
+        /// </summary>
+        public const int TTM_SETTOOLINFO = WM_USER + 54;
+        /// <summary>
+        /// Tests a point to determine whether it is within the bounding rectangle of the specified tool and, if it is, retrieves information about the tool.
+        /// </summary>
+        public const int TTM_HITTEST = WM_USER + 55;
+        /// <summary>
+        /// Retrieves the information a tooltip control maintains about a tool.
+        /// </summary>
+        public const int TTM_GETTEXT = WM_USER + 56;
+        /// <summary>
+        /// Sets the tooltip text for a tool.
+        /// </summary>
+        public const int TTM_UPDATETIPTEXT = WM_USER + 57;
+        /// <summary>
+        /// Retrieves a count of the tools maintained by a tooltip control.
+        /// </summary>
+        public const int TTM_GETTOOLCOUNT = WM_USER + 13;
+        /// <summary>
+        /// Retrieves the information that a tooltip control maintains about the current tool—that is, the tool for which the tooltip is currently displaying text.
+        /// </summary>
+        public const int TTM_ENUMTOOLS = WM_USER + 58;
+        /// <summary>
+        /// Retrieves the information for the current tool in a tooltip control.
+        /// </summary>
+        public const int TTM_GETCURRENTTOOL = WM_USER + 59;
+        /// <summary>
+        /// Allows a subclass procedure to cause a tooltip to display text for a window other than the one beneath the mouse cursor.
+        /// </summary>
+        public const int TTM_WINDOWFROMPOINT = WM_USER + 16;
+        /// <summary>
+        /// Activates or deactivates a tracking tooltip.
+        /// </summary>
+        public const int TTM_TRACKACTIVATE = WM_USER + 17;
+        /// <summary>
+        /// Sets the position of a tracking tooltip.
+        /// </summary>
+        public const int TTM_TRACKPOSITION = WM_USER + 18;
+        /// <summary>
+        /// Sets the background color in a tooltip window.
+        /// </summary>
+        public const int TTM_SETTIPBKCOLOR = WM_USER + 19;
+        /// <summary>
+        /// Sets the text color in a tooltip window.
+        /// </summary>
+        public const int TTM_SETTIPTEXTCOLOR = WM_USER + 20;
+        /// <summary>
+        /// Retrieves the initial, pop-up, and reshow durations currently set for a tooltip control.
+        /// </summary>
+        public const int TTM_GETDELAYTIME = WM_USER + 21;
+        /// <summary>
+        /// Retrieves the background color in a tooltip window.
+        /// </summary>
+        public const int TTM_GETTIPBKCOLOR = WM_USER + 22;
+        /// <summary>
+        /// Retrieves the text color in a tooltip window.
+        /// </summary>
+        public const int TTM_GETTIPTEXTCOLOR = WM_USER + 23;
+        /// <summary>
+        /// Sets the maximum width for a tooltip window.
+        /// </summary>
+        public const int TTM_SETMAXTIPWIDTH = WM_USER + 24;
+        /// <summary>
+        /// Retrieves the maximum width for a tooltip window.
+        /// </summary>
+        public const int TTM_GETMAXTIPWIDTH = WM_USER + 25;
+        /// <summary>
+        /// Sets the top, left, bottom, and right margins for a tooltip window. A margin is the distance, in pixels, between the tooltip window border and the text contained within the tooltip window.
+        /// </summary>
+        public const int TTM_SETMARGIN = WM_USER + 26;
+        /// <summary>
+        /// Retrieves the top, left, bottom, and right margins set for a tooltip window. A margin is the distance, in pixels, between the tooltip window border and the text contained within the tooltip window.
+        /// </summary>
+        public const int TTM_GETMARGIN = WM_USER + 27;
+        /// <summary>
+        /// Removes a displayed tooltip window from view.
+        /// </summary>
+        public const int TTM_POP = WM_USER + 28;
+        /// <summary>
+        /// Forces the current tooltip to be redrawn.
+        /// </summary>
+        public const int TTM_UPDATE = WM_USER + 29;
+        /// <summary>
+        /// Returns the width and height of a tooltip control.
+        /// </summary>
+        public const int TTM_GETBUBBLESIZE = WM_USER + 30;
+        /// <summary>
+        /// Calculates a tooltip control's text display rectangle from its window rectangle, or the tooltip window rectangle needed to display a specified text display rectangle.
+        /// </summary>
+        public const int TTM_ADJUSTRECT = WM_USER + 31;
+        /// <summary>
+        /// Adds a standard icon and title string to a tooltip.
+        /// </summary>
+        public const int TTM_SETTITLE = WM_USER + 33;
+        /// <summary>
+        /// Causes the tooltip to display at the coordinates of the last mouse message.
+        /// </summary>
+        public const int TTM_POPUP = WM_USER + 34;
+        /// <summary>
+        /// Retrieve information concerning the title of a tooltip control.
+        /// </summary>
+        public const int TTM_GETTITLE = WM_USER + 35;
+        /// <summary>
+        /// Sets the visual style of a tooltip control.
+        /// </summary>
+        public const int TTM_SETWINDOWTHEME = 0x200B;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTN.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //TTN定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 开始
+        /// </summary>
+        public const int TTN_FIRST = -520;
+        /// <summary>
+        /// 结束
+        /// </summary>
+        public const int TTN_LAST = -549;
+        /// <summary>
+        /// Notifies the owner window that a tooltip control is about to be displayed. This notification code is sent in the form of a WM_NOTIFY message.
+        /// </summary>
+        public const int TTN_SHOW = TTN_FIRST - 1;
+        /// <summary>
+        /// Notifies the owner window that a tooltip is about to be hidden. This notification code is sent in the form of a WM_NOTIFY message.
+        /// </summary>
+        public const int TTN_POP = TTN_FIRST - 2;
+        /// <summary>
+        /// Sent when a text link inside a balloon tooltip is clicked. This notification code is sent in the form of a WM_NOTIFY message.
+        /// </summary>
+        public const int TTN_LINKCLICK = TTN_FIRST - 3;
+        /// <summary>
+        /// Sent by a tooltip control to retrieve information needed to display a tooltip window. This notification code is sent in the form of a WM_NOTIFY message.
+        /// </summary>
+        public const int TTN_GETDISPINFO = TTN_FIRST - 10;
+        /// <summary>
+        /// Sent by a tooltip control to retrieve information needed to display a tooltip window. This notification code is identical to TTN_GETDISPINFO. This notification code is sent in the form of a WM_NOTIFY message.
+        /// </summary>
+        public const int TTN_NEEDTEXT = TTN_FIRST - 10;
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/TTS.cs

@@ -0,0 +1,35 @@
+namespace Microsoft.Win32
+{
+    //TTS定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Indicates that the tooltip control appears when the cursor is on a tool, even if the tooltip control's owner window is inactive. Without this style, the tooltip appears only when the tool's owner window is active.
+        /// </summary>
+        public const int TTS_ALWAYSTIP = 0x01;
+        /// <summary>
+        /// Prevents the system from stripping ampersand characters from a string or terminating a string at a tab character. Without this style, the system automatically strips ampersand characters and terminates a string at the first tab character. This allows an application to use the same string as both a menu item and as text in a tooltip control.
+        /// </summary>
+        public const int TTS_NOPREFIX = 0x02;
+        /// <summary>
+        /// Version 5.80. Disables sliding tooltip animation on Windows 98 and Windows 2000 systems. This style is ignored on earlier systems.
+        /// </summary>
+        public const int TTS_NOANIMATE = 0x10;
+        /// <summary>
+        /// Version 5.80. Disables fading tooltip animation on Windows 2000 systems. This style is ignored on earlier Windows NT systems, and on Windows 95 and Windows 98.
+        /// </summary>
+        public const int TTS_NOFADE = 0x20;
+        /// <summary>
+        /// Version 5.80. Indicates that the tooltip control has the appearance of a cartoon "balloon," with rounded corners and a stem pointing to the item.
+        /// </summary>
+        public const int TTS_BALLOON = 0x40;
+        /// <summary>
+        /// Displays a Close button on the tooltip. Valid only when the tooltip has the TTS_BALLOON style and a title; see TTM_SETTITLE.
+        /// </summary>
+        public const int TTS_CLOSE = 0x80;
+        /// <summary>
+        /// Uses themed hyperlinks. The theme will define the styles for any links in the tooltip. This style always requires TTF_PARSELINKS to be set.
+        /// </summary>
+        public const int TTS_USEVISUALSTYLE = 0x100;
+    }
+}

+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/ULW.cs

@@ -0,0 +1,23 @@
+namespace Microsoft.Win32
+{
+    //ULW定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// Use crKey as the transparency color.
+        /// </summary>
+        public const uint ULW_COLORKEY = 0x00000001;
+        /// <summary>
+        /// Use pblend as the blend function. If the display mode is 256 colors or less, the effect of this value is the same as the effect of ULW_OPAQUE.
+        /// </summary>
+        public const uint ULW_ALPHA = 0x00000002;
+        /// <summary>
+        /// Draw an opaque layered window. 
+        /// </summary>
+        public const uint ULW_OPAQUE = 0x00000004;
+        /// <summary>
+        /// If hdcSrc is NULL, dwFlags should be zero.
+        /// </summary>
+        public const uint ULW_EX_NORESIZE = 0x00000008;
+    }
+}

+ 847 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/VK.cs

@@ -0,0 +1,847 @@
+namespace Microsoft.Win32
+{
+    //VK定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 鼠标左按钮。
+        /// </summary>
+        public const short VK_LBUTTON = 0x01;
+        /// <summary>
+        /// 鼠标右按钮。
+        /// </summary>
+        public const short VK_RBUTTON = 0x02;
+        /// <summary>
+        /// Cancel 键。
+        /// </summary>
+        public const short VK_CANCEL = 0x03;
+        /// <summary>
+        /// 鼠标中按钮(三个按钮的鼠标)。
+        /// </summary>
+        public const short VK_MBUTTON = 0x04;
+        /// <summary>
+        /// 第一个 X 鼠标按钮(五个按钮的鼠标)。
+        /// </summary>
+        public const short VK_XBUTTON1 = 0x05;
+        /// <summary>
+        /// 第二个 X 鼠标按钮(五个按钮的鼠标)。
+        /// </summary>
+        public const short VK_XBUTTON2 = 0x06;
+        /// <summary>
+        /// Backspace 键。
+        /// </summary>
+        public const short VK_BACK = 0x08;
+        /// <summary>
+        /// Tab 键。
+        /// </summary>
+        public const short VK_TAB = 0x09;
+        /// <summary>
+        /// LINEFEED 键。
+        /// </summary>
+        public const short VK_LINEFEED = 0x0A;
+        /// <summary>
+        /// Clear 键。
+        /// </summary>
+        public const short VK_CLEAR = 0x0C;
+        /// <summary>
+        /// Enter 键。
+        /// </summary>
+        public const short VK_ENTER = 0x0D;
+        /// <summary>
+        /// Return 键。
+        /// </summary>
+        public const short VK_RETURN = 0x0D;
+        /// <summary>
+        /// Shift 键。
+        /// </summary>
+        public const short VK_SHIFT = 0x10;
+        /// <summary>
+        /// Ctrl 键。
+        /// </summary>
+        public const short VK_CONTROL = 0x11;
+        /// <summary>
+        /// Alt 键。
+        /// </summary>
+        public const short VK_MENU = 0x12;
+        /// <summary>
+        /// Pause 键。
+        /// </summary>
+        public const short VK_PAUSE = 0x13;
+        /// <summary>
+        /// Caps Lock 键。
+        /// </summary>
+        public const short VK_CAPSLOCK = 0x14;
+        /// <summary>
+        /// Caps Lock 键。
+        /// </summary>
+        public const short VK_CAPITAL = 0x14;
+        /// <summary>
+        /// IME Kana 模式键。
+        /// </summary>
+        public const short VK_KANA = 0x15;
+        /// <summary>
+        /// IME Hanguel 模式键。(为了保持兼容性而设置;使用 HangulMode)
+        /// </summary>
+        public const short VK_HANGUEL = 0x15;
+        /// <summary>
+        /// IME Hangul 模式键。
+        /// </summary>
+        public const short VK_HANGUL = 0x15;
+        /// <summary>
+        /// IME Junja 模式键。
+        /// </summary>
+        public const short VK_JUNJA = 0x17;
+        /// <summary>
+        /// IME 最终模式键。
+        /// </summary>
+        public const short VK_FINAL = 0x18;
+        /// <summary>
+        /// IME Kanji 模式键。
+        /// </summary>
+        public const short VK_KANJI = 0x19;
+        /// <summary>
+        /// IME Hanja 模式键。
+        /// </summary>
+        public const short VK_HANJA = 0x19;
+        /// <summary>
+        /// Esc 键。
+        /// </summary>
+        public const short VK_ESCAPE = 0x1B;
+        /// <summary>
+        /// IME 转换键。
+        /// </summary>
+        public const short VK_CONVERT = 0x1C;
+        /// <summary>
+        /// IME 非转换键。
+        /// </summary>
+        public const short VK_NONCONVERT = 0x1D;
+        /// <summary>
+        /// IME 接受键,替换 System.Windows.Forms.Keys.IMEAceept。
+        /// </summary>
+        public const short VK_ACCEPT = 0x1E;
+        /// <summary>
+        /// IME 模式更改键。
+        /// </summary>
+        public const short VK_MODECHANGE = 0x1F;
+        /// <summary>
+        /// 空格键。
+        /// </summary>
+        public const short VK_SPACE = 0x20;
+        /// <summary>
+        /// Page Up 键。
+        /// </summary>
+        public const short VK_PRIOR = 0x21;
+        /// <summary>
+        /// Page Up 键。
+        /// </summary>
+        public const short VK_PAFEUP = 0x21;
+        /// <summary>
+        /// Page Down 键。
+        /// </summary>
+        public const short VK_NEXT = 0x22;
+        /// <summary>
+        /// Page Down 键。
+        /// </summary>
+        public const short VK_PAGEDOWN = 0x22;
+        /// <summary>
+        /// End 键。
+        /// </summary>
+        public const short VK_END = 0x23;
+        /// <summary>
+        /// Home 键。
+        /// </summary>
+        public const short VK_HOME = 0x24;
+        /// <summary>
+        /// 向左键。
+        /// </summary>
+        public const short VK_LEFT = 0x25;
+        /// <summary>
+        /// 向上键。
+        /// </summary>
+        public const short VK_UP = 0x26;
+        /// <summary>
+        /// 向右键。
+        /// </summary>
+        public const short VK_RIGHT = 0x27;
+        /// <summary>
+        /// 向下键。
+        /// </summary>
+        public const short VK_DOWN = 0x28;
+        /// <summary>
+        /// Select 键。
+        /// </summary>
+        public const short VK_SELECT = 0x29;
+        /// <summary>
+        /// Print 键。
+        /// </summary>
+        public const short VK_PRINT = 0x2A;
+        /// <summary>
+        /// EXECUTE 键。
+        /// </summary>
+        public const short VK_EXECUTE = 0x2B;
+        /// <summary>
+        /// Print Screen 键。
+        /// </summary>
+        public const short VK_PRINTSCREEN = 0x2C;
+        /// <summary>
+        /// Print Screen 键。
+        /// </summary>
+        public const short VK_SNAPSHOT = 0x2C;
+        /// <summary>
+        /// Ins 键。
+        /// </summary>
+        public const short VK_INSERT = 0x2D;
+        /// <summary>
+        /// DeL 键。
+        /// </summary>
+        public const short VK_DELETE = 0x2E;
+        /// <summary>
+        /// Help 键。
+        /// </summary>
+        public const short VK_HELP = 0x2F;
+        /// <summary>
+        /// 0 键。
+        /// </summary>
+        public const short VK_0 = 0x30;
+        /// <summary>
+        /// 1 键。
+        /// </summary>
+        public const short VK_1 = 0x31;
+        /// <summary>
+        /// 2 键。
+        /// </summary>
+        public const short VK_2 = 0x32;
+        /// <summary>
+        /// 3 键。
+        /// </summary>
+        public const short VK_3 = 0x33;
+        /// <summary>
+        /// 4 键。
+        /// </summary>
+        public const short VK_4 = 0x34;
+        /// <summary>
+        /// 5 键。
+        /// </summary>
+        public const short VK_5 = 0x35;
+        /// <summary>
+        /// 6 键。
+        /// </summary>
+        public const short VK_6 = 0x36;
+        /// <summary>
+        /// 7 键。
+        /// </summary>
+        public const short VK_7 = 0x37;
+        /// <summary>
+        /// 8 键。
+        /// </summary>
+        public const short VK_8 = 0x38;
+        /// <summary>
+        /// 9 键。
+        /// </summary>
+        public const short VK_9 = 0x39;
+        /// <summary>
+        /// A 键。
+        /// </summary>
+        public const short VK_A = 0x41;
+        /// <summary>
+        /// B 键。
+        /// </summary>
+        public const short VK_B = 0x42;
+        /// <summary>
+        /// C 键。
+        /// </summary>
+        public const short VK_C = 0x43;
+        /// <summary>
+        /// D 键。
+        /// </summary>
+        public const short VK_D = 0x44;
+        /// <summary>
+        /// E 键。
+        /// </summary>
+        public const short VK_E = 0x45;
+        /// <summary>
+        /// F 键。
+        /// </summary>
+        public const short VK_F = 0x46;
+        /// <summary>
+        /// G 键。
+        /// </summary>
+        public const short VK_G = 0x47;
+        /// <summary>
+        /// H 键。
+        /// </summary>
+        public const short VK_H = 0x48;
+        /// <summary>
+        /// I 键。
+        /// </summary>
+        public const short VK_I = 0x49;
+        /// <summary>
+        /// J 键。
+        /// </summary>
+        public const short VK_J = 0x4A;
+        /// <summary>
+        /// K 键。
+        /// </summary>
+        public const short VK_K = 0x4B;
+        /// <summary>
+        /// L 键。
+        /// </summary>
+        public const short VK_L = 0x4C;
+        /// <summary>
+        /// M 键。
+        /// </summary>
+        public const short VK_M = 0x4D;
+        /// <summary>
+        /// N 键。
+        /// </summary>
+        public const short VK_N = 0x4E;
+        /// <summary>
+        /// O 键。
+        /// </summary>
+        public const short VK_O = 0x4F;
+        /// <summary>
+        /// P 键。
+        /// </summary>
+        public const short VK_P = 0x50;
+        /// <summary>
+        /// Q 键。
+        /// </summary>
+        public const short VK_Q = 0x51;
+        /// <summary>
+        /// R 键。
+        /// </summary>
+        public const short VK_R = 0x52;
+        /// <summary>
+        /// S 键。
+        /// </summary>
+        public const short VK_S = 0x53;
+        /// <summary>
+        /// T 键。
+        /// </summary>
+        public const short VK_T = 0x54;
+        /// <summary>
+        /// U 键。
+        /// </summary>
+        public const short VK_U = 0x55;
+        /// <summary>
+        /// V 键。
+        /// </summary>
+        public const short VK_V = 0x56;
+        /// <summary>
+        /// W 键。
+        /// </summary>
+        public const short VK_W = 0x57;
+        /// <summary>
+        /// X 键。
+        /// </summary>
+        public const short VK_X = 0x58;
+        /// <summary>
+        /// Y 键。
+        /// </summary>
+        public const short VK_Y = 0x59;
+        /// <summary>
+        /// Z 键。
+        /// </summary>
+        public const short VK_Z = 0x5A;
+        /// <summary>
+        /// 左 Windows 徽标键(Microsoft Natural Keyboard,人体工程学键盘)。
+        /// </summary>
+        public const short VK_LWIN = 0x5B;
+        /// <summary>
+        /// 右 Windows 徽标键(Microsoft Natural Keyboard,人体工程学键盘)。
+        /// </summary>
+        public const short VK_RWIN = 0x5C;
+        /// <summary>
+        /// 应用程序键(Microsoft Natural Keyboard,人体工程学键盘)。
+        /// </summary>
+        public const short VK_APPS = 0x5D;
+        /// <summary>
+        /// 计算机睡眠键。
+        /// </summary>
+        public const short VK_SLEEP = 0x5F;
+        /// <summary>
+        /// 数字键盘上的 0 键。
+        /// </summary>
+        public const short VK_NUMPAD0 = 0x60;
+        /// <summary>
+        /// 数字键盘上的 1 键。
+        /// </summary>
+        public const short VK_NUMPAD1 = 0x61;
+        /// <summary>
+        /// 数字键盘上的 2 键。
+        /// </summary>
+        public const short VK_NUMPAD2 = 0x62;
+        /// <summary>
+        /// 数字键盘上的 3 键。
+        /// </summary>
+        public const short VK_NUMPAD3 = 0x63;
+        /// <summary>
+        /// 数字键盘上的 4 键。
+        /// </summary>
+        public const short VK_NUMPAD4 = 0x64;
+        /// <summary>
+        /// 数字键盘上的 5 键。
+        /// </summary>
+        public const short VK_NUMPAD5 = 0x65;
+        /// <summary>
+        /// 数字键盘上的 6 键。
+        /// </summary>
+        public const short VK_NUMPAD6 = 0x66;
+        /// <summary>
+        /// 数字键盘上的 7 键。
+        /// </summary>
+        public const short VK_NUMPAD7 = 0x67;
+        /// <summary>
+        /// 数字键盘上的 8 键。
+        /// </summary>
+        public const short VK_NUMPAD8 = 0x68;
+        /// <summary>
+        /// 数字键盘上的 9 键。
+        /// </summary>
+        public const short VK_NUMPAD9 = 0x69;
+        /// <summary>
+        /// 数字键盘上的 乘号键。
+        /// </summary>
+        public const short VK_MULTIPLY = 0x6A;
+        /// <summary>
+        /// 数字键盘上的 加号键。
+        /// </summary>
+        public const short VK_ADD = 0x6B;
+        /// <summary>
+        /// 数字键盘上的 回车键。
+        /// </summary>
+        public const short VK_SEPARATOR = 0x6C;
+        /// <summary>
+        /// 数字键盘上的 减号键。
+        /// </summary>
+        public const short VK_SUBTRACT = 0x6D;
+        /// <summary>
+        /// 数字键盘上的 句点键。
+        /// </summary>
+        public const short VK_DECIMAL = 0x6E;
+        /// <summary>
+        /// 数字键盘上的 除号键。
+        /// </summary>
+        public const short VK_DIVIDE = 0x6F;
+        /// <summary>
+        /// F1 键。
+        /// </summary>
+        public const short VK_F1 = 0x70;
+        /// <summary>
+        /// F2 键。
+        /// </summary>
+        public const short VK_F2 = 0x71;
+        /// <summary>
+        /// F3 键。
+        /// </summary>
+        public const short VK_F3 = 0x72;
+        /// <summary>
+        /// F4 键。
+        /// </summary>
+        public const short VK_F4 = 0x73;
+        /// <summary>
+        /// F5 键。
+        /// </summary>
+        public const short VK_F5 = 0x74;
+        /// <summary>
+        /// F6 键。
+        /// </summary>
+        public const short VK_F6 = 0x75;
+        /// <summary>
+        /// F7 键。
+        /// </summary>
+        public const short VK_F7 = 0x76;
+        /// <summary>
+        /// F8 键。
+        /// </summary>
+        public const short VK_F8 = 0x77;
+        /// <summary>
+        /// F9 键。
+        /// </summary>
+        public const short VK_F9 = 0x78;
+        /// <summary>
+        /// F10 键。
+        /// </summary>
+        public const short VK_F10 = 0x79;
+        /// <summary>
+        /// F11 键。
+        /// </summary>
+        public const short VK_F11 = 0x7A;
+        /// <summary>
+        /// F12 键。
+        /// </summary>
+        public const short VK_F12 = 0x7B;
+        /// <summary>
+        /// F13 键。
+        /// </summary>
+        public const short VK_F13 = 0x7C;
+        /// <summary>
+        /// F14 键。
+        /// </summary>
+        public const short VK_F14 = 0x7D;
+        /// <summary>
+        /// F15 键。
+        /// </summary>
+        public const short VK_F15 = 0x7E;
+        /// <summary>
+        /// F16 键。
+        /// </summary>
+        public const short VK_F16 = 0x7F;
+        /// <summary>
+        /// F17 键。
+        /// </summary>
+        public const short VK_F17 = 0x80;
+        /// <summary>
+        /// F18 键。
+        /// </summary>
+        public const short VK_F18 = 0x81;
+        /// <summary>
+        /// F19 键。
+        /// </summary>
+        public const short VK_F19 = 0x82;
+        /// <summary>
+        /// F20 键。
+        /// </summary>
+        public const short VK_F20 = 0x83;
+        /// <summary>
+        /// F21 键。
+        /// </summary>
+        public const short VK_F21 = 0x84;
+        /// <summary>
+        /// F22 键。
+        /// </summary>
+        public const short VK_F22 = 0x85;
+        /// <summary>
+        /// F23 键。
+        /// </summary>
+        public const short VK_F23 = 0x86;
+        /// <summary>
+        /// F24 键。
+        /// </summary>
+        public const short VK_F24 = 0x87;
+        /// <summary>
+        /// Num Lock 键。
+        /// </summary>
+        public const short VK_NUMLOCK = 0x90;
+        /// <summary>
+        /// Scroll Lock 键。
+        /// </summary>
+        public const short VK_SCROLL = 0x91;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_NEC_EQUAL = 0x92;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FJ_JISHO = 0x92;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FJ_MASSHOU = 0x93;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FJ_TOUROKU = 0x94;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FJ_LOYA = 0x95;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FJ_ROYA = 0x96;
+        /// <summary>
+        /// 左 Shift 键。
+        /// </summary>
+        public const short VK_LSHIFT = 0xA0;
+        /// <summary>
+        /// 右 Shift 键。
+        /// </summary>
+        public const short VK_RSHIFT = 0xA1;
+        /// <summary>
+        /// 左 Ctrl 键。
+        /// </summary>
+        public const short VK_LCONTROL = 0xA2;
+        /// <summary>
+        /// 右 Ctrl 键。
+        /// </summary>
+        public const short VK_RCONTROL = 0xA3;
+        /// <summary>
+        /// 左 Alt 键。
+        /// </summary>
+        public const short VK_LMENU = 0xA4;
+        /// <summary>
+        /// 右 Alt 键。
+        /// </summary>
+        public const short VK_RMENU = 0xA5;
+        /// <summary>
+        /// 浏览器后退键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_BACK = 0xA6;
+        /// <summary>
+        /// 浏览器前进键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_FORWARD = 0xA7;
+        /// <summary>
+        /// 浏览器刷新键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_REFRESH = 0xA8;
+        /// <summary>
+        /// 浏览器停止键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_STOP = 0xA9;
+        /// <summary>
+        /// 浏览器搜索键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_SEARCH = 0xAA;
+        /// <summary>
+        /// 浏览器收藏夹键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_FAVORITES = 0xAB;
+        /// <summary>
+        /// 浏览器主页键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_BROWSER_HOME = 0xAC;
+        /// <summary>
+        /// 静音键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_VOLUME_MUTE = 0xAD;
+        /// <summary>
+        /// 减小音量键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_VOLUME_DOWN = 0xAE;
+        /// <summary>
+        /// 增大音量键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_VOLUME_UP = 0xAF;
+        /// <summary>
+        /// 媒体下一曲目键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_MEDIA_NEXT_TRACK = 0xB0;
+        /// <summary>
+        /// 媒体上一曲目键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_MEDIA_PREV_TRACK = 0xB1;
+        /// <summary>
+        /// 媒体停止键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_MEDIA_STOP = 0xB2;
+        /// <summary>
+        /// 媒体播放暂停键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_MEDIA_PLAY_PAUSE = 0xB3;
+        /// <summary>
+        /// 启动邮件键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_LAUNCH_MAIL = 0xB4;
+        /// <summary>
+        /// 选择媒体键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_LAUNCH_MEDIA_SELECT = 0xB5;
+        /// <summary>
+        /// 启动应用程序一键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_LAUNCH_APP1 = 0xB6;
+        /// <summary>
+        /// 启动应用程序二键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_LAUNCH_APP2 = 0xB7;
+        /// <summary>
+        /// OEM 1 键。
+        /// </summary>
+        public const short VK_OEM_1 = 0xBA;   // ';:' for US
+        /// <summary>
+        /// 美式标准键盘上的 OEM 分号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_SEMICOLON = 0xBA;
+        /// <summary>
+        /// 任何国家/地区键盘上的 OEM 加号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_PLUS = 0xBB;
+        /// <summary>
+        /// 任何国家/地区键盘上的 OEM 逗号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_COMMA = 0xBC;
+        /// <summary>
+        ///  任何国家/地区键盘上的 OEM 减号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_MINUS = 0xBD;
+        /// <summary>
+        /// 任何国家/地区键盘上的 OEM 句点键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_PERIOD = 0xBE;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 问号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_QUESTION = 0xBF;
+        /// <summary>
+        /// OEM 2 键。
+        /// </summary>
+        public const short VK_OEM_2 = 0xBF;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 波形符键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_OEMTILDE = 0xC0;
+        /// <summary>
+        /// OEM 3 键。
+        /// </summary>
+        public const short VK_OEM_3 = 0xC0;
+        /// <summary>
+        /// OEM 4 键。
+        /// </summary>
+        public const short VK_OEM_4 = 0xDB;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 左括号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_OPENBRACKETS = 0xDB;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 管道键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_PIPLE = 0xDC;
+        /// <summary>
+        /// OEM 5 键。
+        /// </summary>
+        public const short VK_OEM_5 = 0xDC;
+        /// <summary>
+        /// OEM 6 键。
+        /// </summary>
+        public const short VK_OEM_6 = 0xDD;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 右括号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_CLOSEBRACKETS = 0xDD;
+        /// <summary>
+        /// OEM 7 键。
+        /// </summary>
+        public const short VK_OEM_7 = 0xDE;
+        /// <summary>
+        /// 美式标准键盘上的 OEM 单/双引号键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_QUOTES = 0xDE;
+        /// <summary>
+        /// OEM 8 键。
+        /// </summary>
+        public const short VK_OEM_8 = 0xDF;
+        /// <summary>
+        /// 日本AX键盘的 AX 键。
+        /// </summary>
+        public const short VK_OEM_AX = 0xE1;
+        /// <summary>
+        /// OEM 102 键。
+        /// </summary>
+        public const short VK_OEM_102 = 0xE2;
+        /// <summary>
+        /// RT 102 键的键盘上的 OEM 尖括号或反斜杠键(Windows 2000 或更高版本)。
+        /// </summary>
+        public const short VK_OEM_BACKSLASH = 0xE2;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_ICO_HELP = 0xE3;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_ICO_00 = 0xE4;
+        /// <summary>
+        /// Process Key 键。输入法处理键。
+        /// </summary>
+        public const short VK_PROCESSKEY = 0xE5;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_ICO_CLEAR = 0xE6;
+        /// <summary>
+        /// 用于将 Unicode 字符当作键击传递。Packet 键值是用于非键盘输入法的 32 位虚拟键值的低位字。
+        /// </summary>
+        public const short VK_PACKET = 0xE7;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_RESET = 0xE9;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_JUMP = 0xEA;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_PA1 = 0xEB;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_PA2 = 0xEC;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_PA3 = 0xED;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_WSCTRL = 0xEE;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_CUSEL = 0xEF;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_ATTN = 0xF0;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_FINISH = 0xF1;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_COPY = 0xF2;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_AUTO = 0xF3;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_ENLW = 0xF4;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const short VK_OEM_BACKTAB = 0xF5;
+        /// <summary>
+        /// Attn 键。
+        /// </summary>
+        public const short VK_ATTN = 0xF6;
+        /// <summary>
+        /// Crsel 键。
+        /// </summary>
+        public const short VK_CRSEL = 0xF7;
+        /// <summary>
+        /// Exsel 键。
+        /// </summary>
+        public const short VK_EXSEL = 0xF8;
+        /// <summary>
+        /// ERASE EOF 键。
+        /// </summary>
+        public const short VK_EREOF = 0xF9;
+        /// <summary>
+        /// Play 键。
+        /// </summary>
+        public const short VK_PLAY = 0xFA;
+        /// <summary>
+        /// Zoom 键。
+        /// </summary>
+        public const short VK_ZOOM = 0xFB;
+        /// <summary>
+        /// 保留以备将来使用的常数。
+        /// </summary>
+        public const short VK_NONAME = 0xFC;
+        /// <summary>
+        /// PA1 键。
+        /// </summary>
+        public const short VK_PA1 = 0xFD;
+        /// <summary>
+        /// Clear 键。
+        /// </summary>
+        public const short VK_OEM_CLEAR = 0xFE;
+    }
+}

+ 19 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WAVE_FORMAT.cs

@@ -0,0 +1,19 @@
+namespace Microsoft.Win32
+{
+    //WAVE_FORMAT定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// WAVE_FORMAT_PCM
+        /// </summary>
+        public const int WAVE_FORMAT_PCM = 1;
+        /// <summary>
+        /// WAVE_FORMAT_ADPCM
+        /// </summary>
+        public const int WAVE_FORMAT_ADPCM = 2;
+        /// <summary>
+        /// WAVE_FORMAT_IEEE_FLOAT
+        /// </summary>
+        public const int WAVE_FORMAT_IEEE_FLOAT = 3;
+    }
+}

File diff suppressed because it is too large
+ 948 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WM.cs


+ 122 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WS.cs

@@ -0,0 +1,122 @@
+namespace Microsoft.Win32
+{
+    //WS定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The window is an overlapped window. An overlapped window has a title bar and a border.
+        /// </summary>
+        public const int WS_OVERLAPPED = 0x00000000;
+        /// <summary>
+        /// The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
+        /// </summary> 
+        public const int WS_MAXIMIZEBOX = 0x00010000;
+        /// <summary>
+        /// The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
+        /// </summary>
+        public const int WS_MINIMIZEBOX = 0x00020000;
+        /// <summary>
+        /// The window is a control that can receive the keyboard focus when the user presses the TAB key.
+        /// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.  
+        /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.
+        /// For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.
+        /// </summary>
+        public const int WS_TABSTOP = 0x00010000;
+        /// <summary>
+        /// The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.
+        /// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
+        /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.
+        /// </summary>
+        public const int WS_GROUP = 0x00020000;
+        /// <summary>
+        /// The window has a sizing border. Same as the WS_SIZEBOX style.
+        /// </summary>
+        public const int WS_THICKFRAME = 0x00040000;
+        /// <summary>
+        /// The window has a window menu on its title bar. The WS_CAPTION style must also be specified.
+        /// </summary>
+        public const int WS_SYSMENU = 0x00080000;
+        /// <summary>
+        /// The window has a horizontal scroll bar.
+        /// </summary>
+        public const int WS_HSCROLL = 0x00100000;
+        /// <summary>
+        /// The window has a vertical scroll bar.
+        /// </summary>
+        public const int WS_VSCROLL = 0x00200000;
+        /// <summary>
+        /// The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.
+        /// </summary>
+        public const int WS_DLGFRAME = 0x00400000;
+        /// <summary>
+        /// The window has a thin-line border.
+        /// </summary>
+        public const int WS_BORDER = 0x000800000;
+        /// <summary>
+        /// The window has a title bar (includes the WS_BORDER style)./* WS_BORDER | WS_DLGFRAME  */
+        /// </summary>
+        public const int WS_CAPTION = 0x00C00000;
+        /// <summary>
+        /// The window is initially maximized.
+        /// </summary> 
+        public const int WS_MAXIMIZE = 0x01000000;
+        /// <summary>
+        /// Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.
+        /// </summary>
+        public const int WS_CLIPCHILDREN = 0x02000000;
+        /// <summary>
+        /// Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.
+        /// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.
+        /// </summary>
+        public const int WS_CLIPSIBLINGS = 0x04000000;
+        /// <summary>
+        /// The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.
+        /// </summary>
+        public const int WS_DISABLED = 0x08000000;
+        /// <summary>
+        /// The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.
+        /// </summary>
+        public const int WS_VISIBLE = 0x10000000;
+        /// <summary>
+        /// The window is initially minimized.
+        /// </summary>
+        public const int WS_MINIMIZE = 0x20000000;
+        /// <summary>
+        /// The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.
+        /// </summary>
+        public const int WS_CHILD = 0x40000000;
+        /// <summary>
+        /// The window is a pop-up window. This style cannot be used with the WS_CHILD style.
+        /// </summary>
+        public const int WS_POPUP = unchecked((int)0x80000000);
+
+        /// <summary>
+        /// The window is an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
+        /// </summary>
+        public const int WS_TILED = WS_OVERLAPPED;
+        /// <summary>
+        /// The window is initially minimized. Same as the WS_MINIMIZE style.
+        /// </summary>
+        public const int WS_ICONIC = WS_MINIMIZE;
+        /// <summary>
+        /// The window has a sizing border. Same as the WS_THICKFRAME style.
+        /// </summary>
+        public const int WS_SIZEBOX = WS_THICKFRAME;
+        /// <summary>
+        /// The window is an overlapped window. Same as the WS_OVERLAPPEDWINDOW style.
+        /// </summary>
+        public const int WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW;
+        /// <summary>
+        /// The window is an overlapped window.
+        /// </summary>
+        public const int WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
+        /// <summary>
+        /// The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.
+        /// </summary>
+        public const int WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU;
+        /// <summary>
+        /// Same as the WS_CHILD style.
+        /// </summary>
+        public const int WS_CHILDWINDOW = WS_CHILD;
+    }
+}

+ 49 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WSAID.cs

@@ -0,0 +1,49 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //WSAID定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The AcceptEx extension function.
+        /// </summary>
+        public static readonly Guid WSAID_ACCEPTEX = new Guid("{0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}");
+        /// <summary>
+        /// The ConnectEx extension function.
+        /// </summary>
+        public static readonly Guid WSAID_CONNECTEX = new Guid("{0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}");
+        /// <summary>
+        /// The DisconnectEx extension function.
+        /// </summary>
+        public static readonly Guid WSAID_DISCONNECTEX = new Guid("{0x7fda2e11,0x8630,0x436f,{0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}");
+        /// <summary>
+        /// The GetAcceptExSockaddrs extension function.
+        /// </summary>
+        public static readonly Guid WSAID_GETACCEPTEXSOCKADDRS = new Guid("{0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}");
+        /// <summary>
+        /// None.
+        /// </summary>
+        public static readonly Guid WSAID_MULTIPLE_RIO = new Guid("{0x8509e081,0x96dd,0x4005,{0xb1,0x65,0x9e,0x2e,0xe8,0xc7,0x9e,0x3f}}");
+        /// <summary>
+        /// The TransmitFile extension function.
+        /// </summary>
+        public static readonly Guid WSAID_TRANSMITFILE = new Guid("{0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}");
+        /// <summary>
+        /// The TransmitPackets extension function.
+        /// </summary>
+        public static readonly Guid WSAID_TRANSMITPACKETS = new Guid("{0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}}");
+        /// <summary>
+        /// None.
+        /// </summary>
+        public static readonly Guid WSAID_WSAPOLL = new Guid("{0x18C76F85,0xDC66,0x4964,{0x97,0x2E,0x23,0xC2,0x72,0x38,0x31,0x2B}}");
+        /// <summary>
+        /// The WSARecvMsg extension function.
+        /// </summary>
+        public static readonly Guid WSAID_WSARECVMSG = new Guid("{0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}}");
+        /// <summary>
+        /// The WSASendMsg extension function.
+        /// </summary>
+        public static readonly Guid WSAID_WSASENDMSG = new Guid("{0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}}");
+    }
+}

+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WSA_FLAG.cs

@@ -0,0 +1,39 @@
+namespace Microsoft.Win32
+{
+    //WSA_FLAG定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// This flag causes an overlapped socket to be created. Overlapped sockets can use WSASend, WSASendTo, WSARecv, WSARecvFrom, and WSAIoctl for overlapped I/O operations, which allow multiple operations to be initiated and in progress simultaneously. All functions that allow overlapped operation also support nonoverlapped usage on an overlapped socket if the values for parameters related to overlapped operations are NULL.
+        /// </summary>
+        public const int WSA_FLAG_OVERLAPPED = 0x01;
+        /// <summary>
+        /// Indicates that the socket created will be a c_root in a multipoint session. This is only allowed if a rooted control plane is indicated in the protocol's WSAPROTOCOL_INFO structure.
+        /// </summary>
+        public const int WSA_FLAG_MULTIPOINT_C_ROOT = 0x02;
+        /// <summary>
+        /// Indicates that the socket created will be a c_leaf in a multicast session. This is only allowed if XP1_SUPPORT_MULTIPOINT is indicated in the protocol's WSAPROTOCOL_INFO structure.
+        /// </summary>
+        public const int WSA_FLAG_MULTIPOINT_C_LEAF = 0x04;
+        /// <summary>
+        /// Indicates that the socket created will be a d_root in a multipoint session. This is only allowed if a rooted data plane is indicated in the protocol's WSAPROTOCOL_INFO structure. Refer to Multipoint and Multicast Semantics for additional information.
+        /// </summary>
+        public const int WSA_FLAG_MULTIPOINT_D_ROOT = 0x08;
+        /// <summary>
+        /// Indicates that the socket created will be a d_leaf in a multipoint session. This is only allowed if XP1_SUPPORT_MULTIPOINT is indicated in the protocol's WSAPROTOCOL_INFO structure.
+        /// </summary>
+        public const int WSA_FLAG_MULTIPOINT_D_LEAF = 0x10;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int WSA_FLAG_ACCESS_SYSTEM_SECURITY = 0x40;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int WSA_FLAG_NO_HANDLE_INHERIT = 0x80;
+        /// <summary>
+        /// 
+        /// </summary>
+        public const int WSA_FLAG_REGISTERED_IO = 0x100;
+    }
+}

+ 116 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Consts/WS_EX.cs

@@ -0,0 +1,116 @@
+namespace Microsoft.Win32
+{
+    //WS_EX定义
+    public static partial class NativeMethods
+    {
+        /// <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>
+        public const int WS_EX_DLGMODALFRAME = 0x00000001;
+        /// <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>
+        public const int WS_EX_NOPARENTNOTIFY = 0x00000004;
+        /// <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>
+        public const int WS_EX_TOPMOST = 0x00000008;
+        /// <summary>
+        /// Specifies that a window created with this style accepts drag-drop files.
+        /// </summary>
+        public const int WS_EX_ACCEPTFILES = 0x00000010;
+        /// <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>
+        public const int WS_EX_TRANSPARENT = 0x00000020;
+        /// <summary>
+        /// Creates a multiple-document interface (MDI) child window.
+        /// </summary>
+        public const int WS_EX_MDICHILD = 0x00000040;
+        /// <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>
+        public const int WS_EX_TOOLWINDOW = 0x00000080;
+        /// <summary>
+        /// Specifies that a window has a border with a raised edge.
+        /// </summary>
+        public const int WS_EX_WINDOWEDGE = 0x00000100;
+        /// <summary>
+        /// Specifies that a window has a border with a sunken edge.
+        /// </summary>
+        public const int WS_EX_CLIENTEDGE = 0x00000200;
+        /// <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>
+        public const int WS_EX_CONTEXTHELP = 0x00000400;
+        /// <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>
+        public const int WS_EX_RIGHT = 0x00001000;
+        /// <summary>
+        /// Creates a window that has generic left-aligned properties. This is the default.
+        /// </summary>
+        public const int WS_EX_LEFT = 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>
+        public const int WS_EX_RTLREADING = 0x00002000;
+        /// <summary>
+        /// The window text is displayed using left-to-right reading-order properties. This is the default.
+        /// </summary>
+        public const int WS_EX_LTRREADING = 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>
+        public const int WS_EX_LEFTSCROLLBAR = 0x00004000;
+        /// <summary>
+        /// Vertical scroll bar (if present) is to the right of the client area. This is the default.
+        /// </summary>
+        public const int WS_EX_RIGHTSCROLLBAR = 0x00000000;
+        /// <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>
+        public const int WS_EX_CONTROLPARENT = 0x00010000;
+        /// <summary>
+        /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
+        /// </summary>
+        public const int WS_EX_STATICEDGE = 0x00020000;
+        /// <summary>
+        /// Forces a top-level window onto the taskbar when the window is visible.
+        /// </summary>
+        public const int WS_EX_APPWINDOW = 0x00040000;
+        /// <summary>
+        /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
+        /// </summary>
+        public const int WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE;
+        /// <summary>
+        /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.
+        /// </summary>
+        public const int WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
+        /// <summary>
+        /// Windows 2000/XP: Creates a layered window. Note 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>
+        public const int WS_EX_LAYERED = 0x00080000;
+        /// <summary>
+        /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.
+        /// </summary>
+        public const int WS_EX_NOINHERITLAYOUT = 0x00100000;
+        /// <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>
+        public const int WS_EX_LAYOUTRTL = 0x00400000;
+        /// <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>
+        public const int WS_EX_COMPOSITED = 0x02000000;
+        /// <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>
+        public const int WS_EX_NOACTIVATE = 0x08000000;
+    }
+}

File diff suppressed because it is too large
+ 31 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_ACCEPTEX.cs


File diff suppressed because it is too large
+ 29 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_CONNECTEX.cs


+ 23 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Delegates/LPFN_DISCONNECTEX.cs

@@ -0,0 +1,23 @@
+using System;
+
+namespace Microsoft.Win32
+{
+    //LPFN_DISCONNECTEX定义
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The DisconnectEx function closes a connection on a socket, and allows the socket handle to be reused.Note  This function is a Microsoft-specific extension to the Windows Sockets specification.
+        /// </summary>
+        /// <param name="s">A handle to a connected, connection-oriented socket.</param>
+        /// <param name="lpOverlapped">A pointer to an OVERLAPPED structure. If the socket handle has been opened as overlapped, specifying this parameter results in an overlapped (asynchronous) I/O operation.</param>
+        /// <param name="dwFlags">A set of flags that customizes processing of the function call. When this parameter is set to zero, no flags are set. The dwFlags parameter can have the following value.</param>
+        /// <param name="dwReserved">Reserved. Must be zero. If nonzero, WSAEINVAL is returned.</param>
+        /// <returns>On success, the DisconnectEx function returns TRUE. On failure, the function returns FALSE. Use the WSAGetLastError function to get extended error information. If a call to the WSAGetLastError function returns ERROR_IO_PENDING, the operation initiated successfully and is in progress. Under such circumstances, the call may still fail when the operation completes.</returns>
+        public delegate bool LPFN_DISCONNECTEX(
+            IntPtr s,
+            IntPtr lpOverlapped,
+            int dwFlags,
+            int dwReserved
+            );
+    }
+}

File diff suppressed because it is too large
+ 75 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/BLENDFUNCTION.cs


+ 54 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/COMBOBOXINFO.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// COMBOBOXINFO定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// COMBOBOXINFO Contains combo box status information.
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct COMBOBOXINFO
+        {
+            /// <summary>
+            /// The size, in bytes, of the structure. The calling application must set this to sizeof(COMBOBOXINFO).
+            /// </summary>
+            public int cbSize;
+            /// <summary>
+            /// A RECT structure that specifies the coordinates of the edit box.
+            /// </summary>
+            public RECT rcItem;
+            /// <summary>
+            /// A RECT structure that specifies the coordinates of the button that contains the drop-down arrow.
+            /// </summary>
+            public RECT rcButton;
+            /// <summary>
+            /// <para>The combo box button state. This parameter can be one of the following values.</para>
+            /// <para>Value	Meaning</para>
+            /// <para>0</para>
+            /// <para>The button exists and is not pressed.</para>
+            /// <para>STATE_SYSTEM_INVISIBLE</para>
+            /// <para>There is no button.</para>
+            /// <para>STATE_SYSTEM_PRESSED</para>
+            /// <para>The button is pressed.</para>
+            /// </summary>
+            public int stateButton;
+            /// <summary>
+            /// A handle to the combo box.
+            /// </summary>
+            public IntPtr hwndCombo;
+            /// <summary>
+            /// A handle to the edit box.
+            /// </summary>
+            public IntPtr hwndItem;
+            /// <summary>
+            /// A handle to the drop-down list.
+            /// </summary>
+            public IntPtr hwndList;
+        }
+    }
+}

+ 31 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/COPYDATASTRUCT.cs

@@ -0,0 +1,31 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// COPYDATASTRUCT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 进程间传递数据结构
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct COPYDATASTRUCT
+        {
+            /// <summary>
+            /// flag
+            /// </summary>
+            public int dwData;//flag
+            /// <summary>
+            /// 大小
+            /// </summary>
+            public int cbData;//size
+            /// <summary>
+            /// 数据
+            /// </summary>
+            [MarshalAs(UnmanagedType.LPStr)]
+            public string lpData;
+        }
+    }
+}

+ 35 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/CURSORINFO.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// CURSORINFO定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 光标信息
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct CURSORINFO
+        {
+            /// <summary>
+            /// Specifies the size, in bytes, of the structure. The caller must set this to Marshal.SizeOf(typeof(CURSORINFO)).
+            /// </summary>
+            public int cbSize;
+            /// <summary>
+            /// Specifies the cursor state. This parameter can be one of the following values:0 The cursor is hidden.1 The cursor is showing.
+            /// </summary>
+            public int flags;
+            /// <summary>
+            /// Handle to the cursor. 
+            /// </summary>
+            public IntPtr hCursor;
+            /// <summary>
+            /// A POINT structure that receives the screen coordinates of the cursor. 
+            /// </summary>
+            public POINT ptScreenPos;
+        }
+    }
+}

+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/FLASHWINFO.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// FLASHWINFO定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// FLASHWINFO
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct FLASHWINFO
+        {
+            /// <summary>
+            /// The size of the structure, in bytes.
+            /// </summary>
+            public int cbSize;
+            /// <summary>
+            /// A handle to the window to be flashed. The window can be either opened or minimized.
+            /// </summary>
+            public IntPtr hwnd;
+            /// <summary>
+            /// The flash status. This parameter can be one or more of the following values.see FLASHW_
+            /// </summary>
+            public int dwFlags;
+            /// <summary>
+            /// The number of times to flash the window.
+            /// </summary>
+            public int uCount;
+            /// <summary>
+            /// The rate at which the window is to be flashed, in milliseconds. If dwTimeout is zero, the function uses the default cursor blink rate.
+            /// </summary>
+            public int dwTimeout;
+        }
+    }
+}

+ 37 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/GRADIENT_RECT.cs

@@ -0,0 +1,37 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// GRADIENT_RECT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The GRADIENT_RECT structure specifies the index of two vertices in the pVertex array in the GradientFill function. These two vertices form the upper-left and lower-right boundaries of a rectangle.
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct GRADIENT_RECT
+        {
+            /// <summary>
+            /// The upper-left corner of a rectangle.
+            /// </summary>
+            public uint UpperLeft;
+            /// <summary>
+            /// The lower-right corner of a rectangle.
+            /// </summary>
+            public uint LowerRight;
+
+            /// <summary>
+            /// 构造函数
+            /// </summary>
+            /// <param name="upperLeft">左上角</param>
+            /// <param name="lowerRight">右上角</param>
+            public GRADIENT_RECT(uint upperLeft, uint lowerRight)
+            {
+                this.UpperLeft = upperLeft;
+                this.LowerRight = lowerRight;
+            }
+        }
+    }
+}

+ 43 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/GRADIENT_TRIANGLE.cs

@@ -0,0 +1,43 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// GRADIENT_TRIANGLE定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// The GRADIENT_TRIANGLE structure specifies the index of three vertices in the pVertex array in the GradientFill function. These three vertices form one triangle.
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct GRADIENT_TRIANGLE
+        {
+            /// <summary>
+            /// The first point of the triangle where sides intersect.
+            /// </summary>
+            uint Vertex1;
+            /// <summary>
+            /// The second point of the triangle where sides intersect.
+            /// </summary>
+            uint Vertex2;
+            /// <summary>
+            /// The third point of the triangle where sides intersect.
+            /// </summary>
+            uint Vertex3;
+
+            /// <summary>
+            /// 构造函数
+            /// </summary>
+            /// <param name="vertex1">第一个点</param>
+            /// <param name="vertex2">第二个点</param>
+            /// <param name="vertex3">第三个点</param>
+            public GRADIENT_TRIANGLE(uint vertex1, uint vertex2, uint vertex3)
+            {
+                this.Vertex1 = vertex1;
+                this.Vertex2 = vertex2;
+                this.Vertex3 = vertex3;
+            }
+        }
+    }
+}

+ 30 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/HARDWAREINPUT.cs

@@ -0,0 +1,30 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// HARDWAREINPUT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 硬件输入
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct HARDWAREINPUT
+        {
+            /// <summary>
+            /// The message generated by the input hardware.
+            /// </summary>
+            public int uMsg;
+            /// <summary>
+            /// The low-order word of the lParam parameter for uMsg.
+            /// </summary>
+            public short wParamL;
+            /// <summary>
+            /// The high-order word of the lParam parameter for uMsg.
+            /// </summary>
+            public short wParamH;
+        }
+    }
+}

+ 38 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/INPUT.cs

@@ -0,0 +1,38 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// INPUT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 输入数据,如果是64位系统应该改为[FieldOffset(8)]
+        /// </summary>
+        [StructLayout(LayoutKind.Explicit)]
+        public struct INPUT
+        {
+            /// <summary>
+            /// Indicates the type of device information this structure carries. It is one of the following values.
+            /// </summary>
+            [FieldOffset(0)]
+            public int type;
+            /// <summary>
+            /// MOUSEINPUT structure that contains information about simulated mouse input.
+            /// </summary>
+            [FieldOffset(4)]
+            public MOUSEINPUT mi;
+            /// <summary>
+            /// KEYBDINPUT structure that contains information about simulated keyboard input.
+            /// </summary>
+            [FieldOffset(4)]
+            public KEYBDINPUT ki;
+            /// <summary>
+            /// HARDWAREINPUT structure that contains information about a simulated input device message.
+            /// </summary>
+            [FieldOffset(4)]
+            public HARDWAREINPUT hi;
+        }
+    }
+}

+ 39 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/KEYBDINPUT.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// KEYBDINPUT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 键盘输入
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct KEYBDINPUT
+        {
+            /// <summary>
+            /// Provides a virtual-key code. The code must be a value in the range 1 to 254. The Winuser.h header file provides macro definitions (VK_*) for each value. If the dwFlags member specifies KEYEVENTF_UNICODE, then wVk must be 0.
+            /// </summary>
+            public short wVk;
+            /// <summary>
+            /// Provides a hardware scan code for the key. If dwFlags specifies KEYEVENTF_UNICODE, then wScan specifies a Unicode character that is to be sent to the foreground application.
+            /// </summary>
+            public short wScan;
+            /// <summary>
+            /// Provides various aspects of a keystroke. This member can be a combination of the following values.
+            /// </summary>
+            public int dwFlags;
+            /// <summary>
+            /// Data in this member is ignored.
+            /// </summary>
+            public int time;
+            /// <summary>
+            /// Data in this member is ignored.
+            /// </summary>
+            public IntPtr dwExtraInfo;
+        }
+    }
+}

+ 38 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MINMAXINFO.cs

@@ -0,0 +1,38 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// POINT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// POINT
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct MINMAXINFO
+        {
+            /// <summary>
+            /// 
+            /// </summary>
+            public POINT ptReserved;
+            /// <summary>
+            /// 
+            /// </summary>
+            public POINT ptMaxSize;
+            /// <summary>
+            /// 
+            /// </summary>
+            public POINT ptMaxPosition;
+            /// <summary>
+            /// 
+            /// </summary>
+            public POINT ptMinTrackSize;
+            /// <summary>
+            /// 
+            /// </summary>
+            public POINT ptMaxTrackSize;
+        }
+    }
+}

+ 38 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MMCKINFO.cs

@@ -0,0 +1,38 @@
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// MMCKINFO定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// MMCKINFO
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+        public struct MMCKINFO
+        {
+            /// <summary>
+            /// 
+            /// </summary>
+            public int ckID;
+            /// <summary>
+            /// 
+            /// </summary>
+            public int cksize;
+            /// <summary>
+            /// 
+            /// </summary>
+            public int fccType;
+            /// <summary>
+            /// 
+            /// </summary>
+            public int dwDataOffset;
+            /// <summary>
+            /// 
+            /// </summary>
+            public int dwFlags;
+        }
+    }
+}

+ 43 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/MOUSEINPUT.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// MOUSEINPUT定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// 鼠标输入
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct MOUSEINPUT
+        {
+            /// <summary>
+            /// Provides the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of the dwFlags member. Absolute data is provided as the x coordinate of the mouse; relative data is provided as the number of pixels moved.
+            /// </summary>
+            public int dx;
+            /// <summary>
+            /// Provides the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of the dwFlags member. Absolute data is provided as the y coordinate of the mouse; relative data is provided as the number of pixels moved.
+            /// </summary>
+            public int dy;
+            /// <summary>
+            /// If dwFlags contains MOUSEEVENTF_WHEEL, then mouseData provides the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.f dwFlags does not contain MOUSEEVENTF_WHEEL then mouseData should be zero.
+            /// </summary>
+            public int mouseData;
+            /// <summary>
+            /// Set of bit flags that indicate various aspects of mouse motion and button clicks. The bits in this member can be any reasonable combination of the following values.
+            /// </summary>
+            public int dwFlags;
+            /// <summary>
+            /// Time stamp for the event, in milliseconds. If this parameter is 0, the system will provide its own time stamp.
+            /// </summary>
+            public int time;
+            /// <summary>
+            /// Data in this member is ignored.
+            /// </summary>
+            public IntPtr dwExtraInfo;
+        }
+    }
+}

+ 31 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/NMHDR.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.Win32
+{
+    /// <summary>
+    /// NMHDR定义
+    /// </summary>
+    public static partial class NativeMethods
+    {
+        /// <summary>
+        /// NMHDR结构
+        /// </summary>
+        [StructLayout(LayoutKind.Sequential)]
+        public struct NMHDR
+        {
+            /// <summary>
+            /// A window handle to the control sending the message.
+            /// </summary>
+            public IntPtr hwndFrom;
+            /// <summary>
+            /// An identifier of the control sending the message.
+            /// </summary>
+            public IntPtr idFrom;
+            /// <summary>
+            /// A notification code. This member can be one of the common notification codes (see Notifications under General Control Reference), or it can be a control-specific notification code.
+            /// </summary>
+            public int code;         // NM_ code
+        }
+    }
+}

+ 0 - 0
PackageUpdater/Microsoft.Win32/NativeMethods/Structs/PAINTSTRUCT.cs


Some files were not shown because too many files changed in this diff