32 lines
884 B
C#
32 lines
884 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace JD.Application.Utils
|
|
{
|
|
|
|
/// <summary>
|
|
/// Utils for User32 calls.
|
|
/// </summary>
|
|
public static class User32
|
|
{
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool GetCursorPos(out Point lpPoint);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern bool GetWindowRect(IntPtr hWnd, out Rectangle lpRect);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr WindowFromPoint(Point point);
|
|
|
|
}
|
|
|
|
}
|