Try:
IntPtr h = p.MainWindowHandle;
SetForegroundWindow(h);
SendKeys.SendWait("^a{DEL}^v");
Clipboard.Clear();
That should select all text in the window (
^a
=
Ctrl+a), delete it (
{DEL}
=
Delete), and then paste the contents of the clipboard (
^v
=
Ctrl+v).