Click to See Complete Forum and Search --> : Make an internet link in the GUI


ctyuang
October 20th, 1999, 02:44 AM
How to make an internet link in the GUI by using VC++.
Lets say I want to link the user to certain web site, when he/she click an button or a link.

TY

sbt
October 20th, 1999, 02:56 AM
Make some text control or any actveX control to receive click event.

e.g.

www.microsoft.com

and in the click event mapping write the code to shell execute the Internet explorer or Netscape Navigator with command line parameter as your website address.

for this you have to use

ShellExecute() API

best luck.

The bug is Human, to debug it, is divine !!

kishk91
October 20th, 1999, 02:58 AM
Hi check this code:

void CMyClass::OnAnyButton()
{
ShellExecute(NULL,"open","www.codeguru.com",NULL,NULL,SW_MAXIMIZE);

}





HTH
kishk91

kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258

Oleg Lobach
October 20th, 1999, 03:04 AM
Hi,
For button create command handler like this:

ShellExecute(NULL, "open", "http://www.codeguru.com",NULL, NULL,SW_SHOWNORMAL);




Good luck,
Oleg.

Jason Teagle
October 20th, 1999, 03:37 AM
If you have a hunt through the code samples on CodeGuru, you will find some hyperlink classes which add proper hyperlink-look links. They are configurable and make it look like the real thing.

The search facility should help to get to those samples quicker.