Develop Your Own Browser - Part 2
Insert Inet Control (Name - Inet1)
Insert This line into your Module Declaration Section
Public 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 LongPublic Const SW_SHOW = 5Type SHELLEXECUTEINFO cbSize As Long fMask As Long hWnd As Long lpVerb As String lpFile As String lpParameters As String lpDirectory As String nShow As Long hInstApp As Long lpIDList As Long lpClass As String hkeyClass As Long dwHotKey As Long hIcon As Long hProcess As LongEnd Type
Insert these coding into your click Event:
On Error Resume NextDim lrs As Stringlrs = C:\windows\temp.htmDim b() As ByteInet1.CancelInet1.Protocol = icHTTPInet1.URL = WebBrowser1.LocationNameIf Inet1.URL <> Thenb() = Inet1.OpenURL(, icByteArray)Open lrs For Binary Access Write As #1Put #1, , b()Close #1Dim retval As Longretval = ShellExecute(Me.hWnd, open, _ C:\windows\notepad.exe, lrs, _ C:\windows\, SW_SHOW)ElseMsgBox There is no source code for this. _ It may be a System FileEnd If
Page 4 of 6
This article was originally published on November 20, 2002