Hi,
I am trying to copy the selected text in the active window using the win32 API SendMessage as following
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, uint Msg, out int wParam, out int lParam);
int start,next;
SendMessage(activeWindowHandle, 0xB0, out start, out next);
This returns the starting and ending character position of the selected text. This works fine in notepad or any System.Windows.Forms.TextBox. But calling this for a System.Windows.Forms.RichTextBox returns one character less. anyone know why?? and how to work around this.