/// <summary> /// /// </summary> /// <param name="hwnd"></param> /// <returns></returns> private static bool IsCaretActive(IntPtr hwnd) { var threadId = NativeMethods.GetWindowThreadProcessId(hwnd, IntPtr.Zero); var info = new GUITHREADINFO { cbSize = Marshal.SizeOf <GUITHREADINFO>() }; NativeMethods.GetGUIThreadInfo(threadId, ref info); return(info.flags != 0 || info.hwndCaret != IntPtr.Zero); }
public static extern uint GetGUIThreadInfo(uint dwthreadid, ref GUITHREADINFO lpguithreadinfo);