by John 'Hemo' Hiemenz ()
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(3 Votes)
Simple calls to open up the default web browser to a given URL or to create an email message in the default email client.
Inputs
' To open a URL - Specify the URL
' OpenInternet Me, "http://www.search.com", Normal
'
' Specify Email Address and Subject
' OpenInternet Me, _
' "mailto:[email protected]?SUBJECT=Hello World", Normal
Assumes
' I am NOT the original author of this code, but posting
' it because I haven't found this type of implementation
' here yet.
Side Effects
' Does not send the Email message - up to you to do that
API DeclarationsOption Explicit
Private 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
Public Enum T_WindowStyle
Maximized = 3
Normal = 1
ShowOnly = 5
End Enum
Public Sub OpenInternet(Parent As Form, URL As String, _
WindowStyle As T_WindowStyle)
ShellExecute Parent.hwnd, "Open", URL, "", "", WindowStyle
End Sub