Results 1 to 9 of 9

Thread: VB6 - LINKING ON _Click to SITE

  1. #1

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    VB6 - LINKING ON _Click to SITE

    VB Code:
    1. 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:
    1. Private Sub Label1_Click()
    2. ShellExecute Me.hwnd, "OPEN", "http://www.vbforums.com", vbNullString, vbNullString, 5
    3. End Sub

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    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...

  3. #3

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: VB6 - LINKING ON _Click to SITE

    Lol Its pretty self explanatory.

  4. #4
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: VB6 - LINKING ON _Click to SITE

    Then why post it?

  5. #5

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    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.

  6. #6
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    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.
    Show Appreciation. Rate Posts.

  7. #7
    Junior Member
    Join Date
    Dec 2006
    Location
    Toronto, Canada
    Posts
    19

    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

  8. #8
    Lively Member se7en's Avatar
    Join Date
    Dec 2006
    Location
    Manchester, UK
    Posts
    118

    Re: VB6 - LINKING ON _Click to SITE

    ok for starters ya dont even need all what he put. all u need is:

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

    Did a reply help answer your questions? Please RATE good posts!
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    New Laptop System: Intel Dual-Core T2060 2.0GHz • 533MHz FSB • 2MB Cache • 1024MB RAM • 120GB Hard Drive • Dual Layer DVD ReWriter MultiDrive • 15.4" Widescreen Display • Microsoft Windows Vista Ultimate • 128MB Intel GMA 900 UMA Graphics

  9. #9

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: VB6 - LINKING ON _Click to SITE

    ShellExecute() is preferred over Shell()
    Sorry for the bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width