Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
XML RSS Feed
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleDisplay a Web page in the system's default browser
DescriptionThis example shows how to display a Web page in the system's default browser in Visual Basic 6 using the ShellExecute API function.
KeywordsWeb page, launch, browser, default browser
CategoriesUtilities
 
Use the ShellExecute API function to "open" the Web page.
 
Private Sub cmdOpen_Click()
    ' Send this to ShellExecute.
    ShellExecute ByVal 0&, "open", txtUrl.Text, _
        vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub
 
Note that ShellExecute passes the final parameter, SW_SHOWMAXIMIZED, to the application (in this case, the browser) and the application decides whether to honor it. Internet Explorer seems to ignore it if it is reusing an existing Internet Explorer window but it maximizes the window if it is creating a new window.
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated