There a few way to do that by using hooks. First one is to create local hook with SetWindowsHookEx
SetWindowsHookEx(WH_CALLWNDPROCRET, NativeMethods.HookProc,
IntPtr.Zero, (uint)AppDomain.GetCurrentThreadId());
and listen to WM_INITDIALOG windows messages, then find input textbox and insert required text. Sample code in Suppressing Hosted WebBrowser Control Dialogs
Second way is to use SetWinEventHook function and hook EVENT_SYSTEM_DIALOGSTART events and rest of processing is the same. You can find sample code in https://github.com/jsulak/Switcheroo/blob/master/ManagedWinapi/AccessibleObjectListener.cs