provided by: 
Originally published at Internet.comThis is the second part of the Develop Your Own Browser. To view part 1, click here.
In this article you'll learn how to copy, select all, view source, edit with Frontpage and edit with Visual Interdev.
Dim eQuery As OLECMDF "return value type for QueryStatusWB On Error Resume Next eQuery = brwwebbrowser.QueryStatusWB(OLECMDID_COPY) If Err.Number = 0 Then If eQuery And OLECMDF_ENABLED Then brwwebbrowser.ExecWB OLECMDID_COPY, _ OLECMDEXECOPT_PROMPTUSER, _ "", "" "Ok to Print? End If End If
Dim eQuery As OLECMDF "return value type for QueryStatusWB On Error Resume Next eQuery = brwwebbrowser.QueryStatusWB(OLECMDID_SELECTALL) If Err.Number = 0 Then If eQuery And OLECMDF_ENABLED Then brwwebbrowser.ExecWB OLECMDID_SELECTALL, _ OLECMDEXECOPT_PROMPTUSER, _ "", "" "Ok to Print? Else MsgBox "The Print command is currently disabled." End If End If
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 Long Public Const SW_SHOW = 5 Type 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 Long End Type
Insert these coding into your click Event: On Error Resume Next Dim lrs As String lrs = "C:\windows\temp.htm" Dim b() As Byte Inet1.Cancel Inet1.Protocol = icHTTP Inet1.URL = WebBrowser1.LocationName If Inet1.URL <> "" Then b() = Inet1.OpenURL(, icByteArray) Open lrs For Binary Access Write As #1 Put #1, , b() Close #1 Dim retval As Long retval = ShellExecute(Me.hWnd, "open", _ "C:\windows\notepad.exe", lrs, _ "C:\windows\", SW_SHOW) Else MsgBox "There is no source code for this. _ It may be a System File" End If
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 Long Public Const SW_SHOW = 5 Type 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 Long End Type
Insert these coding into your click Event: Dim rpo As String On Error Resume Next Dim lrs As String Dim b() As Byte lrs = "C:\windows\temp.htm" Inet1.Cancel Inet1.Protocol = icHTTP Inet1.URL = cboaddress.Text rpo = Dir$("C:\Program Files\Microsoft _ FrontPage\bin\fpeditor.exe") If rpo <> "" Then If Inet1.URL <> "" Then b() = Inet1.OpenURL(, icByteArray) Open lrs For Binary Access Write As #1 Put #1, , b() Close #1 Dim retval As Long retval = ShellExecute(Me.hWnd, "open", _ "C:\Program Files\Microsoft _ FrontPage\bin\fpeditor.exe", lrs, _ "C:\MyProg\", SW_MAXIMIZE) Else MsgBox "There is no source code for this. _ It may be a System File." End If Else MsgBox "Microsoft Front Page Software Not Found." End If
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 Long Public Const SW_SHOW = 5 Type 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 Long End Type
Insert these coding into your click Event: On Error Resume Next Dim rpo As String Dim lrs As String Dim b() As Byte lrs = "C:\Windows\temp.htm" Inet1.Cancel Inet1.Protocol = icHTTP Inet1.URL = cboaddress.Text rpo = Dir$("C:\Program Files\Microsoft Visual Studio\_ Common\IDE\IDE98\DEVENV.EXE") If rpo <> "" Then If Inet1.URL <> "" Then b() = Inet1.OpenURL(, icByteArray) Open lrs For Binary Access Write As #1 Put #1, , b() Close #1 Dim retval As Long retval = ShellExecute(Me.hWnd, "open", "C:\_ Program Files\Microsoft Visual Studio\_ Common\IDE\IDE98\DEVENV.EXE", lrs, _ "C:\MyProg\", SW_MAXIMIZE) Else MsgBox "There is no source code for this. _ It may be a System File." End If Else MsgBox "Microsoft Visual Interdev Software _ Not Found" End If
Author: Soma Sundaram
Read article at Internet.com site