45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace HL_FristAidPlatform_Public
|
|
{
|
|
public static class WindowNavigate
|
|
{
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
|
public static extern IntPtr GetWindowDC(IntPtr hwnd);
|
|
|
|
[DllImport("User32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
|
public static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
|
|
|
|
[DllImport("User32.dll", EntryPoint = "SendMessage")]
|
|
public static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
|
|
|
|
/// <summary>
|
|
/// 禁止获取焦点
|
|
/// </summary>
|
|
/// <param name="hWnd"></param>
|
|
/// <returns></returns>
|
|
[DllImport("user32", EntryPoint = "HideCaret")]
|
|
public static extern bool HideCaret(IntPtr hWnd);
|
|
|
|
public static int HIWORD(int n)
|
|
{
|
|
return (n >> 16) & 0xffff;
|
|
}
|
|
|
|
public static int HIWORD(IntPtr n)
|
|
{
|
|
return HIWORD(unchecked((int)(long)n));
|
|
}
|
|
|
|
public static int LOWORD(int n)
|
|
{
|
|
return n & 0xffff;
|
|
}
|
|
|
|
public static int LOWORD(IntPtr n)
|
|
{
|
|
return LOWORD(unchecked((int)(long)n));
|
|
}
|
|
}
|
|
} |