README.md
December 5, 2022 ยท View on GitHub
Description
A simple API call to open up the default browser to the url of your choice. VERY simple and useful code.
More Info
URL string, hwnd
| Submitted On | |
| By | FluffyDave |
| Level | Intermediate |
| User Rating | 3.7 (11 globes from 3 users) |
| Compatibility | VB 4.0 (32-bit), VB 5.0, VB 6.0 |
| Category | VB function enhancement |
| World | Visual Basic |
| Archive File |
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
Source Code
Public Function OpenBrowser(strURL As String, lngHwnd As Long)
OpenBrowser = ShellExecute(lngHwnd, vbNullString, strURL, vbNullString, _
"c:\", SW_SHOWDEFAULT)
End Function