home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / iBrowser2124128202008.psc / iBrowser / Form1.frm < prev    next >
Text File  |  2008-07-09  |  10KB  |  339 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
  4. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  5. Begin VB.Form Form1 
  6.    Caption         =   "New Window"
  7.    ClientHeight    =   6720
  8.    ClientLeft      =   510
  9.    ClientTop       =   825
  10.    ClientWidth     =   10635
  11.    BeginProperty Font 
  12.       Name            =   "Tahoma"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    Icon            =   "Form1.frx":0000
  21.    LinkTopic       =   "Form1"
  22.    MDIChild        =   -1  'True
  23.    ScaleHeight     =   6720
  24.    ScaleWidth      =   10635
  25.    WindowState     =   2  'Maximized
  26.    Begin VB.CommandButton cmdGo 
  27.       Caption         =   "Go"
  28.       Height          =   315
  29.       Left            =   10080
  30.       TabIndex        =   4
  31.       Top             =   120
  32.       Width           =   495
  33.    End
  34.    Begin VB.ComboBox Combo1 
  35.       Height          =   315
  36.       Left            =   960
  37.       TabIndex        =   3
  38.       Top             =   120
  39.       Width           =   390
  40.    End
  41.    Begin MSComctlLib.ProgressBar p 
  42.       Align           =   2  'Align Bottom
  43.       Height          =   225
  44.       Left            =   0
  45.       TabIndex        =   0
  46.       Top             =   6240
  47.       Width           =   10635
  48.       _ExtentX        =   18759
  49.       _ExtentY        =   397
  50.       _Version        =   393216
  51.       Appearance      =   1
  52.       Scrolling       =   1
  53.    End
  54.    Begin ComctlLib.StatusBar StatusBar 
  55.       Align           =   2  'Align Bottom
  56.       Height          =   255
  57.       Left            =   0
  58.       TabIndex        =   1
  59.       Top             =   6465
  60.       Width           =   10635
  61.       _ExtentX        =   18759
  62.       _ExtentY        =   450
  63.       SimpleText      =   ""
  64.       _Version        =   327682
  65.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  66.          NumPanels       =   5
  67.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  68.             Style           =   6
  69.             TextSave        =   "7/9/2008"
  70.             Object.Tag             =   ""
  71.          EndProperty
  72.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  73.             Style           =   5
  74.             TextSave        =   "1:53 PM"
  75.             Object.Tag             =   ""
  76.          EndProperty
  77.          BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  78.             Style           =   1
  79.             Enabled         =   0   'False
  80.             TextSave        =   "CAPS"
  81.             Object.Tag             =   ""
  82.          EndProperty
  83.          BeginProperty Panel4 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  84.             Style           =   3
  85.             TextSave        =   "INS"
  86.             Object.Tag             =   ""
  87.          EndProperty
  88.          BeginProperty Panel5 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  89.             Object.Width           =   10583
  90.             MinWidth        =   10583
  91.             Object.Tag             =   ""
  92.          EndProperty
  93.       EndProperty
  94.       MousePointer    =   3
  95.    End
  96.    Begin SHDocVwCtl.WebBrowser w 
  97.       Height          =   5775
  98.       Left            =   0
  99.       TabIndex        =   2
  100.       Top             =   600
  101.       Width           =   7575
  102.       ExtentX         =   13361
  103.       ExtentY         =   10186
  104.       ViewMode        =   6
  105.       Offline         =   0
  106.       Silent          =   0
  107.       RegisterAsBrowser=   1
  108.       RegisterAsDropTarget=   1
  109.       AutoArrange     =   -1  'True
  110.       NoClientEdge    =   0   'False
  111.       AlignLeft       =   0   'False
  112.       NoWebView       =   0   'False
  113.       HideFileNames   =   0   'False
  114.       SingleClick     =   0   'False
  115.       SingleSelection =   0   'False
  116.       NoFolders       =   0   'False
  117.       Transparent     =   0   'False
  118.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  119.       Location        =   "http:///"
  120.    End
  121.    Begin VB.Label Label1 
  122.       Caption         =   "Address:"
  123.       Height          =   195
  124.       Left            =   120
  125.       TabIndex        =   5
  126.       Top             =   240
  127.       Width           =   975
  128.    End
  129. End
  130. Attribute VB_Name = "Form1"
  131. Attribute VB_GlobalNameSpace = False
  132. Attribute VB_Creatable = False
  133. Attribute VB_PredeclaredId = True
  134. Attribute VB_Exposed = False
  135. Dim StatusText As String
  136. Private Type PopUpData
  137.     URL As String * 256
  138.     Action As String * 9
  139. End Type
  140.  
  141.  
  142.  
  143. Private Sub cmdGo_Click()
  144. If Combo1.Text = "" Then
  145.         'do nothing
  146.     Else
  147.         
  148.               w.Navigate (Combo1.Text)
  149.     End If
  150.     strURL = Combo1.Text
  151.     If Left(LCase(strURL), 7) = "http://" Or Left(LCase(strURL), 6) = "ftp://" Then
  152.         Combo1.Text = strURL
  153.     Else
  154.         If Left(strURL, 7) <> "http://" Then
  155.             Combo1.Text = "http://" & strURL
  156.         Else
  157.             If Left(strURL, 6) = "ftp://" Then
  158.                 Combo1.Text = "ftp://" & strURL
  159.             End If
  160.         End If
  161.     End If
  162.     Combo1.SelStart = 0
  163.     Combo1.SelLength = Len(Combo1.Text)
  164. End Sub
  165.  
  166. Private Sub Combo1_KeyPress(KeyAscii As Integer)
  167.     If KeyAscii = 13 Then
  168.     Call cmdGo_Click
  169.     End If
  170. End Sub
  171.  
  172.  
  173. Private Sub Form_Activate()
  174.     MDIForm1.Caption = "iBrowser"
  175.     'MDIForm1.Combo1.Text = MDIForm1.ActiveForm.w.LocationURL
  176.     winid = CInt(MDIForm1.ActiveForm.Tag)
  177.     tabcount = MDIForm1.TabStrip1.Tabs.Count
  178.     For i = 1 To tabcount
  179.         If MDIForm1.TabStrip1.Tabs(i).Tag = CStr(winid) Then
  180.             MDIForm1.TabStrip1.Tabs(i).Caption = MDIForm1.ActiveForm.w.LocationName
  181.             Exit For
  182.         End If
  183.     Next
  184. End Sub
  185.  
  186. Private Sub Form_Click()
  187. 'MDIForm1.Combo1.Text = MDIForm1.ActiveForm.w.LocationURL
  188. End Sub
  189.  
  190. Private Sub Form_GotFocus()
  191. 'MDIForm1.Caption = Me.Caption & " - CyberBrowser"
  192. 'MDIForm1.cboURL.Text = MDIForm1.ActiveForm.w.LocationURL
  193. End Sub
  194.  
  195. Private Sub Form_Load()
  196. On Error Resume Next
  197. Form1.Height = 6300
  198. Form1.Width = 11700
  199. Me.Caption = w.LocationName
  200. End Sub
  201.  
  202.  
  203.  
  204.  
  205. Private Sub Form_Paint()
  206. 'Combo1.Width = Form1.Width - Label1.Width - cmdGo.Width - 300
  207.  
  208. End Sub
  209.  
  210. Private Sub Form_Resize()
  211. w.Move 0, 500, Me.ScaleWidth, Me.ScaleHeight - 800
  212. Combo1.Width = w.Width - Label1.Width - 600
  213. cmdGo.Left = Combo1.Left + Combo1.Width + 100
  214. End Sub
  215.  
  216. Private Sub Form_Unload(Cancel As Integer)
  217. On Error Resume Next
  218. Dim winid As Integer
  219. 'Set a = MDIForm1.ActiveForm
  220. winid = CStr(MDIForm1.ActiveForm.Tag)
  221. 'MsgBox winid
  222. WinInfo(winid).tabID = 101
  223. WinInfo(winid).winid = 101
  224. 'winid = CStr(MDIForm1.ActiveForm.Tag)
  225. tabcount = MDIForm1.TabStrip1.Tabs.Count
  226. 'Dim w1 As Integer
  227. 'w1 = 1
  228. For w1 = 1 To tabcount Step 1
  229.     If MDIForm1.TabStrip1.Tabs.Item(w1).Tag = CStr(winid) Then Exit For
  230. Next
  231. If w1 = tabcount + 1 Then w1 = tabcount
  232. If w1 > 0 Then MDIForm1.TabStrip1.Tabs.Remove (w1)
  233. Unload Me
  234. End Sub
  235.  
  236. Private Sub w_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
  237. Combo1.AddItem URL
  238. If Me.Caption <> "" Then
  239.     'MDIForm1.TabStrip1.Tabs(CInt(Form.Tag)).Caption = Me.Caption
  240. Else
  241.     'MDIForm1.TabStrip1.Tabs(CInt(Form.Tag)).Caption = "<untitled>"
  242. End If
  243. End Sub
  244.  
  245. Private Sub w_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  246. Combo1.Text = w.LocationURL
  247. 'Me.Caption = w.LocationName
  248. End Sub
  249.  
  250.  
  251.  
  252.  
  253.  
  254. Private Sub w_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  255.     winid = CInt(MDIForm1.ActiveForm.Tag)
  256.     tabcount = MDIForm1.TabStrip1.Tabs.Count
  257.     For i = 1 To tabcount
  258.         If MDIForm1.TabStrip1.Tabs(i).Tag = CStr(winid) Then
  259.             MDIForm1.TabStrip1.Tabs(i).Caption = MDIForm1.ActiveForm.w.LocationName
  260.             Exit For
  261.         End If
  262.     Next
  263. End Sub
  264.  
  265. Private Sub w_NewWindow2(ppDisp As Object, Cancel As Boolean)
  266. Dim fFile As Long, pObj As PopUpData, Found As Boolean
  267. fFile = FreeFile
  268. Open App.Path & "\PopUp.TXT" For Random As fFile Len = Len(pObj)
  269. Do While Not EOF(fFile)
  270.     DoEvents
  271.     Get #fFile, , pObj
  272.     If InStr(w.LocationURL, "?") > 0 Then
  273.         If Trim(pObj.URL) = Left(LCase(Trim(w.LocationURL)), InStr(w.LocationURL, "?") - 1) Then Found = True
  274.     Else
  275.         If Trim(pObj.URL) = LCase(Trim(w.LocationURL)) Then Found = True
  276.     End If
  277.     If Found Then Exit Do
  278. Loop
  279. Close fFile
  280.  
  281. If Found Then
  282.     If pObj.Action = "Block all" Then Cancel = True
  283. Else
  284.     frmPopupBlocker.lblSrc1 = "Source: " & w.LocationURL
  285.     frmPopupBlocker.lblSrc2 = "Source: " & w.LocationURL
  286.     frmPopupBlocker.Show vbModal
  287.     
  288.     Select Case frmPopupBlocker.Result
  289.     Case "Allow"
  290.     
  291.     Case "Allow all"
  292.         If InStr(w.LocationURL, "?") > 0 Then
  293.             pObj.URL = Left(LCase(Left(w.LocationURL, 256)), InStr(w.LocationURL, "?") - 1)
  294.         Else
  295.             pObj.URL = LCase(Left(w.LocationURL, 256))
  296.         End If
  297.         pObj.Action = "Allow all"
  298.         
  299.         fFile = FreeFile
  300.         Open App.Path & "\PopUp.TXT" For Random As fFile Len = Len(pObj)
  301.         Put #fFile, LOF(fFile) / Len(pObj) + 1, pObj
  302.         Close #fFile
  303.     Case "Block"
  304.         Cancel = True
  305.     Case "Block all"
  306.         Cancel = True
  307.         
  308.         If InStr(w.LocationURL, "?") > 0 Then
  309.             pObj.URL = Left(LCase(Left(w.LocationURL, 256)), InStr(w.LocationURL, "?") - 1)
  310.         Else
  311.             pObj.URL = LCase(Left(w.LocationURL, 256))
  312.         End If
  313.         pObj.Action = "Block all"
  314.         
  315.         fFile = FreeFile
  316.         Open App.Path & "\PopUp.TXT" For Random As fFile Len = Len(pObj)
  317.         Put #fFile, LOF(fFile) / Len(pObj) + 1, pObj
  318.         Close #fFile
  319.     End Select
  320. End If
  321. End Sub
  322.  
  323. Private Sub w_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
  324. On Error Resume Next
  325. Form1.p.Max = ProgressMax
  326. Form1.p.Value = Progress
  327. Form1.p.Refresh
  328. End Sub
  329.  
  330. Private Sub w_StatusTextChange(ByVal Text As String)
  331. On Error Resume Next
  332. Form1.StatusBar.Panels(5).Text = Text & " " & p.Value & "  %"
  333. End Sub
  334.  
  335. Private Sub w_TitleChange(ByVal Text As String)
  336.     MDIForm1.ActiveForm.Caption = Text
  337. End Sub
  338.  
  339.