Not as automated as you wished for but this should work wherever copy and paste works.
F7::
Send ^c ;copy selected text
clipwait
StringReplace, clipboard, clipboard, %A_space%, +, ALL
clipboard = http://www.lmgtfy.com/?q=%clipboard%
return
- select text
- press hotkey (change F7 to whatever)
- select input box
- ctrl+v