forked from michaelmob/Hyperdesktop2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNativeMethods.cs
More file actions
35 lines (27 loc) · 1.26 KB
/
Copy pathNativeMethods.cs
File metadata and controls
35 lines (27 loc) · 1.26 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
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Shikashi
{
[StructLayout(LayoutKind.Sequential)]
struct POINTAPI { public int x; public int y; }
[StructLayout(LayoutKind.Sequential)]
struct CURSORINFO { public int cbSize; public int flags; public IntPtr hCursor; public POINTAPI ptScreenPos; }
class NativeMethods
{
// Registers a hot key with Windows.
[DllImport("user32.dll")]
internal static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
// Unregisters the hot key with Windows.
[DllImport("user32.dll")]
internal static extern bool UnregisterHotKey(IntPtr hWnd, int id);
[DllImport("user32.dll")]
internal static extern bool GetCursorInfo(out CURSORINFO pci);
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool DrawIconEx(IntPtr hdc, int xLeft, int yTop, IntPtr hIcon, int cxWidth, int cyHeight, int istepIfAniCur, IntPtr hbrFlickerFreeDraw, int diFlags);
[DllImport("user32.dll")]
internal static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
internal static extern bool GetWindowRect(IntPtr hwnd, ref Rectangle rectangle);
}
}