blob: 3249fceede0ade484c7be74c1a20e46baa723088 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace Crow
{
public static class Win32
{
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hWnd);
#region mouse winApi
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct Point
{
/// LONG->int
public int x;
/// LONG->int
public int y;
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct HICON__
{
/// int
public int unused;
}
#if _WIN32 || _WIN64
/// Return Type: HCURSOR->HICON->HICON__*
///hCursor: HCURSOR->HICON->HICON__*
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor")]
public static extern System.IntPtr SetCursor([System.Runtime.InteropServices.InAttribute()] System.IntPtr hCursor);
#elif __linux__
public static System.IntPtr SetCursor(System.IntPtr hCursor)
{
return (IntPtr)0;
}
#endif
/// Return Type: BOOL->int
///lpPoint: LPPOINT->tagPOINT*
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetCursorPos")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
public static extern bool GetCursorPos([System.Runtime.InteropServices.OutAttribute()] out Point lpPoint);
/// Return Type: BOOL->int
///X: int
///Y: int
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
public static extern bool SetCursorPos(int X, int Y);
#endregion
}
}
|