|
|
Title | Display a Web page in the system's default browser |
Description | This example shows how to display a Web page in the system's default browser in Visual Basic 6 using the ShellExecute API function. |
Keywords | Web page, launch, browser, default browser |
Categories | Utilities |
|
|
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.
|
|
|
|
|
|