PDA

Click to See Complete Forum and Search --> : VB6 - LINKING ON _Click to SITE


Paul M
Nov 22nd, 2006, 02:51 AM
Public 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

Linking a label example:

Private Sub Label1_Click()
ShellExecute Me.hwnd, "OPEN", "http://www.vbforums.com", vbNullString, vbNullString, 5
End Sub

bushmobile
Nov 22nd, 2006, 11:56 AM
i'm not sure a single API warrant's it's own codebank thread - especially such a commonly used one as ShellExecute (http://www.allapi.net/apilist/ShellExecute.shtml)

you haven't even explained what the API actually does, and that the code may not work if the user does not have a default browser set up...

Paul M
Nov 22nd, 2006, 08:55 PM
Lol Its pretty self explanatory.

|2eM!x
Nov 24th, 2006, 01:22 AM
Then why post it?

Paul M
Nov 25th, 2006, 06:51 PM
Some people come to this site to learn from it. And i remember when i was new to Vb6 i always learnt from stuff like this. Just because you two are admins and just sit here bagging on people who are better than you doesnt mean it does not help other people who are learning.

Harsh Gupta
Nov 26th, 2006, 05:38 AM
Those 2 are not admins!!

Secondly, BushMo's point is quite fair. I agree that you are trying to help learners but do you think that a just a single line of code can help them in understanding something?

What BushNo is saying, atleast post some, atleast a little information about what you are trying to do with that code, and most importantly explain the purpose of APIs if you are using one (and you are using one). If not, provide a link to page which explain the APIs used, like BM did.

Good luck with future posting.

jm1248
Jan 5th, 2007, 08:59 AM
Thanks Hell-Lord, works as advertised. I'm a rookie and
found it very easy to add to my project.

On my system it grabs an open browser window. Is there
a way to make it open a new window?

Thanks,
John

se7en
Mar 31st, 2007, 07:42 AM
ok for starters ya dont even need all what he put. all u need is:

Shell ("explorer.exe " + "http://evil-coders.com")

Paul M
May 2nd, 2007, 02:52 AM
ShellExecute() is preferred over Shell()
Sorry for the bump :(