|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
looks like you learned to research as well
![]()
__________________
Programmer's Corner |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
it was just a joke. no need to take me seriously
![]() |
|
#6
|
|||
|
|||
|
I didn't... thus the tongue.
![]() |
|
#7
|
|||
|
|||
|
Oh
![]() |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
You can also do this with the Shell() function.
i.e. Shell("c:/path/to/iexplore.exe http://www.devshed.com") |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
||||
|
||||
|
I agree that it is best to just let windows figure it out, but (unfortunately) Internet Exploder will always be bundled with winblows
![]() |
|
#12
|
|||
|
|||
|
I hardly consider that unfortunate... At least while the copy of Windows is modern, it saves me a download.
S A Curnew, MCP |
|
#13
|
||||
|
||||
|
I guess I should have stated IHMO
I prefer Mozilla over IE |
|
#14
|
|||
|
|||
|
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 |
|
#15
|
||||
|
||||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Placing a hyperlink onto a form in VB6? |
| Thread Tools |