Develop Your Own Browser - Part 2

Tuesday Nov 19th 2002 by Soma Sundaram
Share:

Develop Your Own Browser: Part II

This 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 QueryStatusWBOn Error Resume NexteQuery = brwwebbrowser.QueryStatusWB(OLECMDID_COPY)If Err.Number = 0 ThenIf eQuery And OLECMDF_ENABLED Thenbrwwebbrowser.ExecWB OLECMDID_COPY, _                     OLECMDEXECOPT_PROMPTUSER, _                     ,       Ok to Print?End IfEnd If

Dim eQuery As OLECMDF    return value type for QueryStatusWBOn Error Resume NexteQuery = brwwebbrowser.QueryStatusWB(OLECMDID_SELECTALL)If Err.Number = 0 ThenIf eQuery And OLECMDF_ENABLED Thenbrwwebbrowser.ExecWB OLECMDID_SELECTALL, _                     OLECMDEXECOPT_PROMPTUSER, _                     ,     Ok to Print?ElseMsgBox The Print command is currently disabled.End IfEnd 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 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

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:

Dim rpo As StringOn Error Resume NextDim lrs As StringDim b() As Bytelrs = C:\windows\temp.htmInet1.CancelInet1.Protocol = icHTTPInet1.URL = cboaddress.Textrpo = Dir$(C:\Program Files\Microsoft _      FrontPage\bin\fpeditor.exe)If rpo <>  ThenIf 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:\Program Files\Microsoft _         FrontPage\bin\fpeditor.exe, lrs, _         C:\MyProg\, SW_MAXIMIZE)ElseMsgBox There is no source code for this. _       It may be a System File.End IfElseMsgBox 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 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 rpo As StringDim lrs As StringDim b() As Bytelrs = C:\Windows\temp.htmInet1.CancelInet1.Protocol = icHTTPInet1.URL = cboaddress.Textrpo = Dir$(C:\Program Files\Microsoft Visual Studio\_               Common\IDE\IDE98\DEVENV.EXE)If rpo <>  ThenIf 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:\_         Program Files\Microsoft Visual Studio\_         Common\IDE\IDE98\DEVENV.EXE, lrs, _         C:\MyProg\, SW_MAXIMIZE)ElseMsgBox There is no source code for this. _       It may be a System File.End IfElseMsgBox Microsoft Visual Interdev Software _       Not FoundEnd If

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved