VB6 - LINKING ON _Click to SITE
VB Code:
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:
VB Code:
Private Sub Label1_Click()
ShellExecute Me.hwnd, "OPEN", "http://www.vbforums.com", vbNullString, vbNullString, 5
End Sub
Re: VB6 - LINKING ON _Click to SITE
i'm not sure a single API warrant's it's own codebank thread - especially such a commonly used one as ShellExecute
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...
Re: VB6 - LINKING ON _Click to SITE
Lol Its pretty self explanatory.
Re: VB6 - LINKING ON _Click to SITE
Re: VB6 - LINKING ON _Click to SITE
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.
Re: VB6 - LINKING ON _Click to SITE
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.
Re: VB6 - LINKING ON _Click to SITE
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
Re: VB6 - LINKING ON _Click to SITE
ok for starters ya dont even need all what he put. all u need is:
vb Code:
Shell ("explorer.exe " + "http://evil-coders.com")
Re: VB6 - LINKING ON _Click to SITE
ShellExecute() is preferred over Shell()
Sorry for the bump :(