1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace CyberX8_Themes.CustomControls
- {
- public class Win32
- {
- [StructLayout(LayoutKind.Sequential)]
- public struct POINT
- {
- public int X;
- public int Y;
- public POINT(int x, int y)
- {
- this.X = x;
- this.Y = y;
- }
- }
- /// <summary>
- /// 带有外边框和标题的windows的样式
- /// </summary>
- public const long WS_CAPTION = 0X00C0000L;
- /// <summary>
- /// window的基本样式
- /// </summary>
- public static int GWL_STYLE = -16;
- /// <summary>
- /// window的扩展样式
- /// </summary>
- public static int GWL_EXSTYLE = -20;
- public static Int32 WS_EX_LAYERED = 0x00080000;
- public static Int32 WS_EX_TRANSPARENT = 0x00000020;
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern bool GetCursorPos(out POINT pt);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern Int32 GetWindowLong(IntPtr hWnd, Int32 nIndex);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern Int32 SetWindowLong(IntPtr hWnd, Int32 nIndex, int newVal);
- [DllImport("gdi32")]
- public static extern int DeleteObject(IntPtr obj);
- }
- }
|