Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Visual c++: launch a hyperlink in default browser

Posted on 2003-03-11
4
Medium Priority
?
633 Views
Last Modified: 2010-05-18
Hello guys (and girls?).

I think this should be simple, but i can't find out how to do it:

1. Inside a Visual C++ program i have a hyperlink, and now want to launch the default browser (eg. Internet explorer), with the given hyperlink.

2. Furthermore the link is visible in the program, so it should look and feel like a hyperlink (blue, underlined AND mousecurser changes to 'hand' when moving over it).

Hope you can help me.
0
Comment
Question by:jim_k_l
  • 2
4 Comments
 
LVL 8

Expert Comment

by:mnashadka
ID: 8114225
You could write your own, but there a lot of such controls out there.  Check out:
http://codeguru.earthweb.com/staticctrl/HyperlinkStatic.html
0
 
LVL 5

Expert Comment

by:Kocil
ID: 8115981
  ...

   string hyperlink = "http://www.experts-exchange.com";
   HWINDOW handle = self.Handle; // Borland style, modify this for VC++
   
   ShellExecute(handle, 'open', hyperlink, nil, nil, 0);

   ...

0
 
LVL 5

Accepted Solution

by:
Kocil earned 225 total points
ID: 8115989
I mean ...

ShellExecute(handle, 'open', hyperlink, NULL, NULL, 0);

I was confused with Delphi :)
0
 

Author Comment

by:jim_k_l
ID: 8120161
Great, thanks a lot.
The VC++ way is:

CString hyperlink = "http://www.experts-exchange.com";
ShellExecute(m_hWnd, "open", hyperlink, NULL, NULL, 0);
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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.

571 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