Socket Programing

Is there a simple demonstration that someone could show me on how to take user input from a C++ program,open up a new browser window with google as its default search engine and paste the user input into the search text box and search for it?

In the end my hopes would be that the user would then just be looking at a browser window with search results of what they earlier entered into the program.
This task cannot possibly be done with just C++ ...

You would need to use native OS api's to do it.. or any library which can enumerate controls in a browser. Windows gives the functionality to enumerate the controls but that's a bit tough, probably you need to study win32 api's and a lot more than that.

Using the api's, you will open the process, enumerate the controls. once you get the correct control (which is the search box), set the text for that window. Then you would again enumerate to find the search button and press it.

this is how I think it could be accomplished. Probably, someone can give an easy way ?
I think we can cheat a little bit, use the specific URL instead of input text and press button to search.
find the way to open browser with path, like, https://www.google.com#q=something_you_want_to_search

I don't know is there a command for opening browser with specific path in C/C++.
Last edited on
Topic archived. No new replies allowed.