Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to launch a browser to browse a specific site.

Posted on 1998-08-16
4
Medium Priority
?
275 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 80 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

715 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