maruata

Win8Form

Dec 11th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 40.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Collections;
  11. using System.Diagnostics;
  12. using System.Drawing.Drawing2D;
  13. using System.Runtime.InteropServices;
  14.  
  15. namespace ZoSoft.Themes
  16. {
  17.     public partial class Win8Form : Form
  18.     {
  19.         //Variable
  20.        
  21.         private const int WM_NCHITTEST = 0x84;
  22.         private const int HTCLIENT = 0x1;
  23.         private const int HTCAPTION = 0x2;
  24.         public const int WMNCLBUTTONDOWN = 0xA1;
  25.         [DllImportAttribute("user32.dll")]
  26.         public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
  27.         [DllImportAttribute("user32.dll")]
  28.         public static extern bool ReleaseCapture();
  29.  
  30.         [DllImport("user32.dll")]
  31.         static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
  32.  
  33.         private const int _shadowsize = 1;
  34.  
  35.         private Color _backColor = Color.FromArgb(118, 187, 236);
  36.         private Dwm.MARGINS dwmMargins;
  37.         private bool _marginOk;
  38.         private bool _aeroEnabled;
  39.         private const int BorderWidth = 6;
  40.         private ResizeDirection _resizeDir;
  41.         private const int WM_NCLBUTTONDOWN = 161;
  42.         private const int HTBORDER = 18;
  43.         private const int HTBOTTOM = 15;
  44.         private const int HTBOTTOMLEFT = 16;
  45.         private const int HTBOTTOMRIGHT = 17;
  46.         private const int HTLEFT = 10;
  47.         private const int HTRIGHT = 11;
  48.         private const int HTTOP = 12;
  49.         private const int HTTOPLEFT = 13;
  50.         private const int HTTOPRIGHT = 14;
  51.  
  52.         private Label close = new Label();
  53.         private Label min = new Label();
  54.         private Label max = new Label();
  55.        
  56.         //Enum
  57.         public enum ResizeDirection
  58.         {
  59.             None = 0,
  60.             Left = 1,
  61.             TopLeft = 2,
  62.             Top = 4,
  63.             TopRight = 8,
  64.             Right = 16,
  65.             BottomRight = 32,
  66.             Bottom = 64,
  67.             BottomLeft = 128
  68.         }
  69.  
  70.         //Properties
  71.         public override Color BackColor
  72.         {
  73.             get
  74.             {
  75.                 return _backColor;
  76.             }
  77.             set
  78.             {
  79.                 _backColor = value;
  80.                 Invalidate();
  81.             }
  82.         }
  83.  
  84.         public bool AeroEnabled
  85.         {
  86.             get
  87.             {
  88.                 return this._aeroEnabled;
  89.             }
  90.             set { this._aeroEnabled = value; Invalidate(); }
  91.         }
  92.  
  93.  
  94.         //Constructor
  95.         public Win8Form()
  96.         {
  97.             SetStyle(ControlStyles.Selectable | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  98.             StartPosition = FormStartPosition.Manual;
  99.             FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  100.             base.BackColor = this.BackColor;
  101.             base.Opacity = this.Opacity = 0.90F;
  102.             this._aeroEnabled = false;
  103.             this._resizeDir = ResizeDirection.None;
  104.             this.DoubleBuffered = true;
  105.             this.MinimumSize = new Size(100, 100);
  106.  
  107.             this.close.Text = "X";
  108.             this.min.Text = "-";
  109.             this.max.Text = "□";
  110.  
  111.             this.close.AutoSize = false;
  112.             this.min.AutoSize = false;
  113.             this.max.AutoSize = false;
  114.  
  115.             this.min.BackColor = System.Drawing.Color.Transparent;
  116.             this.min.Font = new System.Drawing.Font("Lucida Console", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  117.             this.min.Size = new System.Drawing.Size(25, 16);
  118.             this.min.TabIndex = 1;
  119.             this.min.Text = "-";
  120.             this.min.ForeColor = Color.Yellow;
  121.             this.min.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  122.             this.min.MouseHover += new System.EventHandler(ControlMouseOver);
  123.             this.min.MouseLeave += new System.EventHandler(ControlMouseLeave);
  124.             this.min.MouseClick += new System.Windows.Forms.MouseEventHandler(MinClick);
  125.  
  126.             this.max.BackColor = System.Drawing.Color.Transparent;
  127.             this.max.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  128.             this.max.Size = new System.Drawing.Size(24, 20);
  129.             this.max.TabIndex = 2;
  130.             this.max.ForeColor = Color.GreenYellow;
  131.             this.max.Text = "□";
  132.             this.max.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  133.             this.max.MouseHover += new System.EventHandler(ControlMouseOver);
  134.             this.max.MouseLeave += new System.EventHandler(ControlMouseLeave);
  135.             this.max.MouseClick += new System.Windows.Forms.MouseEventHandler(MaxClick);
  136.  
  137.             this.close.Size = new System.Drawing.Size(49, 19);
  138.             this.close.TabIndex = 3;
  139.             this.close.Text = "X";
  140.             this.close.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  141.             this.close.BackColor = System.Drawing.Color.Transparent;
  142.             this.close.ForeColor = Color.Red;
  143.             this.close.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  144.             this.close.MouseHover += new System.EventHandler(ControlMouseOver);
  145.             this.close.MouseLeave += new System.EventHandler(ControlMouseLeave);
  146.             this.close.MouseClick += new System.Windows.Forms.MouseEventHandler(CloseClick);
  147.            
  148.         }
  149.  
  150.         //Override
  151.         protected override void WndProc(ref Message m)
  152.         {
  153.             IntPtr result = default(IntPtr);
  154.             int WM_NCCALCSIZE = 131;
  155.             int WM_NCHITTEST = 132;
  156.             if (Dwm.DwmDefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam, ref result) == 1)
  157.             {
  158.                 m.Result = result;
  159.             }
  160.             else if ((m.Msg != WM_NCCALCSIZE || (int)m.WParam != 1 ? false : true))
  161.             {
  162.                 WinApi.NCCALCSIZE_PARAMS nccsp = (WinApi.NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(WinApi.NCCALCSIZE_PARAMS));
  163.                 nccsp.rect0.Top = checked(nccsp.rect0.Top + 0);
  164.                 nccsp.rect0.Bottom = checked(nccsp.rect0.Bottom + 0);
  165.                 nccsp.rect0.Left = checked(nccsp.rect0.Left + 0);
  166.                 nccsp.rect0.Right = checked(nccsp.rect0.Right + 0);
  167.                 if (!this._marginOk)
  168.                 {
  169.                     this.dwmMargins.cyTopHeight = 0;
  170.                     this.dwmMargins.cxLeftWidth = 0;
  171.                     this.dwmMargins.cyBottomHeight = 3;
  172.                     this.dwmMargins.cxRightWidth = 0;
  173.                     this._marginOk = true;
  174.                 }
  175.                 Marshal.StructureToPtr(nccsp, m.LParam, false);
  176.                 m.Result = IntPtr.Zero;
  177.             }
  178.             else if ((m.Msg != WM_NCHITTEST || (int)m.Result != 0 ? true : false))
  179.             {
  180.                 base.WndProc(ref m);
  181.             }
  182.             else
  183.             {
  184.                 m.Result = this.HitTestNCA(m.HWnd, m.WParam, m.LParam);
  185.             }
  186.         }
  187.  
  188.         protected override void OnPaint(PaintEventArgs e)
  189.         {
  190.             Graphics g = e.Graphics;
  191.             g.SmoothingMode = SmoothingMode.HighQuality;
  192.  
  193.             int cPosition = Width - 110;            
  194.            
  195.             g.DrawRectangle(new Pen(new SolidBrush(Color.Black), 1f), new Rectangle(1, 1, Width - 3, Height - 6));
  196.  
  197.             //Form Icon
  198.             g.DrawIcon(base.Icon, new Rectangle(6, 6, 32, 32));
  199.  
  200.             //Draw Form Caption Text
  201.             int captionposition = (base.FontHeight / 2);
  202.             g.DrawString(base.Text, base.Font, new SolidBrush(base.ForeColor), 38f, captionposition);
  203.            
  204.             //Controls
  205.  
  206.             // Create pen.
  207.             Pen blackPen = new Pen(Color.Black, 1);
  208.  
  209.             // Create array of rectangles.
  210.             Rectangle[] rects =
  211.             {
  212.                 new Rectangle(cPosition, 6, 25, 25),
  213.                 new Rectangle(cPosition+25, 6, 25,  25),
  214.                 new Rectangle(cPosition+25+25,   6,  50, 25)
  215.             };
  216.  
  217.             // Draw rectangles to screen.
  218.             e.Graphics.DrawRectangles(blackPen, rects);
  219.  
  220.             //Draw Control Text
  221.             this.Controls.Add(close);
  222.             this.Controls.Add(max);
  223.             this.Controls.Add(min);
  224.  
  225.             //Small Setting for position
  226.             this.close.Location = new Point(cPosition+25+25,8);
  227.             this.max.Location = new Point(cPosition + 26, 5);
  228.             this.min.Location = new Point(cPosition+1, 14);
  229.  
  230.             base.OnPaint(e);
  231.         }
  232.        
  233.         protected override void OnActivated(EventArgs e)
  234.         {
  235.             Dwm.DwmExtendFrameIntoClientArea(this.Handle, ref this.dwmMargins);
  236.             base.OnActivated(e);
  237.         }
  238.  
  239.         protected override void OnMouseDown(MouseEventArgs e)
  240.         {
  241.             if (e.Button == MouseButtons.Left)
  242.             {
  243.                 //ReleaseCapture();
  244.                 //SendMessage(Handle, WMNCLBUTTONDOWN, HTCAPTION, 0);
  245.                 if ((checked(this.Width - 6) <= e.Location.X || e.Location.X <= 6 || e.Location.Y <= 6 ? false : true))
  246.                 {
  247.                     this.MoveControl(this.Handle);
  248.                 }
  249.                 else if (this.WindowState != FormWindowState.Maximized)
  250.                 {
  251.                     this.ResizeForm(this.resizeDir);
  252.                 }
  253.             }
  254.             base.OnMouseDown(e);
  255.         }
  256.  
  257.         protected override void OnMouseMove(MouseEventArgs e)
  258.         {
  259.             Point location = e.Location;
  260.             Point point = e.Location;
  261.             if (!(location.X < 6 & point.Y < 6))
  262.             {
  263.                 point = e.Location;
  264.                 location = e.Location;
  265.                 if (point.X < 6 & location.Y > checked(this.Height - 6))
  266.                 {
  267.                     this.resizeDir = ResizeDirection.BottomLeft;
  268.                 }
  269.                 else if (e.Location.X > checked(this.Width - 6) & e.Location.Y > checked(this.Height - 6))
  270.                 {
  271.                     this.resizeDir = ResizeDirection.BottomRight;
  272.                 }
  273.                 else if (e.Location.X > checked(this.Width - 6) & e.Location.Y < 6)
  274.                 {
  275.                     this.resizeDir = ResizeDirection.TopRight;
  276.                 }
  277.                 else if (e.Location.X < 6)
  278.                 {
  279.                     this.resizeDir = ResizeDirection.Left;
  280.                 }
  281.                 else if (e.Location.X > checked(this.Width - 6))
  282.                 {
  283.                     this.resizeDir = ResizeDirection.Right;
  284.                 }
  285.                 else if (e.Location.Y < 6)
  286.                 {
  287.                     this.resizeDir = ResizeDirection.Top;
  288.                 }
  289.                 else if (e.Location.Y <= checked(this.Height - 6))
  290.                 {
  291.                     this.resizeDir = ResizeDirection.None;
  292.                 }
  293.                 else
  294.                 {
  295.                     this.resizeDir = ResizeDirection.Bottom;
  296.                 }
  297.             }
  298.             else
  299.             {
  300.                 this.resizeDir = ResizeDirection.TopLeft;
  301.             }
  302.             base.OnMouseMove(e);
  303.         }
  304.  
  305.         protected override void OnResize(EventArgs e)
  306.         {
  307.             Refresh();
  308.             base.OnResize(e);
  309.         }
  310.  
  311.         private void InitializeComponent()
  312.         {            
  313.             this.SuspendLayout();
  314.             //
  315.             // Win8Form
  316.             //
  317.             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(187)))), ((int)(((byte)(236)))));
  318.             this.ClientSize = new System.Drawing.Size(280, 285);
  319.             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  320.             this.Name = "Win8Form";
  321.             this.ResumeLayout(false);
  322.  
  323.         }
  324.  
  325.         //Methods
  326.         private void ControlMouseOver(object sender, EventArgs e)
  327.         {
  328.             Cursor = Cursors.Hand;
  329.         }
  330.  
  331.         private void ControlMouseLeave(object sender, EventArgs e)
  332.         {
  333.             Cursor = Cursors.Default;
  334.         }
  335.  
  336.         private void CloseClick(object sender, MouseEventArgs e)
  337.         {
  338.             base.Close();
  339.         }
  340.  
  341.         private void MaxClick(object sender, MouseEventArgs e)
  342.         {
  343.             if (WindowState == FormWindowState.Maximized)
  344.             {
  345.                 WindowState = FormWindowState.Normal;
  346.             }
  347.             else
  348.             {
  349.                 WindowState = FormWindowState.Maximized;
  350.                 //ShowWindow(Handle, 3);
  351.             }
  352.         }
  353.  
  354.         private void MinClick(object sender, MouseEventArgs e)
  355.         {
  356.             ShowWindow(Handle, 6);
  357.         }
  358.  
  359.         private IntPtr HitTestNCA(IntPtr hwnd, IntPtr wparam, IntPtr lparam)
  360.         {
  361.             IntPtr HitTestNCA;
  362.             IntPtr intPtr;
  363.             int HTCLIENT = 1;
  364.             int HTCAPTION = 2;
  365.             int HTMINBUTTON = 8;
  366.             int HTMAXBUTTON = 9;
  367.             int HTLEFT = 10;
  368.             int HTRIGHT = 11;
  369.             int HTTOP = 12;
  370.             int HTTOPLEFT = 13;
  371.             int HTTOPRIGHT = 14;
  372.             int HTBOTTOM = 15;
  373.             int HTBOTTOMLEFT = 16;
  374.             int HTBOTTOMRIGHT = 17;
  375.             Point p = new Point(LoWord((int)lparam), HiWord((int)lparam));
  376.             Rectangle rectangle = new Rectangle(0, 0, this.dwmMargins.cxLeftWidth, this.dwmMargins.cxLeftWidth);
  377.             if (!this.RectangleToScreen(rectangle).Contains(p))
  378.             {
  379.                 rectangle = new Rectangle(checked(this.Width - this.dwmMargins.cxRightWidth), 0, this.dwmMargins.cxRightWidth, this.dwmMargins.cxRightWidth);
  380.                 if (!this.RectangleToScreen(rectangle).Contains(p))
  381.                 {
  382.                     rectangle = new Rectangle(0, checked(this.Height - this.dwmMargins.cyBottomHeight), this.dwmMargins.cxLeftWidth, this.dwmMargins.cyBottomHeight);
  383.                     if (!this.RectangleToScreen(rectangle).Contains(p))
  384.                     {
  385.                         rectangle = new Rectangle(checked(this.Width - this.dwmMargins.cxRightWidth), checked(this.Height - this.dwmMargins.cyBottomHeight), this.dwmMargins.cxRightWidth, this.dwmMargins.cyBottomHeight);
  386.                         if (!this.RectangleToScreen(rectangle).Contains(p))
  387.                         {
  388.                             rectangle = new Rectangle(0, 0, this.Width, this.dwmMargins.cxLeftWidth);
  389.                             if (!this.RectangleToScreen(rectangle).Contains(p))
  390.                             {
  391.                                 rectangle = new Rectangle(0, this.dwmMargins.cxLeftWidth, this.Width, checked(this.dwmMargins.cyTopHeight - this.dwmMargins.cxLeftWidth));
  392.                                 if (!this.RectangleToScreen(rectangle).Contains(p))
  393.                                 {
  394.                                     rectangle = new Rectangle(0, 0, this.dwmMargins.cxLeftWidth, this.Height);
  395.                                     if (!this.RectangleToScreen(rectangle).Contains(p))
  396.                                     {
  397.                                         rectangle = new Rectangle(checked(this.Width - this.dwmMargins.cxRightWidth), 0, this.dwmMargins.cxRightWidth, this.Height);
  398.                                         if (!this.RectangleToScreen(rectangle).Contains(p))
  399.                                         {
  400.                                             rectangle = new Rectangle(0, checked(this.Height - this.dwmMargins.cyBottomHeight), this.Width, this.dwmMargins.cyBottomHeight);
  401.                                             if (!this.RectangleToScreen(rectangle).Contains(p))
  402.                                             {
  403.                                                 intPtr = new IntPtr(HTCLIENT);
  404.                                                 HitTestNCA = intPtr;
  405.                                             }
  406.                                             else
  407.                                             {
  408.                                                 intPtr = new IntPtr(HTBOTTOM);
  409.                                                 HitTestNCA = intPtr;
  410.                                             }
  411.                                         }
  412.                                         else
  413.                                         {
  414.                                             intPtr = new IntPtr(HTRIGHT);
  415.                                             HitTestNCA = intPtr;
  416.                                         }
  417.                                     }
  418.                                     else
  419.                                     {
  420.                                         intPtr = new IntPtr(HTLEFT);
  421.                                         HitTestNCA = intPtr;
  422.                                     }
  423.                                 }
  424.                                 else
  425.                                 {
  426.                                     intPtr = new IntPtr(HTCAPTION);
  427.                                     HitTestNCA = intPtr;
  428.                                 }
  429.                             }
  430.                             else
  431.                             {
  432.                                 intPtr = new IntPtr(HTTOP);
  433.                                 HitTestNCA = intPtr;
  434.                             }
  435.                         }
  436.                         else
  437.                         {
  438.                             intPtr = new IntPtr(HTBOTTOMRIGHT);
  439.                             HitTestNCA = intPtr;
  440.                         }
  441.                     }
  442.                     else
  443.                     {
  444.                         intPtr = new IntPtr(HTBOTTOMLEFT);
  445.                         HitTestNCA = intPtr;
  446.                     }
  447.                 }
  448.                 else
  449.                 {
  450.                     intPtr = new IntPtr(HTTOPRIGHT);
  451.                     HitTestNCA = intPtr;
  452.                 }
  453.             }
  454.             else
  455.             {
  456.                 intPtr = new IntPtr(HTTOPLEFT);
  457.                 HitTestNCA = intPtr;
  458.             }
  459.             return HitTestNCA;
  460.         }
  461.  
  462.         public static int HiWord(int dwValue)
  463.         {
  464.             return dwValue >> 16 & 65535;
  465.         }
  466.  
  467.         public static int LoWord(int dwValue)
  468.         {
  469.             return dwValue & 65535;
  470.         }
  471.  
  472.         private void ResizeForm(ResizeDirection direction)
  473.         {
  474.             int dir = -1;
  475.             ResizeDirection resizeDirection = direction;
  476.             if (resizeDirection == ResizeDirection.Left)
  477.             {
  478.                 dir = 10;
  479.             }
  480.             else if (resizeDirection == ResizeDirection.TopLeft)
  481.             {
  482.                 dir = 13;
  483.             }
  484.             else if (resizeDirection == ResizeDirection.Top)
  485.             {
  486.                 dir = 12;
  487.             }
  488.             else if (resizeDirection == ResizeDirection.TopRight)
  489.             {
  490.                 dir = 14;
  491.             }
  492.             else if (resizeDirection == ResizeDirection.Right)
  493.             {
  494.                 dir = 11;
  495.             }
  496.             else if (resizeDirection == ResizeDirection.BottomRight)
  497.             {
  498.                 dir = 17;
  499.             }
  500.             else if (resizeDirection == ResizeDirection.Bottom)
  501.             {
  502.                 dir = 15;
  503.             }
  504.             else if (resizeDirection == ResizeDirection.BottomLeft)
  505.             {
  506.                 dir = 16;
  507.             }
  508.             if (dir != -1)
  509.             {
  510.                 ReleaseCapture();
  511.                 SendMessage(this.Handle, 161, dir, 0);
  512.             }
  513.         }
  514.  
  515.         private void MoveControl(IntPtr hWnd)
  516.         {
  517.             ReleaseCapture();
  518.             SendMessage(hWnd, 161, 2, 0);
  519.         }
  520.  
  521.         private ResizeDirection resizeDir
  522.         {
  523.             get
  524.             {
  525.                 return this._resizeDir;
  526.             }
  527.             set
  528.             {
  529.                 this._resizeDir = value;
  530.                 ResizeDirection resizeDirection = value;
  531.                 if (resizeDirection == ResizeDirection.Left)
  532.                 {
  533.                     this.Cursor = Cursors.SizeWE;
  534.                 }
  535.                 else if (resizeDirection == ResizeDirection.Right)
  536.                 {
  537.                     this.Cursor = Cursors.SizeWE;
  538.                 }
  539.                 else if (resizeDirection == ResizeDirection.Top)
  540.                 {
  541.                     this.Cursor = Cursors.SizeNS;
  542.                 }
  543.                 else if (resizeDirection == ResizeDirection.Bottom)
  544.                 {
  545.                     this.Cursor = Cursors.SizeNS;
  546.                 }
  547.                 else if (resizeDirection == ResizeDirection.BottomLeft)
  548.                 {
  549.                     this.Cursor = Cursors.SizeNESW;
  550.                 }
  551.                 else if (resizeDirection == ResizeDirection.TopRight)
  552.                 {
  553.                     this.Cursor = Cursors.SizeNESW;
  554.                 }
  555.                 else if (resizeDirection == ResizeDirection.BottomRight)
  556.                 {
  557.                     this.Cursor = Cursors.SizeNWSE;
  558.                 }
  559.                 else if (resizeDirection != ResizeDirection.TopLeft)
  560.                 {
  561.                     this.Cursor = Cursors.Default;
  562.                 }
  563.                 else
  564.                 {
  565.                     this.Cursor = Cursors.SizeNWSE;
  566.                 }
  567.             }
  568.         }
  569.     }
  570.  
  571. #region "Useful API"
  572.    
  573.     //Credit http://www.codeproject.com/Articles/138661/Metro-UI-Zune-like-Interface-form
  574.  
  575.     public class Dwm
  576.     {
  577.         public const int DWM_BB_BLURREGION = 2;
  578.  
  579.         public const int DWM_BB_ENABLE = 1;
  580.  
  581.         public const int DWM_BB_TRANSITIONONMAXIMIZED = 4;
  582.  
  583.         public const string DWM_COMPOSED_EVENT_BASE_NAME = "DwmComposedEvent_";
  584.  
  585.         public const string DWM_COMPOSED_EVENT_NAME_FORMAT = "%s%d";
  586.  
  587.         public const int DWM_COMPOSED_EVENT_NAME_MAX_LENGTH = 64;
  588.  
  589.         public const int DWM_FRAME_DURATION_DEFAULT = -1;
  590.  
  591.         public const int DWM_TNP_OPACITY = 4;
  592.  
  593.         public const int DWM_TNP_RECTDESTINATION = 1;
  594.  
  595.         public const int DWM_TNP_RECTSOURCE = 2;
  596.  
  597.         public const int DWM_TNP_SOURCECLIENTAREAONLY = 16;
  598.  
  599.         public const int DWM_TNP_VISIBLE = 8;
  600.  
  601.         public readonly static bool DwmApiAvailable;
  602.  
  603.         public const int WM_DWMCOMPOSITIONCHANGED = 798;
  604.  
  605.         /// <summary>
  606.         /// Do Not Draw The Caption (Text)
  607.         /// </summary>
  608.         public static uint WTNCA_NODRAWCAPTION;
  609.  
  610.         public static uint WTNCA_NODRAWICON;
  611.  
  612.         /// <summary>
  613.         /// Do Not Show the System Menu
  614.         /// </summary>
  615.         public static uint WTNCA_NOSYSMENU;
  616.  
  617.         public static uint WTNCA_NOMIRRORHELP;
  618.  
  619.         static Dwm()
  620.         {
  621.             Dwm.DwmApiAvailable = Environment.OSVersion.Version.Major >= 6;
  622.             Dwm.WTNCA_NODRAWCAPTION = 1;
  623.             Dwm.WTNCA_NODRAWICON = 2;
  624.             Dwm.WTNCA_NOSYSMENU = 4;
  625.             Dwm.WTNCA_NOMIRRORHELP = 8;
  626.         }
  627.  
  628.         [DebuggerNonUserCode]
  629.         public Dwm()
  630.         {
  631.         }
  632.  
  633.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  634.         public static extern int DwmDefWindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref IntPtr result);
  635.  
  636.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  637.         public static extern int DwmEnableComposition(int fEnable);
  638.  
  639.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  640.         public static extern int DwmEnableMMCSS(int fEnableMMCSS);
  641.  
  642.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  643.         public static extern int DwmExtendFrameIntoClientArea(IntPtr hdc, ref Dwm.MARGINS marInset);
  644.  
  645.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  646.         public static extern int DwmGetColorizationColor(ref int pcrColorization, ref int pfOpaqueBlend);
  647.  
  648.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  649.         public static extern int DwmGetCompositionTimingInfo(IntPtr hwnd, ref Dwm.DWM_TIMING_INFO pTimingInfo);
  650.  
  651.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  652.         public static extern int DwmGetWindowAttribute(IntPtr hwnd, int dwAttribute, IntPtr pvAttribute, int cbAttribute);
  653.  
  654.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  655.         public static extern int DwmIsCompositionEnabled(ref int pfEnabled);
  656.  
  657.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  658.         public static extern int DwmModifyPreviousDxFrameDuration(IntPtr hwnd, int cRefreshes, int fRelative);
  659.  
  660.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  661.         public static extern int DwmQueryThumbnailSourceSize(IntPtr hThumbnail, ref Size pSize);
  662.  
  663.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  664.         public static extern int DwmRegisterThumbnail(IntPtr hwndDestination, IntPtr hwndSource, ref Size pMinimizedSize, ref IntPtr phThumbnailId);
  665.  
  666.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  667.         public static extern int DwmSetDxFrameDuration(IntPtr hwnd, int cRefreshes);
  668.  
  669.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  670.         public static extern int DwmSetPresentParameters(IntPtr hwnd, ref Dwm.DWM_PRESENT_PARAMETERS pPresentParams);
  671.  
  672.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  673.         public static extern int DwmSetWindowAttribute(IntPtr hwnd, int dwAttribute, IntPtr pvAttribute, int cbAttribute);
  674.  
  675.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  676.         public static extern int DwmUnregisterThumbnail(IntPtr hThumbnailId);
  677.  
  678.         [DllImport("dwmapi.dll", CharSet = CharSet.None, ExactSpelling = false)]
  679.         public static extern int DwmUpdateThumbnailProperties(IntPtr hThumbnailId, ref Dwm.DWM_THUMBNAIL_PROPERTIES ptnProperties);
  680.  
  681.         /// <summary>
  682.         /// Set The Window's Theme Attributes
  683.         /// </summary>
  684.         /// <param name="hWnd">The Handle to the Window</param>
  685.         /// <param name="wtype">What Type of Attributes</param>
  686.         /// <param name="attributes">The Attributes to Add/Remove</param>
  687.         /// <param name="size">The Size of the Attributes Struct</param>
  688.         /// <returns>If The Call Was Successful or Not</returns>
  689.         [DllImport("UxTheme.dll", CharSet = CharSet.None, ExactSpelling = false)]
  690.         public static extern int SetWindowThemeAttribute(IntPtr hWnd, Dwm.WindowThemeAttributeType wtype, ref Dwm.WTA_OPTIONS attributes, uint size);
  691.  
  692.         public struct DWM_BLURBEHIND
  693.         {
  694.             public int dwFlags;
  695.  
  696.             public int fEnable;
  697.  
  698.             public IntPtr hRgnBlur;
  699.  
  700.             public int fTransitionOnMaximized;
  701.         }
  702.  
  703.         public struct DWM_PRESENT_PARAMETERS
  704.         {
  705.             public int cbSize;
  706.  
  707.             public int fQueue;
  708.  
  709.             public long cRefreshStart;
  710.  
  711.             public int cBuffer;
  712.  
  713.             public int fUseSourceRate;
  714.  
  715.             public Dwm.UNSIGNED_RATIO rateSource;
  716.  
  717.             public int cRefreshesPerFrame;
  718.  
  719.             public Dwm.DWM_SOURCE_FRAME_SAMPLING eSampling;
  720.         }
  721.  
  722.         public enum DWM_SOURCE_FRAME_SAMPLING
  723.         {
  724.             DWM_SOURCE_FRAME_SAMPLING_POINT,
  725.             DWM_SOURCE_FRAME_SAMPLING_COVERAGE,
  726.             DWM_SOURCE_FRAME_SAMPLING_LAST
  727.         }
  728.  
  729.         public struct DWM_THUMBNAIL_PROPERTIES
  730.         {
  731.             public int dwFlags;
  732.  
  733.             public Dwm.RECT rcDestination;
  734.  
  735.             public Dwm.RECT rcSource;
  736.  
  737.             public byte opacity;
  738.  
  739.             public int fVisible;
  740.  
  741.             public int fSourceClientAreaOnly;
  742.         }
  743.  
  744.         public struct DWM_TIMING_INFO
  745.         {
  746.             public int cbSize;
  747.  
  748.             public Dwm.UNSIGNED_RATIO rateRefresh;
  749.  
  750.             public Dwm.UNSIGNED_RATIO rateCompose;
  751.  
  752.             public long qpcVBlank;
  753.  
  754.             public long cRefresh;
  755.  
  756.             public long qpcCompose;
  757.  
  758.             public long cFrame;
  759.  
  760.             public long cRefreshFrame;
  761.  
  762.             public long cRefreshConfirmed;
  763.  
  764.             public int cFlipsOutstanding;
  765.  
  766.             public long cFrameCurrent;
  767.  
  768.             public long cFramesAvailable;
  769.  
  770.             public long cFrameCleared;
  771.  
  772.             public long cFramesReceived;
  773.  
  774.             public long cFramesDisplayed;
  775.  
  776.             public long cFramesDropped;
  777.  
  778.             public long cFramesMissed;
  779.         }
  780.  
  781.         public enum DWMNCRENDERINGPOLICY
  782.         {
  783.             DWMNCRP_USEWINDOWSTYLE,
  784.             DWMNCRP_DISABLED,
  785.             DWMNCRP_ENABLED
  786.         }
  787.  
  788.         public enum DWMWINDOWATTRIBUTE
  789.         {
  790.             DWMWA_NCRENDERING_ENABLED = 1,
  791.             DWMWA_NCRENDERING_POLICY = 2,
  792.             DWMWA_TRANSITIONS_FORCEDISABLED = 3,
  793.             DWMWA_ALLOW_NCPAINT = 4,
  794.             DWMWA_CAPTION_BUTTON_BOUNDS = 5,
  795.             DWMWA_NONCLIENT_RTL_LAYOUT = 6,
  796.             DWMWA_FORCE_ICONIC_REPRESENTATION = 7,
  797.             DWMWA_FLIP3D_POLICY = 8,
  798.             DWMWA_LAST = 9
  799.         }
  800.  
  801.         public struct MARGINS
  802.         {
  803.             public int cxLeftWidth;
  804.  
  805.             public int cxRightWidth;
  806.  
  807.             public int cyTopHeight;
  808.  
  809.             public int cyBottomHeight;
  810.  
  811.             public MARGINS(int Left, int Right, int Top, int Bottom)
  812.             {
  813.                 this = new Dwm.MARGINS()
  814.                 {
  815.                     cxLeftWidth = Left,
  816.                     cxRightWidth = Right,
  817.                     cyTopHeight = Top,
  818.                     cyBottomHeight = Bottom
  819.                 };
  820.             }
  821.         }
  822.  
  823.         [StructLayout(LayoutKind.Explicit)]
  824.         public struct RECT
  825.         {
  826.             [FieldOffset(12)]
  827.             public int bottom;
  828.  
  829.             [FieldOffset(0)]
  830.             public int left;
  831.  
  832.             [FieldOffset(8)]
  833.             public int right;
  834.  
  835.             [FieldOffset(4)]
  836.             public int top;
  837.  
  838.             public int Height
  839.             {
  840.                 get
  841.                 {
  842.                     return checked(this.bottom - this.top);
  843.                 }
  844.             }
  845.  
  846.             public Size Size
  847.             {
  848.                 get
  849.                 {
  850.                     return new System.Drawing.Size(this.Width, this.Height);
  851.                 }
  852.             }
  853.  
  854.             public int Width
  855.             {
  856.                 get
  857.                 {
  858.                     return checked(this.right - this.left);
  859.                 }
  860.             }
  861.  
  862.             public RECT(Rectangle rect)
  863.             {
  864.                 this = new Dwm.RECT()
  865.                 {
  866.                     left = rect.Left,
  867.                     top = rect.Top,
  868.                     right = rect.Right,
  869.                     bottom = rect.Bottom
  870.                 };
  871.             }
  872.  
  873.             public RECT(int left, int top, int right, int bottom)
  874.             {
  875.                 this = new Dwm.RECT()
  876.                 {
  877.                     left = left,
  878.                     top = top,
  879.                     right = right,
  880.                     bottom = bottom
  881.                 };
  882.             }
  883.  
  884.             private static T InlineAssignHelper<T>(ref T target, T value)
  885.             {
  886.                 target = value;
  887.                 return value;
  888.             }
  889.  
  890.             public void Set()
  891.             {
  892.                 this.left = Dwm.RECT.InlineAssignHelper<int>(ref this.top, Dwm.RECT.InlineAssignHelper<int>(ref this.right, Dwm.RECT.InlineAssignHelper<int>(ref this.bottom, 0)));
  893.             }
  894.  
  895.             public void Set(Rectangle rect)
  896.             {
  897.                 this.left = rect.Left;
  898.                 this.top = rect.Top;
  899.                 this.right = rect.Right;
  900.                 this.bottom = rect.Bottom;
  901.             }
  902.  
  903.             public void Set(int left, int top, int right, int bottom)
  904.             {
  905.                 this.left = left;
  906.                 this.top = top;
  907.                 this.right = right;
  908.                 this.bottom = bottom;
  909.             }
  910.  
  911.             public Rectangle ToRectangle()
  912.             {
  913.                 Rectangle rectangle = new Rectangle(this.left, this.top, checked(this.right - this.left), checked(this.bottom - this.top));
  914.                 return rectangle;
  915.             }
  916.         }
  917.  
  918.         public struct UNSIGNED_RATIO
  919.         {
  920.             public int uiNumerator;
  921.  
  922.             public int uiDenominator;
  923.         }
  924.  
  925.         public enum WindowThemeAttributeType
  926.         {
  927.             WTA_NONCLIENT = 1
  928.         }
  929.  
  930.         /// <summary>
  931.         /// The Options of What Attributes to Add/Remove
  932.         /// </summary>
  933.         public struct WTA_OPTIONS
  934.         {
  935.             public uint Flags;
  936.  
  937.             public uint Mask;
  938.         }
  939.     }
  940.    
  941.     public class WinApi
  942.     {
  943.         [DebuggerNonUserCode]
  944.         public WinApi()
  945.         {
  946.         }
  947.  
  948.         public struct NCCALCSIZE_PARAMS
  949.         {
  950.             public WinApi.RECT rect0;
  951.  
  952.             public WinApi.RECT rect1;
  953.  
  954.             public WinApi.RECT rect2;
  955.  
  956.             public IntPtr lppos;
  957.         }
  958.  
  959.         public struct RECT
  960.         {
  961.             public int Left;
  962.  
  963.             public int Top;
  964.  
  965.             public int Right;
  966.  
  967.             public int Bottom;
  968.         }
  969.  
  970.         public enum Win32Messages : uint
  971.         {
  972.             WM_NULL = 0,
  973.             WM_CREATE = 1,
  974.             WM_DESTROY = 2,
  975.             WM_MOVE = 3,
  976.             WM_SIZE = 5,
  977.             WM_ACTIVATE = 6,
  978.             WM_SETFOCUS = 7,
  979.             WM_KILLFOCUS = 8,
  980.             WM_ENABLE = 10,
  981.             WM_SETREDRAW = 11,
  982.             WM_SETTEXT = 12,
  983.             WM_GETTEXT = 13,
  984.             WM_GETTEXTLENGTH = 14,
  985.             WM_PAINT = 15,
  986.             WM_CLOSE = 16,
  987.             WM_QUERYENDSESSION = 17,
  988.             WM_QUIT = 18,
  989.             WM_QUERYOPEN = 19,
  990.             WM_ERASEBKGND = 20,
  991.             WM_SYSCOLORCHANGE = 21,
  992.             WM_ENDSESSION = 22,
  993.             WM_SHOWWINDOW = 24,
  994.             WM_CTLCOLOR = 25,
  995.             WM_SETTINGCHANGE = 26,
  996.             WM_WININICHANGE = 26,
  997.             WM_DEVMODECHANGE = 27,
  998.             WM_ACTIVATEAPP = 28,
  999.             WM_FONTCHANGE = 29,
  1000.             WM_TIMECHANGE = 30,
  1001.             WM_CANCELMODE = 31,
  1002.             WM_SETCURSOR = 32,
  1003.             WM_MOUSEACTIVATE = 33,
  1004.             WM_CHILDACTIVATE = 34,
  1005.             WM_QUEUESYNC = 35,
  1006.             WM_GETMINMAXINFO = 36,
  1007.             WM_PAINTICON = 38,
  1008.             WM_ICONERASEBKGND = 39,
  1009.             WM_NEXTDLGCTL = 40,
  1010.             WM_SPOOLERSTATUS = 42,
  1011.             WM_DRAWITEM = 43,
  1012.             WM_MEASUREITEM = 44,
  1013.             WM_DELETEITEM = 45,
  1014.             WM_VKEYTOITEM = 46,
  1015.             WM_CHARTOITEM = 47,
  1016.             WM_SETFONT = 48,
  1017.             WM_GETFONT = 49,
  1018.             WM_SETHOTKEY = 50,
  1019.             WM_GETHOTKEY = 51,
  1020.             WM_QUERYDRAGICON = 55,
  1021.             WM_COMPAREITEM = 57,
  1022.             WM_GETOBJECT = 61,
  1023.             WM_COMPACTING = 65,
  1024.             WM_COMMNOTIFY = 68,
  1025.             WM_WINDOWPOSCHANGING = 70,
  1026.             WM_WINDOWPOSCHANGED = 71,
  1027.             WM_POWER = 72,
  1028.             WM_COPYDATA = 74,
  1029.             WM_CANCELJOURNAL = 75,
  1030.             WM_NOTIFY = 78,
  1031.             WM_INPUTLANGCHANGEREQUEST = 80,
  1032.             WM_INPUTLANGCHANGE = 81,
  1033.             WM_TCARD = 82,
  1034.             WM_HELP = 83,
  1035.             WM_USERCHANGED = 84,
  1036.             WM_NOTIFYFORMAT = 85,
  1037.             WM_CONTEXTMENU = 123,
  1038.             WM_STYLECHANGING = 124,
  1039.             WM_STYLECHANGED = 125,
  1040.             WM_DISPLAYCHANGE = 126,
  1041.             WM_GETICON = 127,
  1042.             WM_SETICON = 128,
  1043.             WM_NCCREATE = 129,
  1044.             WM_NCDESTROY = 130,
  1045.             WM_NCCALCSIZE = 131,
  1046.             WM_NCHITTEST = 132,
  1047.             WM_NCPAINT = 133,
  1048.             WM_NCACTIVATE = 134,
  1049.             WM_GETDLGCODE = 135,
  1050.             WM_SYNCPAINT = 136,
  1051.             WM_NCMOUSEMOVE = 160,
  1052.             WM_NCLBUTTONDOWN = 161,
  1053.             WM_NCLBUTTONUP = 162,
  1054.             WM_NCLBUTTONDBLCLK = 163,
  1055.             WM_NCRBUTTONDOWN = 164,
  1056.             WM_NCRBUTTONUP = 165,
  1057.             WM_NCRBUTTONDBLCLK = 166,
  1058.             WM_NCMBUTTONDOWN = 167,
  1059.             WM_NCMBUTTONUP = 168,
  1060.             WM_NCMBUTTONDBLCLK = 169,
  1061.             WM_NCXBUTTONDOWN = 171,
  1062.             WM_NCXBUTTONUP = 172,
  1063.             WM_NCXBUTTONDBLCLK = 173,
  1064.             WM_INPUT = 255,
  1065.             WM_KEYDOWN = 256,
  1066.             WM_KEYFIRST = 256,
  1067.             WM_KEYUP = 257,
  1068.             WM_CHAR = 258,
  1069.             WM_DEADCHAR = 259,
  1070.             WM_SYSKEYDOWN = 260,
  1071.             WM_SYSKEYUP = 261,
  1072.             WM_SYSCHAR = 262,
  1073.             WM_SYSDEADCHAR = 263,
  1074.             WM_KEYLAST = 264,
  1075.             WM_UNICHAR = 265,
  1076.             WM_IME_STARTCOMPOSITION = 269,
  1077.             WM_IME_ENDCOMPOSITION = 270,
  1078.             WM_IME_COMPOSITION = 271,
  1079.             WM_IME_KEYLAST = 271,
  1080.             WM_INITDIALOG = 272,
  1081.             WM_COMMAND = 273,
  1082.             WM_SYSCOMMAND = 274,
  1083.             WM_TIMER = 275,
  1084.             WM_HSCROLL = 276,
  1085.             WM_VSCROLL = 277,
  1086.             WM_INITMENU = 278,
  1087.             WM_INITMENUPOPUP = 279,
  1088.             WM_MENUSELECT = 287,
  1089.             WM_MENUCHAR = 288,
  1090.             WM_ENTERIDLE = 289,
  1091.             WM_MENURBUTTONUP = 290,
  1092.             WM_MENUDRAG = 291,
  1093.             WM_MENUGETOBJECT = 292,
  1094.             WM_UNINITMENUPOPUP = 293,
  1095.             WM_MENUCOMMAND = 294,
  1096.             WM_CHANGEUISTATE = 295,
  1097.             WM_UPDATEUISTATE = 296,
  1098.             WM_QUERYUISTATE = 297,
  1099.             WM_CTLCOLORMSGBOX = 306,
  1100.             WM_CTLCOLOREDIT = 307,
  1101.             WM_CTLCOLORLISTBOX = 308,
  1102.             WM_CTLCOLORBTN = 309,
  1103.             WM_CTLCOLORDLG = 310,
  1104.             WM_CTLCOLORSCROLLBAR = 311,
  1105.             WM_CTLCOLORSTATIC = 312,
  1106.             WM_MOUSEFIRST = 512,
  1107.             WM_MOUSEMOVE = 512,
  1108.             WM_LBUTTONDOWN = 513,
  1109.             WM_LBUTTONUP = 514,
  1110.             WM_LBUTTONDBLCLK = 515,
  1111.             WM_RBUTTONDOWN = 516,
  1112.             WM_RBUTTONUP = 517,
  1113.             WM_RBUTTONDBLCLK = 518,
  1114.             WM_MBUTTONDOWN = 519,
  1115.             WM_MBUTTONUP = 520,
  1116.             WM_MBUTTONDBLCLK = 521,
  1117.             WM_MOUSEWHEEL = 522,
  1118.             WM_XBUTTONDOWN = 523,
  1119.             WM_XBUTTONUP = 524,
  1120.             WM_MOUSELAST = 525,
  1121.             WM_XBUTTONDBLCLK = 525,
  1122.             WM_PARENTNOTIFY = 528,
  1123.             WM_ENTERMENULOOP = 529,
  1124.             WM_EXITMENULOOP = 530,
  1125.             WM_NEXTMENU = 531,
  1126.             WM_SIZING = 532,
  1127.             WM_CAPTURECHANGED = 533,
  1128.             WM_MOVING = 534,
  1129.             WM_POWERBROADCAST = 536,
  1130.             WM_DEVICECHANGE = 537,
  1131.             WM_MDICREATE = 544,
  1132.             WM_MDIDESTROY = 545,
  1133.             WM_MDIACTIVATE = 546,
  1134.             WM_MDIRESTORE = 547,
  1135.             WM_MDINEXT = 548,
  1136.             WM_MDIMAXIMIZE = 549,
  1137.             WM_MDITILE = 550,
  1138.             WM_MDICASCADE = 551,
  1139.             WM_MDIICONARRANGE = 552,
  1140.             WM_MDIGETACTIVE = 553,
  1141.             WM_MDISETMENU = 560,
  1142.             WM_ENTERSIZEMOVE = 561,
  1143.             WM_EXITSIZEMOVE = 562,
  1144.             WM_DROPFILES = 563,
  1145.             WM_MDIREFRESHMENU = 564,
  1146.             WM_IME_SETCONTEXT = 641,
  1147.             WM_IME_NOTIFY = 642,
  1148.             WM_IME_CONTROL = 643,
  1149.             WM_IME_COMPOSITIONFULL = 644,
  1150.             WM_IME_SELECT = 645,
  1151.             WM_IME_CHAR = 646,
  1152.             WM_IME_REQUEST = 648,
  1153.             WM_IME_KEYDOWN = 656,
  1154.             WM_IME_KEYUP = 657,
  1155.             WM_MOUSEHOVER = 673,
  1156.             WM_NCMOUSELEAVE = 674,
  1157.             WM_MOUSELEAVE = 675,
  1158.             WM_WTSSESSION_CHANGE = 689,
  1159.             WM_TABLET_FIRST = 704,
  1160.             WM_TABLET_LAST = 735,
  1161.             WM_CUT = 768,
  1162.             WM_COPY = 769,
  1163.             WM_PASTE = 770,
  1164.             WM_CLEAR = 771,
  1165.             WM_UNDO = 772,
  1166.             WM_RENDERFORMAT = 773,
  1167.             WM_RENDERALLFORMATS = 774,
  1168.             WM_DESTROYCLIPBOARD = 775,
  1169.             WM_DRAWCLIPBOARD = 776,
  1170.             WM_PAINTCLIPBOARD = 777,
  1171.             WM_VSCROLLCLIPBOARD = 778,
  1172.             WM_SIZECLIPBOARD = 779,
  1173.             WM_ASKCBFORMATNAME = 780,
  1174.             WM_CHANGECBCHAIN = 781,
  1175.             WM_HSCROLLCLIPBOARD = 782,
  1176.             WM_QUERYNEWPALETTE = 783,
  1177.             WM_PALETTEISCHANGING = 784,
  1178.             WM_PALETTECHANGED = 785,
  1179.             WM_HOTKEY = 786,
  1180.             WM_PRINT = 791,
  1181.             WM_PRINTCLIENT = 792,
  1182.             WM_APPCOMMAND = 793,
  1183.             WM_THEMECHANGED = 794,
  1184.             WM_HANDHELDFIRST = 856,
  1185.             WM_HANDHELDLAST = 863,
  1186.             WM_AFXFIRST = 864,
  1187.             WM_AFXLAST = 895,
  1188.             WM_PENWINFIRST = 896,
  1189.             WM_PENWINLAST = 911,
  1190.             WM_USER = 1024,
  1191.             WM_REFLECT = 8192,
  1192.             WM_APP = 32768
  1193.         }
  1194.    
  1195.     }
  1196.  
  1197. #endregion
  1198.  
  1199. }
Advertisement
Add Comment
Please, Sign In to add comment