using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace TD.SandDock
{
	internal class i : Form
	{
		private class a
		{
			public struct c
			{
				public int a;

				public int b;

				public c(int A_0, int A_1)
				{
					a = A_0;
					b = A_1;
				}
			}

			public struct a
			{
				public int a;

				public int b;

				public a(int A_0, int A_1)
				{
					a = A_0;
					b = A_1;
				}
			}

			[StructLayout(LayoutKind.Sequential, Pack = 1)]
			public struct b
			{
				public byte a;

				public byte b;

				public byte c;

				public byte d;
			}

			public const int a = 1;

			public const int b = 2;

			public const int c = 4;

			public const byte d = 0;

			public const byte e = 1;

			[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
			public static extern bool UpdateLayeredWindow(IntPtr A_0, IntPtr A_1, ref c A_2, ref a A_3, IntPtr A_4, ref c A_5, int A_6, ref b A_7, int A_8);

			[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
			public static extern IntPtr GetDC(IntPtr A_0);

			[DllImport("user32.dll", ExactSpelling = true)]
			public static extern int ReleaseDC(IntPtr A_0, IntPtr A_1);

			[DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
			public static extern IntPtr CreateCompatibleDC(IntPtr A_0);

			[DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
			public static extern bool DeleteDC(IntPtr A_0);

			[DllImport("gdi32.dll", ExactSpelling = true)]
			public static extern IntPtr SelectObject(IntPtr A_0, IntPtr A_1);

			[DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
			public static extern bool DeleteObject(IntPtr A_0);
		}

		public i()
		{
			base.FormBorderStyle = FormBorderStyle.None;
		}

		public void a(Bitmap A_0, byte A_1)
		{
			IntPtr dC = i.a.GetDC(IntPtr.Zero);
			IntPtr intPtr = i.a.CreateCompatibleDC(dC);
			IntPtr intPtr2 = IntPtr.Zero;
			IntPtr a_ = IntPtr.Zero;
			try
			{
				intPtr2 = A_0.GetHbitmap(Color.FromArgb(0));
				a_ = i.a.SelectObject(intPtr, intPtr2);
				a.a A_2 = new a.a(A_0.Width, A_0.Height);
				a.c A_3 = new a.c(0, 0);
				a.c A_4 = new a.c(base.Left, base.Top);
				a.b A_5 = default(a.b);
				A_5.a = 0;
				A_5.b = 0;
				A_5.c = A_1;
				A_5.d = 1;
				i.a.UpdateLayeredWindow(base.Handle, dC, ref A_4, ref A_2, intPtr, ref A_3, 0, ref A_5, 2);
			}
			finally
			{
				if (intPtr2 != IntPtr.Zero)
				{
					i.a.SelectObject(intPtr, a_);
					i.a.DeleteObject(intPtr2);
				}
				i.a.ReleaseDC(IntPtr.Zero, dC);
				i.a.DeleteDC(intPtr);
			}
		}

		[SpecialName]
		protected override CreateParams k()
		{
			CreateParams createParams = base.CreateParams;
			createParams.ExStyle |= 524288;
			return createParams;
		}
	}
}
