2

In my VB6 application i am using SHDocVw.InternetExplorer and navigate websites, fill texbox , submit etc.

Dim iE As New SHDocVw.InternetExplorer
iE.Navigate "www.google.com"
iE.Visible = True

So how can I do the same using chrome as a instance. I would be able to all functionality like I do in SHDocVw.InternetExplorer.

Please guide me. .NET solutions are also welcome

IT researcher
  • 3,274
  • 17
  • 79
  • 143
  • 1
    @AntonioBakula I am not refering to web browser control like webkit. I want launch chrome itself and automate the chrome. In SHDocVw.InternetExplorer i can get document and then fill textbox and click button etc. – IT researcher Aug 01 '14 at 09:21
  • 1
    Chrome does not have a COM Automation API so there is nothing directly equivalent. – Alex K. Aug 01 '14 at 09:38
  • There are other -- more modern, more secure and more reliable -- ways to 'control a web site'. What is it you are trying to achieve? – Grim Aug 01 '14 at 11:01

1 Answers1

0

I don't quite understand your question and my vb6 is extremely dusty (not to say that is a big old now)... The SHDocVw has only defined Internet Explorer as a browser that can be used by the platform and it was a hook to access the Internet Explorer launcher.

In .net you could access an instance of Chrome that is hosted on your application using libraries such as CEFSharp. You will need to create a window and place your chrome browser as a control of it. Once you have done that you will be able to navigate to the page you want.

I had a quick look around and couldn't find a wrapper for vb6 but there are lots of samples for .net (I can provide a sample for WPF if you are interested).

A different way (which I wouldn't recommend) is launching the chrome process with the arguments you want to provide. For example, the following command line should open up chrome (if installed) with two tabs, each with the url provided:

start chrome "http://www.google.com" "http://www.stackoverflow.com"

In that case (as mentioned above) you will need to check the registry if Chrome is installed before trying to start it.

Reference to CEFSharp

rodrigoelp
  • 2,550
  • 1
  • 19
  • 29
  • CEFsharp, webkit etc are web browser control which we can embed in our application and use. By using SHDocVw.InternetExplorer we can launch IE browser itself and perform actions required. So is there any method of doing it using chrome. just using start and launching process will be something different. I should be able to control the broswer action as i can do it in SHDocVw.InternetExplorer. – IT researcher Aug 01 '14 at 09:12
  • I am sorry @it-researcher, I don't know (or think there is) a library that is going to let you do something like that... Specially since Chromium has not back ported their library that far back. – rodrigoelp Aug 04 '14 at 05:45
  • I am struggling with issue posted [here](http://stackoverflow.com/questions/31376462/save-a-file-to-hard-disk-using-htmldocument-and-internetexplorer-object-in-vb-ne ). Can someone plz tell me with my code if same can be achieved using CEFSharp – Tweety01 Jul 27 '15 at 10:12