Solved

How to launch a browser to browse a specific site.

Posted on 1998-08-16
4
233 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
  • 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now