1 | using System;
|
---|
2 | using System.Drawing;
|
---|
3 | using System.Runtime.InteropServices;
|
---|
4 | using System.Diagnostics.CodeAnalysis;
|
---|
5 | using WeifenLuo.WinFormsUI.Docking.Win32;
|
---|
6 |
|
---|
7 | namespace WeifenLuo.WinFormsUI.Docking
|
---|
8 | {
|
---|
9 | internal static class NativeMethods
|
---|
10 | {
|
---|
11 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
12 | [return: MarshalAs(UnmanagedType.Bool)]
|
---|
13 | public static extern bool DragDetect(IntPtr hWnd, Point pt);
|
---|
14 |
|
---|
15 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
16 | public static extern IntPtr GetFocus();
|
---|
17 |
|
---|
18 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
19 | public static extern IntPtr SetFocus(IntPtr hWnd);
|
---|
20 |
|
---|
21 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
22 | [return: MarshalAs(UnmanagedType.Bool)]
|
---|
23 | public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
|
---|
24 |
|
---|
25 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
26 | public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
|
---|
27 |
|
---|
28 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
29 | public static extern int ShowWindow(IntPtr hWnd, short cmdShow);
|
---|
30 |
|
---|
31 | [DllImport("User32.dll", CharSet=CharSet.Auto)]
|
---|
32 | public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags);
|
---|
33 |
|
---|
34 | [DllImport("user32.dll", CharSet = CharSet.Auto)]
|
---|
35 | public static extern int GetWindowLong(IntPtr hWnd, int Index);
|
---|
36 |
|
---|
37 | [DllImport("user32.dll", CharSet = CharSet.Auto)]
|
---|
38 | public static extern int SetWindowLong(IntPtr hWnd, int Index, int Value);
|
---|
39 |
|
---|
40 | [DllImport("user32.dll", CharSet=CharSet.Auto)]
|
---|
41 | public static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow);
|
---|
42 |
|
---|
43 | [DllImport("user32.dll", CharSet=CharSet.Auto)]
|
---|
44 | //*********************************
|
---|
45 | // FxCop bug, suppress the message
|
---|
46 | //*********************************
|
---|
47 | [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "0")]
|
---|
48 | public static extern IntPtr WindowFromPoint(Point point);
|
---|
49 |
|
---|
50 | [DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
|
---|
51 | public static extern int GetCurrentThreadId();
|
---|
52 |
|
---|
53 | public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
|
---|
54 |
|
---|
55 | [DllImport("user32.dll")]
|
---|
56 | public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID);
|
---|
57 |
|
---|
58 | [DllImport("user32.dll")]
|
---|
59 | public static extern int UnhookWindowsHookEx(IntPtr hhook);
|
---|
60 |
|
---|
61 | [DllImport("user32.dll")]
|
---|
62 | public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wParam, IntPtr lParam);
|
---|
63 | }
|
---|
64 | } |
---|