VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Default Browser

by FluffyDave (2 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

A simple API call to open up the default browser to the url of your choice. VERY simple and useful code.

Inputs
URL string, hwnd
API Declarations
'API for OpenBrowser
Public Const SW_SHOWDEFAULT = 10
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

Rate Default Browser

Public Function OpenBrowser(strURL As String, lngHwnd As Long)
 OpenBrowser = ShellExecute(lngHwnd, vbNullString, strURL, vbNullString, _
  "c:\", SW_SHOWDEFAULT)
End Function

Download this snippet    Add to My Saved Code

Default Browser Comments

No comments have been posted about Default Browser. Why not be the first to post a comment about Default Browser.

Post your comment

Subject:
Message:
0/1000 characters