forked from PavelTorgashov/FastColoredTextBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeMethods.cs
More file actions
62 lines (49 loc) · 1.86 KB
/
Copy pathNativeMethods.cs
File metadata and controls
62 lines (49 loc) · 1.86 KB
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.Text;
using System.Runtime.InteropServices;
namespace FastColoredTextBoxNS
{
internal class NativeMethods
{
//[DllImport("user32.dll")]
//internal static extern IntPtr GetOpenClipboardWindow(); // unused ?
[DllImport("user32.dll")]
protected static extern bool CloseClipboard(); // corrected intptr -> bool
[DllImport("Imm32.dll")]
protected static extern IntPtr ImmGetContext(IntPtr hWnd);
[DllImport("Imm32.dll")]
protected static extern IntPtr ImmAssociateContext(IntPtr hWnd, IntPtr hIMC);
[DllImport("User32.dll")]
protected static extern bool CreateCaret(IntPtr hWnd, int hBitmap, int nWidth, int nHeight);
[DllImport("User32.dll")]
protected static extern bool SetCaretPos(int x, int y);
//[DllImport("User32.dll")]
//internal static extern bool DestroyCaret(); // unused ?
[DllImport("User32.dll")]
protected static extern bool ShowCaret(IntPtr hWnd);
[DllImport("User32.dll")]
protected static extern bool HideCaret(IntPtr hWnd);
[DllImport("User32.dll")]
protected static extern IntPtr SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); // change corrent
[DllImport("kernel32.dll")]
protected static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);
[DllImport("kernel32.dll")]
protected static extern void GetSystemInfo(ref SYSTEM_INFO lpSystemInfo);
[StructLayout(LayoutKind.Sequential)]
internal struct SYSTEM_INFO
{
public ushort wProcessorArchitecture;
public ushort wReserved;
public uint dwPageSize;
public IntPtr lpMinimumApplicationAddress;
public IntPtr lpMaximumApplicationAddress;
public UIntPtr dwActiveProcessorMask;
public uint dwNumberOfProcessors;
public uint dwProcessorType;
public uint dwAllocationGranularity;
public ushort wProcessorLevel;
public ushort wProcessorRevision;
};
}
}