Solved

How to launch a browser to browse a specific site.

Posted on 1998-08-16
4
268 Views
Last Modified: 2010-04-01
I have seen applications where you can click on a button or menu to launch your default internet browser to browse a specific webpage. How do I write Visual C++ code for do this, i.e. launching the browser?

(Yes, I admit I'm dumb - This should be pretty straighforward, but I've just started programming in VC++ barely a week ago...)
0
Comment
Question by:regina081698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:arun_ta
ID: 1170441
Use the ::CreateProcess() function.Pass the URL as one of its arguments. Any doubt, check VC++ Help.
0
 

Author Comment

by:regina081698
ID: 1170442
arun_ta, thanks :-) But, I'm still confused (pardon my ignorance...) - How do I CreateProcess when I do NOT know the name of the executable module in advance? Could you please fill in the blanks below? (Hope this is not too much to ask?)

void CAboutDlg::OnLaunchBrowser()
{
      // TODO: Add your control notification handler code here
}


0
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1170443
::ShellExecute(NULL, _T("open"), _T("http://www.experts-exchange.com"), NULL, NULL, SW_SHOWNORMAL);

A more complete version can be found at http://www.wdj.com. Download the source code for August 1997 and look for gotourl.c inside patersn.zip.
0
 

Author Comment

by:regina081698
ID: 1170444
chensu, this works like magic. You're a darling!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question