public void getCaretPosition() { GUITHREADINFO temp = new GUITHREADINFO(); temp.cbSize = (uint)Marshal.SizeOf(temp); // Get GuiThreadInfo into guiInfo GetGUIThreadInfo(0, out temp); if(temp.rcCaret.Left != 0) guiInfo = temp; }