Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 9th, 2003, 09:59 PM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
Question Placing a hyperlink onto a form in VB6?

I'd like to place a hyperlink onto a form in VB6, such that my program will display something like:

"Created by xyz software",
where clicking on "xyz software" would launch the system's default browser and open http://www.xyzsoft.com/

AND/OR

"Created by some.guy@somewhere.com",
where clicking on the e-mail address would launch the system's default mail client and address an e-mail to that address (same as a WWW mailto: link).

I've seen this done in multiple Windows programs but haven't really been able to figure out what controls I should use to get it done.

If anyone would point me in the right direction, it would be much appreciated...

Shawn A. Curnew, MCP

Reply With Quote
  #2  
Old August 9th, 2003, 10:51 PM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
Time to answer my own question, courtesy of visualbasicforum.com...

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then:

ShellExecute Me.hwnd, "open", "http://www.yourname.com/", vbNullString, "", 0

Or for an e-mail addy:

ShellExecute Me.hwnd, "open", "mailto:addy@domain.com", vbNullString, "", 0

And some very thorough documentation on ShellExecute:
http://www.mentalis.org/apilist/ShellExecute.shtml

Hope someone finds it useful,
Shawn A. Curnew, MCP

Reply With Quote
  #3  
Old August 9th, 2003, 10:57 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
looks like you learned to research as well
__________________
Programmer's Corner

Reply With Quote
  #4  
Old August 10th, 2003, 03:27 AM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
Hey, I DID do a forum search here before asking the question... I just didn't find the other website until after it had been posted.

Shawn A. Curnew, MCP

Reply With Quote
  #5  
Old August 10th, 2003, 09:03 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
it was just a joke. no need to take me seriously

Reply With Quote
  #6  
Old August 10th, 2003, 10:32 AM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
I didn't... thus the tongue.

Reply With Quote
  #7  
Old August 10th, 2003, 08:08 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
Oh

Reply With Quote
  #8  
Old August 18th, 2003, 09:47 AM
kjmorford kjmorford is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Fort Worth, Tx(against my will)
Posts: 4 kjmorford User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 26 m 39 sec
Reputation Power: 0
Thank You

Thank you Shawn for both asking your question and then answering it. I was looking everywhere for that! I was inserting an ole object (internet explorer) and activating it fro a button or whatever by using "ole1.action = 7" with the url in the command line of the ole object. I new there had to be a better way but I had a hard time finding it. I'm just a beginer

Thanks!

Ken

Reply With Quote
  #9  
Old August 18th, 2003, 01:13 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
You can also do this with the Shell() function.
i.e.
Shell("c:/path/to/iexplore.exe http://www.devshed.com")

Reply With Quote
  #10  
Old August 18th, 2003, 02:20 PM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
Hi Onslaught!

Thanks for the suggestion. Mind you, that kind of hard coding is what I was trying to avoid...

If you're running an internal Intranet with uniformly configured computers it's great; but otherwise I'd point out that:
- not everyone's going to have Windows installed to the same paths/partitions;
- there's no guarantee where the MSIE exe will be in the "next" version of Windows; and
- unfortunately not all users have MSIE set as their default browser.

Although it's a bit more work, I'd rather just pass Windows the call the open the document, and let it figure out what program to run.

S A Curnew, MCP

Reply With Quote
  #11  
Old August 18th, 2003, 02:58 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
I agree that it is best to just let windows figure it out, but (unfortunately) Internet Exploder will always be bundled with winblows

Reply With Quote
  #12  
Old August 18th, 2003, 03:00 PM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
I hardly consider that unfortunate... At least while the copy of Windows is modern, it saves me a download.

S A Curnew, MCP

Reply With Quote
  #13  
Old August 18th, 2003, 03:10 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
I guess I should have stated IHMO
I prefer Mozilla over IE

Reply With Quote
  #14  
Old August 18th, 2003, 11:18 PM
SACurnew SACurnew is offline
MCP
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Canada
Posts: 66 SACurnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to SACurnew
I don't. Which just makes it sort of ironic that yours was the code which would tie the user to MSIE.

Have a good one,
S A Curnew, MCP

Reply With Quote
  #15  
Old August 19th, 2003, 07:36 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
The is reason behind such madness believe it or not.
I know that the majority of people use exploder instead of other browsers (I won't go into a rant) so I basically put example code as to what people are use to. Most typical VB programmers use IE since it falls into tools that they have at thier disposal, hence I stick with examples (unless requested otherwise) to what the majority is use to.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Placing a hyperlink onto a form in VB6?


Thread Tools