用户登录  |  用户注册
首 页源码下载网络学院最新源码源码排行屏蔽广告
当前位置:新兴网络 > 源码下载 > VB源码 > 控件组件 > VB vbMHWB v1.2.1.6浏览器控件源码_VB WebBrowser加强版控件 > frmSandBox.frm
loading...复制代码
VERSION 5.00
Object = "{33658027-1004-4E1E-8D35-C9146DF87919}#1.0#0"; "vbMHWB.dll"
Begin VB.Form frmSandBox 
   Caption         =   "SandBox"
   ClientHeight    =   5715
   ClientLeft      =   195
   ClientTop       =   1005
   ClientWidth     =   8040
   LinkTopic       =   "Form3"
   ScaleHeight     =   5715
   ScaleWidth      =   8040
   Begin VBMHWBLibCtl.vbWB vbWB1 
      Height          =   5415
      Left            =   120
      OleObjectBlob   =   "frmSandBox.frx":0000
      TabIndex        =   0
      Top             =   120
      Width           =   7815
   End
End
Attribute VB_Name = "frmSandBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public hCurWB As Integer

Private Sub Form_Load()

    On Error GoTo Form_Load_Error

    'Since each instance of WB created can have their own
    'flags independent of each other, we can create a WB
    'that has the strictess navigation flags set, so we
    'can look a suspicious site without modifying registry
    'and without effecting other instances of WB created
    Dim lFlags As Long
    
    'Can set this so we can end up with no scroll bars and no way of selecting any text
    vbWB1.DocumentHostUiFlags = WBDOCHOSTUIFLAG_NO3DBORDER Or WBDOCHOSTUIFLAG_FLAT_SCROLLBAR
    
    lFlags = WBDOCDOWNLOADCTLFLAG_NO_SCRIPTS Or WBDOCDOWNLOADCTLFLAG_NO_JAVA
    lFlags = lFlags Or WBDOCDOWNLOADCTLFLAG_NO_RUNACTIVEXCTLS Or WBDOCDOWNLOADCTLFLAG_NO_DLACTIVEXCTLS
    lFlags = lFlags Or WBDOCDOWNLOADCTLFLAG_NO_FRAMEDOWNLOAD Or WBDOCDOWNLOADCTLFLAG_NO_BEHAVIORS Or WBDOCDOWNLOADCTLFLAG_SILENT
    vbWB1.DocumentDownloadControlFlags = lFlags
    
    vbWB1.ContextMenuAction = WBCONTEXTMENUACTION_DISPLAY_IE_DEFAULT
    vbWB1.AddBrowser hCurWB

    Exit Sub
Form_Load_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_Load of Form frmSandBox"
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    On Error GoTo Form_QueryUnload_Error

    If UnloadMode = vbFormControlMenu Then
        Cancel = True
        vbWB1.Stop hCurWB
        Me.Hide
        Exit Sub
    End If

    Exit Sub
Form_QueryUnload_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_QueryUnload of Form frmSandBox"
End Sub

Private Sub Form_Resize()

    On Error GoTo Form_Resize_Error

    If Me.WindowState = vbMinimized Then Exit Sub
    vbWB1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight

    Exit Sub
Form_Resize_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_Resize of Form frmSandBox"
End Sub

'bStopRunningScript default is True
Private Sub vbWB1_OnShowScriptError(ByVal wbUID As Integer, vErrorLine As Variant, vErrorCharacter As Variant, vErrorCode As Variant, vErrorMsg As Variant, vErrorURL As Variant, bStopRunningScript As Boolean)

    On Error GoTo vbWB1_OnShowScriptError_Error

    

    Exit Sub
vbWB1_OnShowScriptError_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure vbWB1_OnShowScriptError of Form frmSandBox"
End Sub

Private Sub vbWB1_TitleChange(ByVal wbUID As Integer, ByVal Text As String)

    On Error GoTo vbWB1_TitleChange_Error

    Caption = Text

    Exit Sub
vbWB1_TitleChange_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure vbWB1_TitleChange of Form frmSandBox"
End Sub

Private Sub vbWB1_WindowClosing(ByVal wbUID As Integer, ByVal IsChildWindow As Boolean, Cancel As Boolean)

    On Error GoTo vbWB1_WindowClosing_Error

    Cancel = True
    Me.Hide

    Exit Sub
vbWB1_WindowClosing_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure vbWB1_WindowClosing of Form frmSandBox"
End Sub