Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

285 lines
6.8 KiB

  1. VERSION 4.00
  2. Begin VB.Form browsectl
  3. Caption = "Explorer in a form"
  4. ClientHeight = 5745
  5. ClientLeft = 4005
  6. ClientTop = 2580
  7. ClientWidth = 7920
  8. Height = 6150
  9. Left = 3945
  10. LinkTopic = "Form2"
  11. ScaleHeight = 5745
  12. ScaleWidth = 7920
  13. Top = 2235
  14. Width = 8040
  15. Begin VB.CommandButton Refresh
  16. Caption = "Refresh"
  17. Height = 375
  18. Left = 6720
  19. TabIndex = 8
  20. Top = 120
  21. Width = 735
  22. End
  23. Begin VB.CommandButton Stop
  24. Caption = "Stop"
  25. Height = 375
  26. Left = 6240
  27. TabIndex = 7
  28. Top = 120
  29. Width = 495
  30. End
  31. Begin VB.CommandButton Go
  32. Caption = "Go"
  33. Height = 375
  34. Left = 3600
  35. TabIndex = 6
  36. Top = 120
  37. Width = 495
  38. End
  39. Begin VB.CommandButton Search
  40. Caption = "Search"
  41. Height = 375
  42. Left = 5520
  43. TabIndex = 4
  44. Top = 120
  45. Width = 735
  46. End
  47. Begin VB.TextBox Location
  48. Height = 375
  49. Left = 120
  50. TabIndex = 3
  51. Top = 120
  52. Width = 3375
  53. End
  54. Begin VB.CommandButton Home
  55. Caption = "Home"
  56. Height = 375
  57. Left = 4920
  58. TabIndex = 2
  59. Top = 120
  60. Width = 615
  61. End
  62. Begin VB.CommandButton Forward
  63. Caption = ">"
  64. Enabled = 0 'False
  65. Height = 375
  66. Left = 4560
  67. TabIndex = 1
  68. Top = 120
  69. Width = 375
  70. End
  71. Begin VB.CommandButton Back
  72. Caption = "<"
  73. Enabled = 0 'False
  74. Height = 375
  75. Left = 4200
  76. TabIndex = 0
  77. Top = 120
  78. Width = 375
  79. End
  80. Begin SHDocVwCtl.WebBrowser WebBrowser1
  81. Height = 4455
  82. Left = 120
  83. TabIndex = 9
  84. Top = 600
  85. Width = 7575
  86. Object.Height = 297
  87. Object.Width = 505
  88. AutoSize = 0
  89. ViewMode = 1
  90. AutoSizePercentage= 0
  91. AutoArrange = -1 'True
  92. NoClientEdge = -1 'True
  93. AlignLeft = 0 'False
  94. Location = "file://C:\WINDOWS\SYSTEM\BLANK.HTM"
  95. End
  96. Begin ComctlLib.StatusBar StatusBar
  97. Align = 2 'Align Bottom
  98. Height = 495
  99. Left = 0
  100. TabIndex = 5
  101. Top = 5250
  102. Width = 7920
  103. _Version = 65536
  104. _ExtentX = 13970
  105. _ExtentY = 873
  106. _StockProps = 68
  107. AlignSet = -1 'True
  108. SimpleText = ""
  109. i1 = "browsctl.frx":0000
  110. End
  111. End
  112. Attribute VB_Name = "browsectl"
  113. Attribute VB_Creatable = False
  114. Attribute VB_Exposed = False
  115. Private Sub ShellFolderOC1_Click()
  116. End Sub
  117. Private Sub Back_Click()
  118. On Error GoTo Boom
  119. WebBrowser1.GoBack
  120. GoTo endfunc
  121. Boom:
  122. Beep
  123. endfunc:
  124. End Sub
  125. Private Sub Form_Resize()
  126. WebBrowser1.Width = Width - (WebBrowser1.Left * 2)
  127. Rem I wish I new the internal height instead of whole height
  128. WebBrowser1.Height = Height - StatusBar.Height - WebBrowser1.Top - (WebBrowser1.Top - (Location.Top + Location.Height)) - Location.Top - 2 * (WebBrowser1.Top - (Location.Top + Location.Height))
  129. End Sub
  130. Private Sub Forward_Click()
  131. On Error GoTo Boom
  132. WebBrowser1.GoForward
  133. GoTo endfunc
  134. Boom:
  135. Beep
  136. endfunc:
  137. End Sub
  138. Private Sub Go_Click()
  139. On Error GoTo Error:
  140. If KeyAscii = 13 Then
  141. WebBrowser1.Navigate (Location)
  142. End If
  143. Exit Sub
  144. Error:
  145. StatusBar.Panels(1).Text = Err.Description + "(" + Hex(Err) + ")"
  146. Beep
  147. End Sub
  148. Private Sub Home_Click()
  149. On Error GoTo Boom
  150. WebBrowser1.GoHome
  151. GoTo endfunc
  152. Boom:
  153. Beep
  154. endfunc:
  155. End Sub
  156. Private Sub Location_KeyPress(KeyAscii As Integer)
  157. On Error GoTo Error:
  158. If KeyAscii = 13 Then
  159. WebBrowser1.Navigate (Location)
  160. End If
  161. Exit Sub
  162. Error:
  163. StatusBar.Panels(1).Text = Err.Description + "(" + Hex(Err) + ")"
  164. Beep
  165. End Sub
  166. Private Sub Refresh_Click()
  167. On Error GoTo Boom
  168. WebBrowser1.Refresh
  169. GoTo endfunc
  170. Boom:
  171. Beep
  172. endfunc:
  173. End Sub
  174. Private Sub Search_Click()
  175. On Error GoTo Boom
  176. WebBrowser1.GoSearch
  177. GoTo endfunc
  178. Boom:
  179. Beep
  180. endfunc:
  181. End Sub
  182. Private Sub StatusBar1_PanelClick(ByVal Panel As Panel)
  183. End Sub
  184. Private Sub ShellExplorer1_OnBeginNavigate(ByVal HLink As Object, Cancel As Boolean)
  185. End Sub
  186. Private Sub Stop_Click()
  187. On Error GoTo Boom
  188. WebBrowser1.Stop
  189. GoTo endfunc
  190. Boom:
  191. Beep
  192. endfunc:
  193. End Sub
  194. Private Sub WebBrowser1_OnBeginNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, ByVal Referrer As String, Cancel As Boolean)
  195. On Error GoTo Boom:
  196. StatusBar.Panels(1).Text = HLink.Location
  197. GoTo Done
  198. Boom:
  199. Beep
  200. Done:
  201. End Sub
  202. Private Sub WebBrowser1_OnCommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
  203. Rem we need to define the commands some place
  204. If Command = 2 Then
  205. Back.Enabled = Enable
  206. ElseIf Command = 1 Then
  207. Forward.Enabled = Enable
  208. End If
  209. End Sub
  210. Private Sub WebBrowser1_OnDownloadComplete()
  211. StatusBar.Panels(1).Text = "Page Complete"
  212. End Sub
  213. Private Sub WebBrowser1_OnNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, ByVal Referrer As String)
  214. On Error GoTo Boom
  215. Location = HLink.Location
  216. GoTo endfunc
  217. Boom:
  218. Beep
  219. endfunc:
  220. End Sub
  221. Private Sub WebBrowser1_OnStatusTextChange(ByVal bstrText As String)
  222. StatusBar.Panels(1).Text = bstrText
  223. End Sub
  224. Private Sub WebBrowser1_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean)
  225. StatusBar.Panels(1).Text = "Before Nav: " + URL
  226. End Sub
  227. Private Sub WebBrowser1_NavigateComplete(ByVal URL As String)
  228. StatusBar.Panels(1).Text = "End Nav: " + URL
  229. End Sub
  230. Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
  231. StatusBar.Panels(1).Text = Text
  232. End Sub