| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Runtime.InteropServices;
- /// <summary>
- /// Wind32API
- /// </summary>
- internal class Win32
- {
- [StructLayout(LayoutKind.Sequential)]
- public struct Size
- {
- public Int32 cx;
- public Int32 cy;
- public Size(Int32 x, Int32 y)
- {
- cx = x;
- cy = y;
- }
- }
- [StructLayout(LayoutKind.Sequential, Pack = 1)]
- public struct BLENDFUNCTION
- {
- public byte BlendOp;
- public byte BlendFlags;
- public byte SourceConstantAlpha;
- public byte AlphaFormat;
- }
- [StructLayout(LayoutKind.Sequential)]
- public struct Point
- {
- public Int32 x;
- public Int32 y;
- public Point(Int32 x, Int32 y)
- {
- this.x = x;
- this.y = y;
- }
- }
- public const byte AC_SRC_OVER = 0;
- public const Int32 ULW_ALPHA = 2;
- public const byte AC_SRC_ALPHA = 1;
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
- [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr GetDC(IntPtr hWnd);
- [DllImport("gdi32.dll", ExactSpelling = true)]
- public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj);
- [DllImport("user32.dll", ExactSpelling = true)]
- public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int DeleteDC(IntPtr hDC);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int DeleteObject(IntPtr hObj);
- [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pptSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr ExtCreateRegion(IntPtr lpXform, uint nCount, IntPtr rgnData);
- }
|