Source code of Windows XP (NT5)
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.

1063 lines
29 KiB

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  4. Begin VB.Form frmMain
  5. Caption = "VB MetaEdit"
  6. ClientHeight = 6060
  7. ClientLeft = 165
  8. ClientTop = 735
  9. ClientWidth = 8745
  10. LinkTopic = "Form1"
  11. ScaleHeight = 6060
  12. ScaleWidth = 8745
  13. StartUpPosition = 3 'Windows Default
  14. Begin ComctlLib.Toolbar tbToolBar
  15. Align = 1 'Align Top
  16. Height = 420
  17. Left = 0
  18. TabIndex = 1
  19. Top = 0
  20. Width = 8745
  21. _ExtentX = 15425
  22. _ExtentY = 741
  23. Appearance = 1
  24. ImageList = "imlIcons"
  25. _Version = 327680
  26. BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
  27. NumButtons = 14
  28. BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
  29. Key = "Back"
  30. Object.ToolTipText = "1036"
  31. Object.Tag = ""
  32. ImageIndex = 1
  33. EndProperty
  34. BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
  35. Key = "Forward"
  36. Object.ToolTipText = "1037"
  37. Object.Tag = ""
  38. ImageIndex = 2
  39. EndProperty
  40. BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
  41. Object.Tag = ""
  42. Style = 3
  43. EndProperty
  44. BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
  45. Key = "Cut"
  46. Object.ToolTipText = "1038"
  47. Object.Tag = ""
  48. ImageIndex = 3
  49. EndProperty
  50. BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
  51. Key = "Copy"
  52. Object.ToolTipText = "1039"
  53. Object.Tag = ""
  54. ImageIndex = 4
  55. EndProperty
  56. BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
  57. Key = "Paste"
  58. Object.ToolTipText = "1040"
  59. Object.Tag = ""
  60. ImageIndex = 5
  61. EndProperty
  62. BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
  63. Key = "Delete"
  64. Object.ToolTipText = "1041"
  65. Object.Tag = ""
  66. ImageIndex = 6
  67. EndProperty
  68. BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
  69. Object.Tag = ""
  70. Style = 3
  71. EndProperty
  72. BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7}
  73. Key = "Properties"
  74. Object.ToolTipText = "1042"
  75. Object.Tag = ""
  76. ImageIndex = 7
  77. EndProperty
  78. BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7}
  79. Object.Tag = ""
  80. Style = 3
  81. EndProperty
  82. BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7}
  83. Key = "ViewLarge"
  84. Object.ToolTipText = "1043"
  85. Object.Tag = ""
  86. ImageIndex = 8
  87. Style = 2
  88. EndProperty
  89. BeginProperty Button12 {0713F354-850A-101B-AFC0-4210102A8DA7}
  90. Key = "ViewSmall"
  91. Object.ToolTipText = "1044"
  92. Object.Tag = ""
  93. ImageIndex = 9
  94. Style = 2
  95. EndProperty
  96. BeginProperty Button13 {0713F354-850A-101B-AFC0-4210102A8DA7}
  97. Key = "ViewList"
  98. Object.ToolTipText = "1045"
  99. Object.Tag = ""
  100. ImageIndex = 10
  101. Style = 2
  102. EndProperty
  103. BeginProperty Button14 {0713F354-850A-101B-AFC0-4210102A8DA7}
  104. Key = "ViewDetails"
  105. Object.ToolTipText = "1046"
  106. Object.Tag = ""
  107. ImageIndex = 11
  108. Style = 2
  109. EndProperty
  110. EndProperty
  111. End
  112. Begin VB.ListBox ItemList
  113. Height = 4935
  114. ItemData = "frmMain.frx":0000
  115. Left = 4440
  116. List = "frmMain.frx":0007
  117. Sorted = -1 'True
  118. TabIndex = 7
  119. Top = 720
  120. Width = 4215
  121. End
  122. Begin VB.PictureBox picSplitter
  123. BackColor = &H00808080&
  124. BorderStyle = 0 'None
  125. FillColor = &H00808080&
  126. Height = 4800
  127. Left = 5400
  128. ScaleHeight = 2090.126
  129. ScaleMode = 0 'User
  130. ScaleWidth = 780
  131. TabIndex = 6
  132. Top = 705
  133. Visible = 0 'False
  134. Width = 72
  135. End
  136. Begin VB.PictureBox picTitles
  137. Align = 1 'Align Top
  138. Appearance = 0 'Flat
  139. BorderStyle = 0 'None
  140. ForeColor = &H80000008&
  141. Height = 300
  142. Left = 0
  143. ScaleHeight = 300
  144. ScaleWidth = 8745
  145. TabIndex = 2
  146. TabStop = 0 'False
  147. Top = 420
  148. Width = 8745
  149. Begin VB.Label lblTitle
  150. BorderStyle = 1 'Fixed Single
  151. Caption = " ListView:"
  152. Height = 270
  153. Index = 1
  154. Left = 2078
  155. TabIndex = 4
  156. Tag = "1048"
  157. Top = 12
  158. Width = 3216
  159. End
  160. Begin VB.Label lblTitle
  161. BorderStyle = 1 'Fixed Single
  162. Caption = " TreeView:"
  163. Height = 270
  164. Index = 0
  165. Left = 0
  166. TabIndex = 3
  167. Tag = "1047"
  168. Top = 12
  169. Width = 2016
  170. End
  171. End
  172. Begin MSComDlg.CommonDialog dlgCommonDialog
  173. Left = 2280
  174. Top = 2160
  175. _ExtentX = 847
  176. _ExtentY = 847
  177. _Version = 327680
  178. FontSize = 1.73999e-39
  179. End
  180. Begin ComctlLib.StatusBar sbStatusBar
  181. Align = 2 'Align Bottom
  182. Height = 270
  183. Left = 0
  184. TabIndex = 0
  185. Top = 5790
  186. Width = 8745
  187. _ExtentX = 15425
  188. _ExtentY = 476
  189. SimpleText = ""
  190. _Version = 327680
  191. BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
  192. NumPanels = 3
  193. BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  194. AutoSize = 1
  195. Object.Width = 9790
  196. Text = "Status"
  197. TextSave = "Status"
  198. Object.Tag = ""
  199. EndProperty
  200. BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  201. Style = 6
  202. AutoSize = 2
  203. TextSave = "2/25/97"
  204. Object.Tag = ""
  205. EndProperty
  206. BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  207. Style = 5
  208. AutoSize = 2
  209. TextSave = "5:19 PM"
  210. Object.Tag = ""
  211. EndProperty
  212. EndProperty
  213. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  214. Name = "MS Sans Serif"
  215. Size = 8.25
  216. Charset = 0
  217. Weight = 400
  218. Underline = 0 'False
  219. Italic = 0 'False
  220. Strikethrough = 0 'False
  221. EndProperty
  222. End
  223. Begin ComctlLib.TreeView tvTreeView
  224. Height = 4800
  225. Left = 0
  226. TabIndex = 5
  227. Top = 705
  228. Width = 4290
  229. _ExtentX = 7567
  230. _ExtentY = 8467
  231. _Version = 327680
  232. Indentation = 353
  233. LabelEdit = 1
  234. PathSeparator = "/"
  235. Sorted = -1 'True
  236. Style = 6
  237. Appearance = 1
  238. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  239. Name = "MS Sans Serif"
  240. Size = 8.25
  241. Charset = 0
  242. Weight = 400
  243. Underline = 0 'False
  244. Italic = 0 'False
  245. Strikethrough = 0 'False
  246. EndProperty
  247. End
  248. Begin VB.Image imgSplitter
  249. Height = 4785
  250. Left = 4320
  251. MousePointer = 9 'Size W E
  252. Top = 720
  253. Width = 150
  254. End
  255. Begin ComctlLib.ImageList imlIcons
  256. Left = 1740
  257. Top = 1350
  258. _ExtentX = 1005
  259. _ExtentY = 1005
  260. BackColor = -2147483643
  261. ImageWidth = 16
  262. ImageHeight = 16
  263. MaskColor = 12632256
  264. _Version = 327680
  265. BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
  266. NumListImages = 11
  267. BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  268. Picture = "frmMain.frx":0015
  269. Key = ""
  270. EndProperty
  271. BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  272. Picture = "frmMain.frx":01B7
  273. Key = ""
  274. EndProperty
  275. BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  276. Picture = "frmMain.frx":0359
  277. Key = ""
  278. EndProperty
  279. BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  280. Picture = "frmMain.frx":04FB
  281. Key = ""
  282. EndProperty
  283. BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  284. Picture = "frmMain.frx":069D
  285. Key = ""
  286. EndProperty
  287. BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  288. Picture = "frmMain.frx":083F
  289. Key = ""
  290. EndProperty
  291. BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  292. Picture = "frmMain.frx":09E1
  293. Key = ""
  294. EndProperty
  295. BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  296. Picture = "frmMain.frx":0B83
  297. Key = ""
  298. EndProperty
  299. BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  300. Picture = "frmMain.frx":0D25
  301. Key = ""
  302. EndProperty
  303. BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  304. Picture = "frmMain.frx":0EC7
  305. Key = ""
  306. EndProperty
  307. BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
  308. Picture = "frmMain.frx":1069
  309. Key = ""
  310. EndProperty
  311. EndProperty
  312. End
  313. Begin VB.Menu mnuFile
  314. Caption = "1000"
  315. Begin VB.Menu mnuFileOpen
  316. Caption = "1001"
  317. End
  318. Begin VB.Menu mnuFileFind
  319. Caption = "1002"
  320. End
  321. Begin VB.Menu mnuFileBar1
  322. Caption = "-"
  323. End
  324. Begin VB.Menu mnuFileSendTo
  325. Caption = "1003"
  326. End
  327. Begin VB.Menu mnuFileBar2
  328. Caption = "-"
  329. End
  330. Begin VB.Menu mnuFileNew
  331. Caption = "1004"
  332. End
  333. Begin VB.Menu mnuFileBar3
  334. Caption = "-"
  335. End
  336. Begin VB.Menu mnuFileDelete
  337. Caption = "1005"
  338. End
  339. Begin VB.Menu mnuFileRename
  340. Caption = "1006"
  341. End
  342. Begin VB.Menu mnuFileProperties
  343. Caption = "1007"
  344. End
  345. Begin VB.Menu mnuFileBar4
  346. Caption = "-"
  347. End
  348. Begin VB.Menu mnuFileMRU
  349. Caption = ""
  350. Index = 0
  351. Visible = 0 'False
  352. End
  353. Begin VB.Menu mnuFileMRU
  354. Caption = ""
  355. Index = 1
  356. Visible = 0 'False
  357. End
  358. Begin VB.Menu mnuFileMRU
  359. Caption = ""
  360. Index = 2
  361. Visible = 0 'False
  362. End
  363. Begin VB.Menu mnuFileMRU
  364. Caption = ""
  365. Index = 3
  366. Visible = 0 'False
  367. End
  368. Begin VB.Menu mnuFileBar5
  369. Caption = "-"
  370. Visible = 0 'False
  371. End
  372. Begin VB.Menu mnuFileClose
  373. Caption = "1008"
  374. End
  375. End
  376. Begin VB.Menu mnuEdit
  377. Caption = "1009"
  378. Begin VB.Menu mnuEditUndo
  379. Caption = "1010"
  380. Shortcut = ^Z
  381. End
  382. Begin VB.Menu mnuEditBar1
  383. Caption = "-"
  384. End
  385. Begin VB.Menu mnuEditCut
  386. Caption = "1011"
  387. Shortcut = ^X
  388. End
  389. Begin VB.Menu mnuEditCopy
  390. Caption = "1012"
  391. Shortcut = ^C
  392. End
  393. Begin VB.Menu mnuEditPaste
  394. Caption = "1013"
  395. Shortcut = ^V
  396. End
  397. Begin VB.Menu mnuEditPasteSpecial
  398. Caption = "1014"
  399. End
  400. Begin VB.Menu mnuEditBar2
  401. Caption = "-"
  402. End
  403. Begin VB.Menu mnuEditDSelectAll
  404. Caption = "1015"
  405. Shortcut = ^A
  406. End
  407. Begin VB.Menu mnuEditInvertSelection
  408. Caption = "1016"
  409. End
  410. End
  411. Begin VB.Menu mnuView
  412. Caption = "1017"
  413. Begin VB.Menu mnuViewToolbar
  414. Caption = "1018"
  415. Checked = -1 'True
  416. End
  417. Begin VB.Menu mnuViewStatusBar
  418. Caption = "1019"
  419. Checked = -1 'True
  420. End
  421. Begin VB.Menu mnuViewBar2
  422. Caption = "-"
  423. End
  424. Begin VB.Menu mnuListViewMode
  425. Caption = "1020"
  426. Index = 0
  427. End
  428. Begin VB.Menu mnuListViewMode
  429. Caption = "1021"
  430. Index = 1
  431. End
  432. Begin VB.Menu mnuListViewMode
  433. Caption = "1022"
  434. Index = 2
  435. End
  436. Begin VB.Menu mnuListViewMode
  437. Caption = "1023"
  438. Index = 3
  439. End
  440. Begin VB.Menu mnuViewBar3
  441. Caption = "-"
  442. End
  443. Begin VB.Menu mnuViewArrangeIcons
  444. Caption = "1024"
  445. Begin VB.Menu mnuVAIByDate
  446. Caption = "1025"
  447. End
  448. Begin VB.Menu mnuVAIByName
  449. Caption = "1026"
  450. End
  451. Begin VB.Menu mnuVAIByType
  452. Caption = "1027"
  453. End
  454. Begin VB.Menu mnuVAIBySize
  455. Caption = "1028"
  456. End
  457. End
  458. Begin VB.Menu mnuViewLineUpIcons
  459. Caption = "1029"
  460. End
  461. Begin VB.Menu mnuViewBar4
  462. Caption = "-"
  463. End
  464. Begin VB.Menu mnuViewRefresh
  465. Caption = "1030"
  466. End
  467. Begin VB.Menu mnuViewOptions
  468. Caption = "1031"
  469. End
  470. End
  471. Begin VB.Menu mnuHelp
  472. Caption = "1032"
  473. Begin VB.Menu mnuHelpContents
  474. Caption = "1033"
  475. End
  476. Begin VB.Menu mnuHelpSearch
  477. Caption = "1034"
  478. End
  479. Begin VB.Menu mnuHelpBar1
  480. Caption = "-"
  481. End
  482. Begin VB.Menu mnuHelpAbout
  483. Caption = "1035"
  484. End
  485. End
  486. End
  487. Attribute VB_Name = "frmMain"
  488. Attribute VB_GlobalNameSpace = False
  489. Attribute VB_Creatable = False
  490. Attribute VB_PredeclaredId = True
  491. Attribute VB_Exposed = False
  492. Const NAME_COLUMN = 0
  493. Const TYPE_COLUMN = 1
  494. Const SIZE_COLUMN = 2
  495. Const DATE_COLUMN = 3
  496. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  497. Dim mbMoving As Boolean
  498. Const sglSplitLimit = 500
  499. Private Sub Form_Load()
  500. LoadResStrings Me
  501. Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
  502. Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
  503. Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
  504. Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
  505. ' Set Treeview control properties.
  506. tvTreeView.LineStyle = tvwRootLines ' Linestyle 1
  507. Dim Nodx As Node
  508. Set Nodx = tvTreeView.Nodes.Add(, , "/", "/")
  509. ' Add Node objects.
  510. PopulateTree tvTreeView, "/"
  511. Nodx.Expanded = True
  512. End Sub
  513. Private Sub Form_Paint()
  514. 'ItemList.View = Val(GetSetting(App.Title, "Settings", "ViewMode", "0"))
  515. 'tbToolBar.Buttons(ItemList.View + LISTVIEW_BUTTON).Value = tbrPressed
  516. 'mnuListViewMode(ItemList.View).Checked = True
  517. End Sub
  518. Private Sub Form_Unload(Cancel As Integer)
  519. Dim i As Integer
  520. 'close all sub forms
  521. For i = Forms.Count - 1 To 1 Step -1
  522. Unload Forms(i)
  523. Next
  524. If Me.WindowState <> vbMinimized Then
  525. SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  526. SaveSetting App.Title, "Settings", "MainTop", Me.Top
  527. SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  528. SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  529. End If
  530. 'SaveSetting App.Title, "Settings", "ViewMode", ItemList.View
  531. End Sub
  532. Private Sub ItemList_ShowNode(Nodx As Node)
  533. Dim mb As IMSMetaBase
  534. Set mb = CreateObject("IISAdmin.Object")
  535. Dim i As Long
  536. Dim bytePath() As Byte
  537. Dim Path As String
  538. Dim EnumDataObj As IMSMetaDataItem
  539. Dim strItem As String
  540. On Error Resume Next
  541. ' Clear the current contents
  542. ItemList.Clear
  543. ' Open the selected node
  544. Path = Nodx.key
  545. Err.Clear
  546. bytePath = StrConv(Path & Chr(0), vbFromUnicode)
  547. Set mk = mb.OpenKey(1, 100, bytePath)
  548. If (Err.Number <> 0) Then
  549. Debug.Print ("Open Meta Object Error Code = " & Hex(Err.Number))
  550. Err.Clear
  551. Exit Sub
  552. End If
  553. Set EnumDataObj = mk.DataItem
  554. ' Enumerate the properties on this node
  555. i = 0
  556. Do
  557. ' Indicate we want all user types and datatypes
  558. EnumDataObj.UserType = 0
  559. EnumDataObj.DataType = 0
  560. EnumDataObj.Attributes = 0
  561. mk.EnumData EnumDataObj, i
  562. If (Err.Number <> 0) Then
  563. Debug.Print ("EnumData Error Code = " & Hex(Err.Number) & " (" & Err.Description & ")")
  564. Err.Clear
  565. GoTo CloseMb
  566. End If
  567. strItem = EnumDataObj.Identifier
  568. ' Add the user type
  569. If (EnumDataObj.UserType = 1) Then
  570. strItem = strItem & " IIS_MD_UT_SERVER "
  571. ElseIf (EnumDataObj.UserType = 2) Then
  572. strItem = strItem & " IIS_MD_UT_FILE "
  573. Else
  574. strItem = strItem & " MD_UT_UNKNOWN "
  575. End If
  576. ' Do the appropriate datatype conversion
  577. NewDataValue = EnumDataObj.DataType
  578. If (NewDataValue = 1) Then
  579. strItem = strItem & "MD_DWORD = " & EnumDataObj.Value
  580. ElseIf (NewDataValue = 2) Then
  581. Dim j As Long
  582. j = 0
  583. tmpStr = ""
  584. Do While (EnumDataObj.Value(j) <> 0)
  585. tmpStr = tmpStr & Chr(EnumDataObj.Value(j))
  586. j = j + 1
  587. Loop
  588. strItem = strItem & "MD_STRING = " & tmpStr
  589. End If
  590. ItemList.AddItem strItem
  591. If (Err.Number <> 0) Then
  592. Debug.Print ("EnumData Error Code = " & Err.Number & " (" & Err.Description & ")")
  593. Err.Clear
  594. 'Exit Sub
  595. End If
  596. i = i + 1
  597. Loop While (True)
  598. CloseMb:
  599. mk.Close
  600. End Sub
  601. Private Sub ItemList_DblClick()
  602. ' Get the current selection and show it
  603. Set DataForm = New frmMetaData
  604. DataForm.SetData Me.tvTreeView.SelectedItem.key, ItemList.Text
  605. DataForm.Show , Me
  606. ' Refresh the listbox
  607. End Sub
  608. Private Sub ItemList_KeyUp(KeyCode As Integer, Shift As Integer)
  609. ' Capture the delete key
  610. If KeyCode = 46 Then
  611. Dim mb As IMSMetaBase
  612. Set mb = CreateObject("IISAdmin.Object")
  613. Dim bytePath() As Byte
  614. Dim ID As Long
  615. Dim DataType As Long
  616. Dim Path As String
  617. Dim mk As IMSMetaKey
  618. ID = Val(ItemList.Text)
  619. strPath = tvTreeView.SelectedItem.key
  620. ' Choose the datatype we're deleting (why do we need to do this)?
  621. If (InStr(1, ItemList.Text, "MD_DWORD", vbBinaryCompare) <> 0) Then
  622. DataType = 1
  623. ElseIf (InStr(1, ItemList.Text, "MD_STRING", vbBinaryCompare) <> 0) Then
  624. DataType = 2
  625. End If
  626. ' Open the selected node
  627. Err.Clear
  628. bytePath = StrConv(strPath & Chr(0), vbFromUnicode)
  629. Set mk = mb.OpenKey(3, 100, bytePath)
  630. If (Err.Number <> 0) Then
  631. Debug.Print ("Open Key Error Code = " & Err.Number)
  632. Err.Clear
  633. Exit Sub
  634. End If
  635. mk.DeleteData ID, DataType
  636. If (Err.Number <> 0) Then
  637. MsgBox "DeleteData Error Code = " & Err.Number & " (" & Err.Description & ")"
  638. Err.Clear
  639. GoTo CloseMb
  640. End If
  641. CloseMb:
  642. mk.Close
  643. End If
  644. End Sub
  645. Private Sub mnuHelpAbout_Click()
  646. frmAbout.Show vbModal, Me
  647. End Sub
  648. Private Sub mnuViewOptions_Click()
  649. 'To Do
  650. MsgBox "Options Dialog Code goes here!"
  651. End Sub
  652. Private Sub mnuViewStatusBar_Click()
  653. If mnuViewStatusBar.Checked Then
  654. sbStatusBar.Visible = False
  655. mnuViewStatusBar.Checked = False
  656. Else
  657. sbStatusBar.Visible = True
  658. mnuViewStatusBar.Checked = True
  659. End If
  660. SizeControls imgSplitter.Left
  661. End Sub
  662. Private Sub mnuViewToolbar_Click()
  663. If mnuViewToolbar.Checked Then
  664. tbToolBar.Visible = False
  665. mnuViewToolbar.Checked = False
  666. Else
  667. tbToolBar.Visible = True
  668. mnuViewToolbar.Checked = True
  669. End If
  670. SizeControls imgSplitter.Left
  671. End Sub
  672. Private Sub Form_Resize()
  673. On Error Resume Next
  674. If Me.Width < 3000 Then Me.Width = 3000
  675. SizeControls imgSplitter.Left
  676. End Sub
  677. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  678. With imgSplitter
  679. picSplitter.Move .Left, .Top, .Width \ 2, .Height - 20
  680. End With
  681. picSplitter.Visible = True
  682. mbMoving = True
  683. End Sub
  684. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  685. Dim sglPos As Single
  686. If mbMoving Then
  687. sglPos = X + imgSplitter.Left
  688. If sglPos < sglSplitLimit Then
  689. picSplitter.Left = sglSplitLimit
  690. ElseIf sglPos > Me.Width - sglSplitLimit Then
  691. picSplitter.Left = Me.Width - sglSplitLimit
  692. Else
  693. picSplitter.Left = sglPos
  694. End If
  695. End If
  696. End Sub
  697. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  698. SizeControls picSplitter.Left
  699. picSplitter.Visible = False
  700. mbMoving = False
  701. End Sub
  702. Sub SizeControls(X As Single)
  703. On Error Resume Next
  704. 'set the width
  705. If X < 1500 Then X = 1500
  706. If X > (Me.Width - 1500) Then X = Me.Width - 1500
  707. tvTreeView.Width = X
  708. imgSplitter.Left = X
  709. ItemList.Left = X + 40
  710. ItemList.Width = Me.Width - (tvTreeView.Width + 140)
  711. lblTitle(0).Width = tvTreeView.Width
  712. lblTitle(1).Left = ItemList.Left + 20
  713. lblTitle(1).Width = ItemList.Width - 40
  714. 'set the top
  715. If tbToolBar.Visible Then
  716. tvTreeView.Top = tbToolBar.Height + picTitles.Height
  717. Else
  718. tvTreeView.Top = picTitles.Height
  719. End If
  720. ItemList.Top = tvTreeView.Top
  721. 'set the height
  722. If sbStatusBar.Visible Then
  723. tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height + sbStatusBar.Height)
  724. Else
  725. tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  726. End If
  727. ImageList.Height = tvTreeView.Height
  728. imgSplitter.Top = tvTreeView.Top
  729. imgSplitter.Height = tvTreeView.Height
  730. End Sub
  731. Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
  732. If Source = imgSplitter Then
  733. SizeControls X
  734. End If
  735. End Sub
  736. Private Sub tbToolBar_ButtonClick(ByVal Button As ComctlLib.Button)
  737. Select Case Button.key
  738. Case "Back"
  739. 'To Do
  740. MsgBox "Back Code goes here!"
  741. Case "Forward"
  742. 'To Do
  743. MsgBox "Forward Code goes here!"
  744. Case "Cut"
  745. mnuEditCut_Click
  746. Case "Copy"
  747. mnuEditCopy_Click
  748. Case "Paste"
  749. mnuEditPaste_Click
  750. Case "Delete"
  751. mnuFileDelete_Click
  752. Case "Properties"
  753. mnuFileProperties_Click
  754. Case "ViewLarge"
  755. mnuListViewMode_Click lvwIcon
  756. Case "ViewSmall"
  757. mnuListViewMode_Click lvwSmallIcon
  758. Case "ViewList"
  759. mnuListViewMode_Click lvwList
  760. Case "ViewDetails"
  761. mnuListViewMode_Click lvwReport
  762. End Select
  763. End Sub
  764. Private Sub mnuHelpContents_Click()
  765. Dim nRet As Integer
  766. 'if there is no helpfile for this project display a message to the user
  767. 'you can set the HelpFile for your application in the
  768. 'Project Properties dialog
  769. If Len(App.HelpFile) = 0 Then
  770. MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
  771. Else
  772. On Error Resume Next
  773. nRet = OSWinHelp(Me.hwnd, App.HelpFile, 3, 0)
  774. If Err Then
  775. MsgBox Err.Description
  776. End If
  777. End If
  778. End Sub
  779. Private Sub mnuHelpSearch_Click()
  780. Dim nRet As Integer
  781. 'if there is no helpfile for this project display a message to the user
  782. 'you can set the HelpFile for your application in the
  783. 'Project Properties dialog
  784. If Len(App.HelpFile) = 0 Then
  785. MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
  786. Else
  787. On Error Resume Next
  788. nRet = OSWinHelp(Me.hwnd, App.HelpFile, 261, 0)
  789. If Err Then
  790. MsgBox Err.Description
  791. End If
  792. End If
  793. End Sub
  794. Private Sub mnuVAIByDate_Click()
  795. 'To Do
  796. ' lvListView.SortKey = DATE_COLUMN
  797. End Sub
  798. Private Sub mnuVAIByName_Click()
  799. 'To Do
  800. ' lvListView.SortKey = NAME_COLUMN
  801. End Sub
  802. Private Sub mnuVAIBySize_Click()
  803. 'To Do
  804. ' lvListView.SortKey = SIZE_COLUMN
  805. End Sub
  806. Private Sub mnuVAIByType_Click()
  807. 'To Do
  808. ' lvListView.SortKey = TYPE_COLUMN
  809. End Sub
  810. Private Sub mnuListViewMode_Click(Index As Integer)
  811. 'uncheck the current type
  812. mnuListViewMode(lvListView.View).Checked = False
  813. 'set the listview mode
  814. lvListView.View = Index
  815. 'check the new type
  816. mnuListViewMode(Index).Checked = True
  817. 'set the toolabr to the same new type
  818. tbToolBar.Buttons(Index + LISTVIEW_BUTTON).Value = tbrPressed
  819. End Sub
  820. Private Sub mnuViewLineUpIcons_Click()
  821. 'To Do
  822. lvListView.Arrange = lvwAutoLeft
  823. End Sub
  824. Private Sub mnuViewRefresh_Click()
  825. 'To Do
  826. MsgBox "Refresh Code goes here!"
  827. End Sub
  828. Private Sub mnuEditCopy_Click()
  829. 'To Do
  830. MsgBox "Copy Code goes here!"
  831. End Sub
  832. Private Sub mnuEditCut_Click()
  833. 'To Do
  834. MsgBox "Cut Code goes here!"
  835. End Sub
  836. Private Sub mnuEditDSelectAll_Click()
  837. 'To Do
  838. MsgBox "Select All Code goes here!"
  839. End Sub
  840. Private Sub mnuEditInvertSelection_Click()
  841. 'To Do
  842. MsgBox "Invert Selection Code goes here!"
  843. End Sub
  844. Private Sub mnuEditPaste_Click()
  845. 'To Do
  846. MsgBox "Paste Code goes here!"
  847. End Sub
  848. Private Sub mnuEditPasteSpecial_Click()
  849. 'To Do
  850. MsgBox "Paste Special Code goes here!"
  851. End Sub
  852. Private Sub mnuEditUndo_Click()
  853. 'To Do
  854. MsgBox "Undo Code goes here!"
  855. End Sub
  856. Private Sub mnuFileOpen_Click()
  857. 'To Do
  858. MsgBox "Open Code goes here!"
  859. End Sub
  860. Private Sub mnuFileFind_Click()
  861. 'To Do
  862. MsgBox "Find Code goes here!"
  863. End Sub
  864. Private Sub mnuFileSendTo_Click()
  865. 'To Do
  866. MsgBox "Send To Code goes here!"
  867. End Sub
  868. Private Sub mnuFileNew_Click()
  869. 'To Do
  870. MsgBox "New File Code goes here!"
  871. End Sub
  872. Private Sub mnuFileDelete_Click()
  873. 'To Do
  874. MsgBox "Delete Code goes here!"
  875. End Sub
  876. Private Sub mnuFileRename_Click()
  877. 'To Do
  878. MsgBox "Rename Code goes here!"
  879. End Sub
  880. Private Sub mnuFileProperties_Click()
  881. 'To Do
  882. MsgBox "Properties Code goes here!"
  883. End Sub
  884. Private Sub mnuFileMRU_Click(Index As Integer)
  885. 'To Do
  886. MsgBox "MRU Code goes here!"
  887. End Sub
  888. Private Sub mnuFileClose_Click()
  889. 'unload the form
  890. Unload Me
  891. End Sub
  892. Private Sub tvTreeView_Click()
  893. Dim Nodx As Node
  894. Set Nodx = tvTreeView.SelectedItem()
  895. ItemList_ShowNode Nodx
  896. End Sub
  897. Private Sub tvTreeView_KeyUp(KeyCode As Integer, Shift As Integer)
  898. Dim Nodx As Node
  899. Set Nodx = tvTreeView.SelectedItem()
  900. ItemList_ShowNode Nodx
  901. End Sub