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.

491 lines
11 KiB

  1. VERSION 4.00
  2. Begin VB.Form Form1
  3. Caption = "Internet Explorer Test"
  4. ClientHeight = 5325
  5. ClientLeft = 2295
  6. ClientTop = 2610
  7. ClientWidth = 6600
  8. Height = 5730
  9. Left = 2235
  10. LinkTopic = "Form1"
  11. ScaleHeight = 355
  12. ScaleMode = 3 'Pixel
  13. ScaleWidth = 440
  14. Top = 2265
  15. Width = 6720
  16. Begin VB.CommandButton HtmlShell
  17. Caption = "html Shell?"
  18. Height = 495
  19. Left = 5040
  20. TabIndex = 28
  21. Top = 2400
  22. Width = 975
  23. End
  24. Begin VB.CommandButton cliwin
  25. Caption = "Client to Window"
  26. Height = 495
  27. Left = 4680
  28. TabIndex = 27
  29. Top = 960
  30. Width = 1215
  31. End
  32. Begin VB.CommandButton PropGet
  33. Caption = "Get"
  34. Height = 375
  35. Left = 5160
  36. TabIndex = 26
  37. Top = 3960
  38. Width = 495
  39. End
  40. Begin VB.CommandButton PropSet
  41. Caption = "set"
  42. Height = 375
  43. Left = 4560
  44. TabIndex = 25
  45. Top = 3960
  46. Width = 495
  47. End
  48. Begin VB.TextBox PropValue
  49. Height = 495
  50. Left = 2760
  51. TabIndex = 24
  52. Top = 3840
  53. Width = 1695
  54. End
  55. Begin VB.TextBox PropName
  56. Height = 495
  57. Left = 1200
  58. TabIndex = 22
  59. Top = 3840
  60. Width = 1215
  61. End
  62. Begin VB.Timer Timer1
  63. Interval = 500
  64. Left = 5880
  65. Top = 3960
  66. End
  67. Begin VB.CommandButton TalkToHTML
  68. Caption = "Talk to html"
  69. Height = 495
  70. Left = 3960
  71. TabIndex = 19
  72. Top = 2400
  73. Width = 975
  74. End
  75. Begin VB.CommandButton DocType
  76. Caption = "Doc Type"
  77. Height = 495
  78. Left = 2880
  79. TabIndex = 18
  80. Top = 2400
  81. Width = 975
  82. End
  83. Begin VB.CommandButton FileName
  84. Caption = "File Name"
  85. Height = 495
  86. Left = 1560
  87. TabIndex = 17
  88. Top = 2400
  89. Width = 1215
  90. End
  91. Begin VB.CommandButton Path
  92. Caption = "Path"
  93. Height = 495
  94. Left = 120
  95. TabIndex = 16
  96. Top = 2400
  97. Width = 1215
  98. End
  99. Begin VB.ComboBox CoordList
  100. Height = 315
  101. ItemData = "form1.frx":0000
  102. Left = 3360
  103. List = "form1.frx":001F
  104. TabIndex = 15
  105. Top = 3120
  106. Width = 1215
  107. End
  108. Begin VB.CommandButton SetCoord
  109. Caption = "Set"
  110. Height = 255
  111. Left = 4680
  112. TabIndex = 14
  113. Top = 3120
  114. Width = 495
  115. End
  116. Begin VB.CommandButton GetCoord
  117. Caption = "Get"
  118. Height = 255
  119. Left = 5160
  120. TabIndex = 13
  121. Top = 3120
  122. Width = 495
  123. End
  124. Begin VB.CommandButton Command2
  125. Caption = "Test Excel Macro"
  126. Height = 495
  127. Left = 1560
  128. TabIndex = 12
  129. Top = 3120
  130. Width = 1695
  131. End
  132. Begin VB.CommandButton IsShown
  133. Caption = "Is Shown?"
  134. Height = 495
  135. Left = 4440
  136. TabIndex = 11
  137. Top = 1680
  138. Width = 1215
  139. End
  140. Begin VB.CommandButton Hide
  141. Caption = "Hide"
  142. Height = 495
  143. Left = 3720
  144. TabIndex = 10
  145. Top = 1680
  146. Width = 615
  147. End
  148. Begin VB.CommandButton Show
  149. Caption = "Show"
  150. Height = 495
  151. Left = 3000
  152. TabIndex = 9
  153. Top = 1680
  154. Width = 615
  155. End
  156. Begin VB.CommandButton FullName
  157. Caption = "Full Name"
  158. Height = 495
  159. Left = 1560
  160. TabIndex = 8
  161. Top = 1680
  162. Width = 1215
  163. End
  164. Begin VB.CommandButton Name
  165. Caption = "Name"
  166. Height = 495
  167. Left = 120
  168. TabIndex = 6
  169. Top = 1680
  170. Width = 1215
  171. End
  172. Begin VB.CommandButton Quit
  173. Caption = "&Quit"
  174. Height = 495
  175. Left = 120
  176. TabIndex = 5
  177. Top = 3120
  178. Width = 1215
  179. End
  180. Begin VB.CommandButton Open
  181. Caption = "&Open"
  182. Height = 495
  183. Left = 3120
  184. TabIndex = 4
  185. Top = 960
  186. Width = 1215
  187. End
  188. Begin VB.TextBox OpenPath
  189. Height = 495
  190. Left = 120
  191. TabIndex = 3
  192. Top = 960
  193. Width = 2895
  194. End
  195. Begin VB.CommandButton GoHome
  196. Caption = "Go Home"
  197. Height = 495
  198. Left = 3000
  199. TabIndex = 2
  200. Top = 240
  201. Width = 1215
  202. End
  203. Begin VB.CommandButton GoForward
  204. Caption = "Go Forward"
  205. Height = 495
  206. Left = 1560
  207. TabIndex = 1
  208. Top = 240
  209. Width = 1215
  210. End
  211. Begin VB.CommandButton GoBack
  212. Caption = "Go Back"
  213. Height = 495
  214. Left = 120
  215. TabIndex = 0
  216. Top = 240
  217. Width = 1215
  218. End
  219. Begin VB.Label Label2
  220. Caption = "="
  221. Height = 495
  222. Left = 2520
  223. TabIndex = 23
  224. Top = 3840
  225. Width = 135
  226. End
  227. Begin VB.Label Label1
  228. Caption = "Properties"
  229. Height = 495
  230. Left = 120
  231. TabIndex = 21
  232. Top = 3840
  233. Width = 855
  234. End
  235. Begin VB.Label busy
  236. Height = 495
  237. Left = 5640
  238. TabIndex = 20
  239. Top = 4680
  240. Width = 1095
  241. End
  242. Begin VB.Label Status
  243. Height = 495
  244. Left = 120
  245. TabIndex = 7
  246. Top = 4680
  247. Width = 5175
  248. End
  249. End
  250. Attribute VB_Name = "Form1"
  251. Attribute VB_Creatable = False
  252. Attribute VB_Exposed = False
  253. Private Sub Command1_Click()
  254. End Sub
  255. Private Sub Combo1_Change()
  256. End Sub
  257. Private Sub cliwin_Click()
  258. On Error GoTo Boom
  259. x = 100
  260. y = 100
  261. Call iexplore.ClientToWindow(x, y)
  262. Status = "X=" + x + " y=" + y
  263. GoTo TheEnd
  264. Boom:
  265. Beep
  266. TheEnd:
  267. End Sub
  268. Private Sub Command2_Click()
  269. Dim objXL As Excel.Application
  270. Dim MyArray As Variant
  271. On Error GoTo ErrorHandler
  272. MyArray = Array(1, 2, 3)
  273. Set objXL = IExplorer.Document
  274. With objXL
  275. .Range("A1:c1").Value = MyArray
  276. End With
  277. GoTo endfunc
  278. ErrorHandler:
  279. Beep
  280. endfunc:
  281. End Sub
  282. Private Sub DocType_Click()
  283. On Error GoTo Boom
  284. Status = IExplorer.Type
  285. GoTo TheEnd
  286. Boom:
  287. Beep
  288. TheEnd:
  289. End Sub
  290. Private Sub filename_Click()
  291. On Error GoTo Boom
  292. Status = IExplorer.filename
  293. GoTo TheEnd
  294. Boom:
  295. Beep
  296. TheEnd:
  297. End Sub
  298. Private Sub Form_Load()
  299. Set IExplorer = CreateObject("InternetExplorer.Application")
  300. CoordList.ListIndex = 0
  301. End Sub
  302. Private Sub FullName_Click()
  303. Status = IExplorer.FullName
  304. End Sub
  305. Private Sub GetCoord_Click()
  306. Select Case CoordList.ListIndex
  307. Case 0
  308. Status = IExplorer.Left
  309. Case 1
  310. Status = IExplorer.Top
  311. Case 2
  312. Status = IExplorer.Width
  313. Case 3
  314. Status = IExplorer.Height
  315. Case 4
  316. Status = IExplorer.FullScreen
  317. Case 5
  318. Status = IExplorer.ToolBar
  319. Case 6
  320. Status = IExplorer.StatusBar
  321. Case 7
  322. Status = IExplorer.StatusText
  323. Case 8
  324. Status = IExplorer.MenuBar
  325. End Select
  326. End Sub
  327. Private Sub GoBack_Click()
  328. IExplorer.GoBack
  329. End Sub
  330. Private Sub GoForward_Click()
  331. IExplorer.GoForward
  332. End Sub
  333. Private Sub GoHome_Click()
  334. IExplorer.GoHome
  335. End Sub
  336. Private Sub Hide_Click()
  337. IExplorer.Visible = False
  338. End Sub
  339. Private Sub HtmlShell_Click()
  340. Dim doc As Object
  341. On Error GoTo ErrorHandler
  342. Set doc = IExplorer.Document
  343. Rem Status = doc.Script.Document.Forms.Count
  344. Status = doc.Script.frames.Item(0).Document.links.Item(0).target
  345. GoTo endfunc
  346. ErrorHandler:
  347. Beep
  348. endfunc:
  349. End Sub
  350. Private Sub IsShown_Click()
  351. If IExplorer.Visible Then
  352. Status = "Visible"
  353. Else
  354. Status = "Not Visible"
  355. End If
  356. End Sub
  357. Private Sub Name_Click()
  358. Status = IExplorer.Name
  359. End Sub
  360. Private Sub Open_Click()
  361. IExplorer.Open (OpenPath.Text)
  362. End Sub
  363. Private Sub Positions_Change(Index As Integer)
  364. End Sub
  365. Private Sub OpenPath_KeyPress(KeyAscii As Integer)
  366. If KeyAscii = 13 Then
  367. IExplorer.Navigate (OpenPath.Text)
  368. End If
  369. End Sub
  370. Private Sub Path_Click()
  371. On Error GoTo Boom
  372. Status = IExplorer.Path
  373. GoTo TheEnd
  374. Boom:
  375. Beep
  376. TheEnd:
  377. End Sub
  378. Private Sub PropGet_Click()
  379. PropValue = IExplorer.GetProperty(PropName)
  380. End Sub
  381. Private Sub PropSet_Click()
  382. Dim val
  383. val = PropValue
  384. Call IExplorer.PutProperty(PropName, val)
  385. End Sub
  386. Private Sub Quit_Click()
  387. IExplorer.Quit
  388. End Sub
  389. Private Sub SetCoord_Click()
  390. On Error GoTo HandleError
  391. Select Case CoordList.ListIndex
  392. Case 0
  393. IExplorer.Left = OpenPath
  394. Case 1
  395. IExplorer.Top = OpenPath
  396. Case 2
  397. IExplorer.Width = OpenPath
  398. Case 3
  399. IExplorer.Height = OpenPath
  400. Case 4
  401. IExplorer.FullScreen = OpenPath
  402. Case 5
  403. IExplorer.ToolBar = OpenPath
  404. Case 6
  405. IExplorer.StatusBar = OpenPath
  406. Case 7
  407. IExplorer.StatusText = OpenPath
  408. Case 8
  409. IExplorer.MenuBar = OpenPath
  410. End Select
  411. GoTo endfunc
  412. HandleError:
  413. Beep
  414. endfunc:
  415. End Sub
  416. Private Sub Show_Click()
  417. IExplorer.Visible = True
  418. End Sub
  419. Private Sub TalkToHTML_Click()
  420. Dim doc As Object
  421. On Error GoTo ErrorHandler
  422. Set doc = IExplorer.Document
  423. Status = doc.Script.Location.HRef
  424. GoTo endfunc
  425. ErrorHandler:
  426. Beep
  427. endfunc:
  428. End Sub
  429. Private Sub TestCtl_Click()
  430. browsectl.Show 0
  431. End Sub
  432. Private Sub Timer1_Timer()
  433. Busy = IExplorer.Busy
  434. End Sub