Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public static extern uint GetGUIThreadInfo(uint dwthreadid, ref GUITHREADINFO lpguithreadinfo);