VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



An easy to use class module for launching the browser. You should write the URL, say whether the wi

by Kamen (2 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Mon 21st August 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

An easy to use class module for launching the browser. You should write the URL, say whether the window should be maximized, etc., and call

API Declarations



'Local variables
Private mstrURL As String
Private mlngMax As Long
Private mlngMin As Long
Private mlngNormal As Long

'Function needed to launch the browser
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

'Window constants
Const SW_SHOWMAXIMIZED = 3
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWNORMAL = 1

Rate An easy to use class module for launching the browser. You should write the URL, say whether the wi



'parameters - URL/mailto, Maximized or Minimized or Normal,
'Example :
'
'Private Sub cmdLaunch_Click()
'   Dim Hlink As New Hlink
'   Hlink.URL = "http://www.someurl.com"   'write the email address if you want to send an email
'   Hlink.Maximized = True
'   Hlink.OpenURL
'End Sub

Property Let URL(strURL As String)
    mstrURL = strURL
End Property

Property Let Maximized(bMax As Boolean)
    If bMax Then
        mlngMax = SW_SHOWMAXIMIZED
    End If
End Property

Property Let Minimized(bMin As Boolean)
    If bMin Then
        mlngMin = SW_SHOWMINIMIZED
    End If
End Property

Property Let Normal(bNormal As Boolean)
    If bNormal Then
        mlngNormal = SW_SHOWNORMAL
    End If
End Property

Public Sub OpenURL()
    
    Call ShellExecute(0&, vbNullString, mstrURL, _
                vbNullString, "C:\", mlngMax Or mlngMin Or mlngNormal)
End Sub

Public Sub Mail()
    
    Call ShellExecute(0&, vbNullString, "mailto:" & mstrURL, _
                vbNullString, "C:\", mlngMax Or mlngMin Or mlngNormal)
End Sub

Download this snippet    Add to My Saved Code

An easy to use class module for launching the browser. You should write the URL, say whether the wi Comments

No comments have been posted about An easy to use class module for launching the browser. You should write the URL, say whether the wi. Why not be the first to post a comment about An easy to use class module for launching the browser. You should write the URL, say whether the wi.

Post your comment

Subject:
Message:
0/1000 characters