1

I am trying to make an application that puts a url into an opened chrome's address bar. I am making it for myself because chrome does not allow me to enter a new url in full screen mode.

So...in c#, I can get handle of chrome. The problem is...I have no idea how to put url into chrome's address bar in c# code.

is it even possible?

I am not looking for a working source code. Any idea would be helpful.

Thanks!

Moon
  • 22,195
  • 68
  • 188
  • 269

3 Answers3

0

If you're not set on C#, try looking into AutoIt... you should be able to find some way of entering text into the right place and pressing enter... that's at least where I'd start.

chezy525
  • 4,025
  • 6
  • 28
  • 41
0

When i was young, i used delphi's tool called "Process Viewer" or something like that. It could show main controls in opened windows. Knowing control's name you can get its handle. Having its handle you can do everything =) Here is a bit more info =)

Community
  • 1
  • 1
shybovycha
  • 11,556
  • 6
  • 52
  • 82
0

This appears to be possible. Start a new process and set the -url argument to the address you wish to open. You can validate this from a command prompt or start menu, so I don't see any reason it wouldn't work in code, assuming the assembly has the appropriate level of trust.

chrome.exe -url www.mysite.com

Chrome apparently can be started with a variety of command line arguments, although I didn't see the -url switch on the list.

http://www.waltercedric.com/component/content/article/261-google/1713-google-chrome-exhaustive-command-line-switches.html

Quick article on spawning new processes w/ arguments in c#: http://www.csharp-station.com/HowTo/ProcessStart.aspx

MSDN documentation and samples: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx

Tim M.
  • 53,671
  • 14
  • 120
  • 163