using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; namespace Lskj.Control.Commom { 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); /// /// 禁止获取焦点 /// /// /// [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)); } } }