|
|
|
Click here to copy the following block | Option 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 Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile _ As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
Public Enum T_WindowStyle Maximized = 3 Normal = 1 ShowOnly = 5 End Enum |
Click here to copy the following block | Public Sub GoToInternet(Parent As Form, URL As String, WindowStyle As T_WindowStyle) Dim lngReturn As Long
If fsGetBrowserInfo Then lngReturn = ShellExecute(Parent.hwnd, "Open", URL, "", "", WindowStyle) If lngReturn <= 32 Then MsgBox "Web Page not Opened", vbExclamation, "URL Failed" End If Else MsgBox "Could not find associated Browser", vbExclamation, "Browser Not Found" End If End Sub
Public Function fsGetBrowserInfo() As Boolean Dim strFileName As String, strDummy As String Dim strBrowserExec As String * 255 Dim lngRetVal As Long Dim intFileNumber As Integer
strBrowserExec = Space(255) strFileName = "C:\TEST.HTM" intFileNumber = FreeFile Open strFileName For Output As #intFileNumber Write #intFileNumber, "<HTML> <\HTML>" Close #intFileNumber lngRetVal = FindExecutable(strFileName, strDummy, strBrowserExec) MsgBox "Found Browser: " & strBrowserExec strBrowserExec = Trim(strBrowserExec) If lngRetVal <= 32 Or strBrowserExec="" Then fsGetBrowserInfo = False Else fsGetBrowserInfo = True End If Kill strFileName End Function |
Click here to copy the following block |
Option Explicit
Private Sub Command1_Click() GoToInternet Me, "http://www.welford-costelloe.com", Normal End Sub
Private Sub Command2_Click() GoToInternet Me, "mailto:dwc99@home.com?SUBJECT=Hello This is cool", Normal End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|