56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Ramitta.Utils
|
|
{
|
|
public class Win32
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct POINT
|
|
{
|
|
public int X;
|
|
public int Y;
|
|
|
|
public POINT(int x, int y)
|
|
{
|
|
X = x;
|
|
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 int WS_EX_LAYERED = 0x00080000;
|
|
public static int 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 int GetWindowLong(nint hWnd, int nIndex);
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|
public static extern int SetWindowLong(nint hWnd, int nIndex, int newVal);
|
|
|
|
[DllImport("gdi32")]
|
|
public static extern int DeleteObject(nint obj);
|
|
}
|
|
}
|