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.

6474 lines
260 KiB

  1. VERSION 5.00
  2. Begin {B3E55942-FFD8-11D1-9788-44A620524153} FileExplorer
  3. ClientHeight = 8775
  4. ClientLeft = 0
  5. ClientTop = 0
  6. ClientWidth = 9285
  7. _ExtentX = 16378
  8. _ExtentY = 15478
  9. m_iNextNodeNumber= 7
  10. Persistence.MajorVersion= 0
  11. Persistence.MinorVersion= 12
  12. BeginProperty ImageLists {FFF9A8F6-06CB-11D2-9791-50C320524153}
  13. Persistence.MajorVersion= 0
  14. Persistence.MinorVersion= 12
  15. Count = 4
  16. KeysOnly = 0
  17. BeginProperty Item1 {87BC1809-C8FB-11D1-B44A-30F4BC000000}
  18. Persistence.MajorVersion= 0
  19. Persistence.MinorVersion= 12
  20. Name = "imgSmallFolders"
  21. Index = 1
  22. Key = "imgSmallFolders"
  23. MaskColor = 8388736
  24. BeginProperty ListImages {87BC180B-C8FB-11D1-B44A-30F4BC000000}
  25. Persistence.MajorVersion= 0
  26. Persistence.MinorVersion= 12
  27. Count = 19
  28. KeysOnly = 0
  29. BeginProperty Item1 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  30. Persistence.MajorVersion= 0
  31. Persistence.MinorVersion= 12
  32. Index = 1
  33. Key = "1"
  34. Tag = "0"
  35. Picture = "FileExplorer.dsx":0000
  36. EndProperty
  37. BeginProperty Item2 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  38. Persistence.MajorVersion= 0
  39. Persistence.MinorVersion= 12
  40. Index = 2
  41. Key = "2"
  42. Tag = "0"
  43. Picture = "FileExplorer.dsx":0352
  44. EndProperty
  45. BeginProperty Item3 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  46. Persistence.MajorVersion= 0
  47. Persistence.MinorVersion= 12
  48. Index = 3
  49. Key = "3"
  50. Tag = "0"
  51. Picture = "FileExplorer.dsx":06A4
  52. EndProperty
  53. BeginProperty Item4 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  54. Persistence.MajorVersion= 0
  55. Persistence.MinorVersion= 12
  56. Index = 4
  57. Key = "4"
  58. Tag = "0"
  59. Picture = "FileExplorer.dsx":09F6
  60. EndProperty
  61. BeginProperty Item5 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  62. Persistence.MajorVersion= 0
  63. Persistence.MinorVersion= 12
  64. Index = 5
  65. Key = "5"
  66. Tag = "0"
  67. Picture = "FileExplorer.dsx":0D48
  68. EndProperty
  69. BeginProperty Item6 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  70. Persistence.MajorVersion= 0
  71. Persistence.MinorVersion= 12
  72. Index = 6
  73. Key = "6"
  74. Tag = "0"
  75. Picture = "FileExplorer.dsx":109A
  76. EndProperty
  77. BeginProperty Item7 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  78. Persistence.MajorVersion= 0
  79. Persistence.MinorVersion= 12
  80. Index = 7
  81. Key = "7"
  82. Tag = "0"
  83. Picture = "FileExplorer.dsx":13EC
  84. EndProperty
  85. BeginProperty Item8 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  86. Persistence.MajorVersion= 0
  87. Persistence.MinorVersion= 12
  88. Index = 8
  89. Key = "8"
  90. Tag = "0"
  91. Picture = "FileExplorer.dsx":173E
  92. EndProperty
  93. BeginProperty Item9 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  94. Persistence.MajorVersion= 0
  95. Persistence.MinorVersion= 12
  96. Index = 9
  97. Key = "9"
  98. Tag = "0"
  99. Picture = "FileExplorer.dsx":1A90
  100. EndProperty
  101. BeginProperty Item10 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  102. Persistence.MajorVersion= 0
  103. Persistence.MinorVersion= 12
  104. Index = 10
  105. Key = "10"
  106. Tag = "0"
  107. Picture = "FileExplorer.dsx":1DE2
  108. EndProperty
  109. BeginProperty Item11 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  110. Persistence.MajorVersion= 0
  111. Persistence.MinorVersion= 12
  112. Index = 11
  113. Key = "11"
  114. Tag = "0"
  115. Picture = "FileExplorer.dsx":2134
  116. EndProperty
  117. BeginProperty Item12 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  118. Persistence.MajorVersion= 0
  119. Persistence.MinorVersion= 12
  120. Index = 12
  121. Key = "12"
  122. Tag = "0"
  123. Picture = "FileExplorer.dsx":2486
  124. EndProperty
  125. BeginProperty Item13 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  126. Persistence.MajorVersion= 0
  127. Persistence.MinorVersion= 12
  128. Index = 13
  129. Key = "13"
  130. Tag = "0"
  131. Picture = "FileExplorer.dsx":27D8
  132. EndProperty
  133. BeginProperty Item14 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  134. Persistence.MajorVersion= 0
  135. Persistence.MinorVersion= 12
  136. Index = 14
  137. Key = "14"
  138. Tag = "0"
  139. Picture = "FileExplorer.dsx":2B2A
  140. EndProperty
  141. BeginProperty Item15 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  142. Persistence.MajorVersion= 0
  143. Persistence.MinorVersion= 12
  144. Index = 15
  145. Key = "15"
  146. Tag = "0"
  147. Picture = "FileExplorer.dsx":2E7C
  148. EndProperty
  149. BeginProperty Item16 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  150. Persistence.MajorVersion= 0
  151. Persistence.MinorVersion= 12
  152. Index = 16
  153. Key = "16"
  154. Tag = "0"
  155. Picture = "FileExplorer.dsx":31CE
  156. EndProperty
  157. BeginProperty Item17 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  158. Persistence.MajorVersion= 0
  159. Persistence.MinorVersion= 12
  160. Index = 17
  161. Key = "17"
  162. Tag = "0"
  163. Picture = "FileExplorer.dsx":3520
  164. EndProperty
  165. BeginProperty Item18 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  166. Persistence.MajorVersion= 0
  167. Persistence.MinorVersion= 12
  168. Index = 18
  169. Key = "18"
  170. Tag = "0"
  171. Picture = "FileExplorer.dsx":3872
  172. EndProperty
  173. BeginProperty Item19 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  174. Persistence.MajorVersion= 0
  175. Persistence.MinorVersion= 12
  176. Index = 19
  177. Key = "19"
  178. Tag = "0"
  179. Picture = "FileExplorer.dsx":3BC4
  180. EndProperty
  181. EndProperty
  182. DISPID = 1000
  183. EndProperty
  184. BeginProperty Item2 {87BC1809-C8FB-11D1-B44A-30F4BC000000}
  185. Persistence.MajorVersion= 0
  186. Persistence.MinorVersion= 12
  187. Name = "imgSmallOpenFolders"
  188. Index = 2
  189. Key = "imgSmallOpenFolders"
  190. MaskColor = 8388736
  191. BeginProperty ListImages {87BC180B-C8FB-11D1-B44A-30F4BC000000}
  192. Persistence.MajorVersion= 0
  193. Persistence.MinorVersion= 12
  194. Count = 19
  195. KeysOnly = 0
  196. BeginProperty Item1 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  197. Persistence.MajorVersion= 0
  198. Persistence.MinorVersion= 12
  199. Index = 1
  200. Key = "1"
  201. Tag = "0"
  202. Picture = "FileExplorer.dsx":3F16
  203. EndProperty
  204. BeginProperty Item2 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  205. Persistence.MajorVersion= 0
  206. Persistence.MinorVersion= 12
  207. Index = 2
  208. Key = "2"
  209. Tag = "0"
  210. Picture = "FileExplorer.dsx":4268
  211. EndProperty
  212. BeginProperty Item3 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  213. Persistence.MajorVersion= 0
  214. Persistence.MinorVersion= 12
  215. Index = 3
  216. Key = "3"
  217. Tag = "0"
  218. Picture = "FileExplorer.dsx":45BA
  219. EndProperty
  220. BeginProperty Item4 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  221. Persistence.MajorVersion= 0
  222. Persistence.MinorVersion= 12
  223. Index = 4
  224. Key = "4"
  225. Tag = "0"
  226. Picture = "FileExplorer.dsx":490C
  227. EndProperty
  228. BeginProperty Item5 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  229. Persistence.MajorVersion= 0
  230. Persistence.MinorVersion= 12
  231. Index = 5
  232. Key = "5"
  233. Tag = "0"
  234. Picture = "FileExplorer.dsx":4C5E
  235. EndProperty
  236. BeginProperty Item6 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  237. Persistence.MajorVersion= 0
  238. Persistence.MinorVersion= 12
  239. Index = 6
  240. Key = "6"
  241. Tag = "0"
  242. Picture = "FileExplorer.dsx":4FB0
  243. EndProperty
  244. BeginProperty Item7 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  245. Persistence.MajorVersion= 0
  246. Persistence.MinorVersion= 12
  247. Index = 7
  248. Key = "7"
  249. Tag = "0"
  250. Picture = "FileExplorer.dsx":5302
  251. EndProperty
  252. BeginProperty Item8 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  253. Persistence.MajorVersion= 0
  254. Persistence.MinorVersion= 12
  255. Index = 8
  256. Key = "8"
  257. Tag = "0"
  258. Picture = "FileExplorer.dsx":5654
  259. EndProperty
  260. BeginProperty Item9 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  261. Persistence.MajorVersion= 0
  262. Persistence.MinorVersion= 12
  263. Index = 9
  264. Key = "9"
  265. Tag = "0"
  266. Picture = "FileExplorer.dsx":59A6
  267. EndProperty
  268. BeginProperty Item10 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  269. Persistence.MajorVersion= 0
  270. Persistence.MinorVersion= 12
  271. Index = 10
  272. Key = "10"
  273. Tag = "0"
  274. Picture = "FileExplorer.dsx":5CF8
  275. EndProperty
  276. BeginProperty Item11 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  277. Persistence.MajorVersion= 0
  278. Persistence.MinorVersion= 12
  279. Index = 11
  280. Key = "11"
  281. Tag = "0"
  282. Picture = "FileExplorer.dsx":604A
  283. EndProperty
  284. BeginProperty Item12 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  285. Persistence.MajorVersion= 0
  286. Persistence.MinorVersion= 12
  287. Index = 12
  288. Key = "12"
  289. Tag = "0"
  290. Picture = "FileExplorer.dsx":639C
  291. EndProperty
  292. BeginProperty Item13 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  293. Persistence.MajorVersion= 0
  294. Persistence.MinorVersion= 12
  295. Index = 13
  296. Key = "13"
  297. Tag = "0"
  298. Picture = "FileExplorer.dsx":66EE
  299. EndProperty
  300. BeginProperty Item14 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  301. Persistence.MajorVersion= 0
  302. Persistence.MinorVersion= 12
  303. Index = 14
  304. Key = "14"
  305. Tag = "0"
  306. Picture = "FileExplorer.dsx":6A40
  307. EndProperty
  308. BeginProperty Item15 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  309. Persistence.MajorVersion= 0
  310. Persistence.MinorVersion= 12
  311. Index = 15
  312. Key = "15"
  313. Tag = "0"
  314. Picture = "FileExplorer.dsx":6D92
  315. EndProperty
  316. BeginProperty Item16 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  317. Persistence.MajorVersion= 0
  318. Persistence.MinorVersion= 12
  319. Index = 16
  320. Key = "16"
  321. Tag = "0"
  322. Picture = "FileExplorer.dsx":70E4
  323. EndProperty
  324. BeginProperty Item17 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  325. Persistence.MajorVersion= 0
  326. Persistence.MinorVersion= 12
  327. Index = 17
  328. Key = "17"
  329. Tag = "0"
  330. Picture = "FileExplorer.dsx":7436
  331. EndProperty
  332. BeginProperty Item18 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  333. Persistence.MajorVersion= 0
  334. Persistence.MinorVersion= 12
  335. Index = 18
  336. Key = "18"
  337. Tag = "0"
  338. Picture = "FileExplorer.dsx":7788
  339. EndProperty
  340. BeginProperty Item19 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  341. Persistence.MajorVersion= 0
  342. Persistence.MinorVersion= 12
  343. Index = 19
  344. Key = "19"
  345. Tag = "0"
  346. Picture = "FileExplorer.dsx":7ADA
  347. EndProperty
  348. EndProperty
  349. DISPID = 1001
  350. EndProperty
  351. BeginProperty Item3 {87BC1809-C8FB-11D1-B44A-30F4BC000000}
  352. Persistence.MajorVersion= 0
  353. Persistence.MinorVersion= 12
  354. Name = "imgLargeFolders"
  355. Index = 3
  356. Key = "imgLargeFolders"
  357. MaskColor = 8388736
  358. BeginProperty ListImages {87BC180B-C8FB-11D1-B44A-30F4BC000000}
  359. Persistence.MajorVersion= 0
  360. Persistence.MinorVersion= 12
  361. Count = 19
  362. KeysOnly = 0
  363. BeginProperty Item1 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  364. Persistence.MajorVersion= 0
  365. Persistence.MinorVersion= 12
  366. Index = 1
  367. Key = "1"
  368. Tag = "0"
  369. Picture = "FileExplorer.dsx":7E2C
  370. EndProperty
  371. BeginProperty Item2 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  372. Persistence.MajorVersion= 0
  373. Persistence.MinorVersion= 12
  374. Index = 2
  375. Key = "2"
  376. Tag = "0"
  377. Picture = "FileExplorer.dsx":8A7E
  378. EndProperty
  379. BeginProperty Item3 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  380. Persistence.MajorVersion= 0
  381. Persistence.MinorVersion= 12
  382. Index = 3
  383. Key = "3"
  384. Tag = "0"
  385. Picture = "FileExplorer.dsx":96D0
  386. EndProperty
  387. BeginProperty Item4 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  388. Persistence.MajorVersion= 0
  389. Persistence.MinorVersion= 12
  390. Index = 4
  391. Key = "4"
  392. Tag = "0"
  393. Picture = "FileExplorer.dsx":A322
  394. EndProperty
  395. BeginProperty Item5 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  396. Persistence.MajorVersion= 0
  397. Persistence.MinorVersion= 12
  398. Index = 5
  399. Key = "5"
  400. Tag = "0"
  401. Picture = "FileExplorer.dsx":AF74
  402. EndProperty
  403. BeginProperty Item6 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  404. Persistence.MajorVersion= 0
  405. Persistence.MinorVersion= 12
  406. Index = 6
  407. Key = "6"
  408. Tag = "0"
  409. Picture = "FileExplorer.dsx":BBC6
  410. EndProperty
  411. BeginProperty Item7 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  412. Persistence.MajorVersion= 0
  413. Persistence.MinorVersion= 12
  414. Index = 7
  415. Key = "7"
  416. Tag = "0"
  417. Picture = "FileExplorer.dsx":C818
  418. EndProperty
  419. BeginProperty Item8 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  420. Persistence.MajorVersion= 0
  421. Persistence.MinorVersion= 12
  422. Index = 8
  423. Key = "8"
  424. Tag = "0"
  425. Picture = "FileExplorer.dsx":D46A
  426. EndProperty
  427. BeginProperty Item9 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  428. Persistence.MajorVersion= 0
  429. Persistence.MinorVersion= 12
  430. Index = 9
  431. Key = "9"
  432. Tag = "0"
  433. Picture = "FileExplorer.dsx":E0BC
  434. EndProperty
  435. BeginProperty Item10 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  436. Persistence.MajorVersion= 0
  437. Persistence.MinorVersion= 12
  438. Index = 10
  439. Key = "10"
  440. Tag = "0"
  441. Picture = "FileExplorer.dsx":ED0E
  442. EndProperty
  443. BeginProperty Item11 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  444. Persistence.MajorVersion= 0
  445. Persistence.MinorVersion= 12
  446. Index = 11
  447. Key = "11"
  448. Tag = "0"
  449. Picture = "FileExplorer.dsx":F960
  450. EndProperty
  451. BeginProperty Item12 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  452. Persistence.MajorVersion= 0
  453. Persistence.MinorVersion= 12
  454. Index = 12
  455. Key = "12"
  456. Tag = "0"
  457. Picture = "FileExplorer.dsx":105B2
  458. EndProperty
  459. BeginProperty Item13 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  460. Persistence.MajorVersion= 0
  461. Persistence.MinorVersion= 12
  462. Index = 13
  463. Key = "13"
  464. Tag = "0"
  465. Picture = "FileExplorer.dsx":11204
  466. EndProperty
  467. BeginProperty Item14 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  468. Persistence.MajorVersion= 0
  469. Persistence.MinorVersion= 12
  470. Index = 14
  471. Key = "14"
  472. Tag = "0"
  473. Picture = "FileExplorer.dsx":11E56
  474. EndProperty
  475. BeginProperty Item15 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  476. Persistence.MajorVersion= 0
  477. Persistence.MinorVersion= 12
  478. Index = 15
  479. Key = "15"
  480. Tag = "0"
  481. Picture = "FileExplorer.dsx":12AA8
  482. EndProperty
  483. BeginProperty Item16 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  484. Persistence.MajorVersion= 0
  485. Persistence.MinorVersion= 12
  486. Index = 16
  487. Key = "16"
  488. Tag = "0"
  489. Picture = "FileExplorer.dsx":136FA
  490. EndProperty
  491. BeginProperty Item17 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  492. Persistence.MajorVersion= 0
  493. Persistence.MinorVersion= 12
  494. Index = 17
  495. Key = "17"
  496. Tag = "0"
  497. Picture = "FileExplorer.dsx":1434C
  498. EndProperty
  499. BeginProperty Item18 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  500. Persistence.MajorVersion= 0
  501. Persistence.MinorVersion= 12
  502. Index = 18
  503. Key = "18"
  504. Tag = "0"
  505. Picture = "FileExplorer.dsx":14F9E
  506. EndProperty
  507. BeginProperty Item19 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  508. Persistence.MajorVersion= 0
  509. Persistence.MinorVersion= 12
  510. Index = 19
  511. Key = "19"
  512. Tag = "0"
  513. Picture = "FileExplorer.dsx":15BF0
  514. EndProperty
  515. EndProperty
  516. DISPID = 1002
  517. EndProperty
  518. BeginProperty Item4 {87BC1809-C8FB-11D1-B44A-30F4BC000000}
  519. Persistence.MajorVersion= 0
  520. Persistence.MinorVersion= 12
  521. Name = "imgButtons"
  522. Index = 4
  523. Key = "imgButtons"
  524. MaskColor = 8388736
  525. BeginProperty ListImages {87BC180B-C8FB-11D1-B44A-30F4BC000000}
  526. Persistence.MajorVersion= 0
  527. Persistence.MinorVersion= 12
  528. Count = 5
  529. KeysOnly = 0
  530. BeginProperty Item1 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  531. Persistence.MajorVersion= 0
  532. Persistence.MinorVersion= 12
  533. Index = 1
  534. Key = "1"
  535. Tag = "0"
  536. Picture = "FileExplorer.dsx":16842
  537. EndProperty
  538. BeginProperty Item2 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  539. Persistence.MajorVersion= 0
  540. Persistence.MinorVersion= 12
  541. Index = 2
  542. Key = "2"
  543. Tag = "0"
  544. Picture = "FileExplorer.dsx":16B94
  545. EndProperty
  546. BeginProperty Item3 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  547. Persistence.MajorVersion= 0
  548. Persistence.MinorVersion= 12
  549. Index = 3
  550. Key = "3"
  551. Tag = "0"
  552. Picture = "FileExplorer.dsx":16EE6
  553. EndProperty
  554. BeginProperty Item4 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  555. Persistence.MajorVersion= 0
  556. Persistence.MinorVersion= 12
  557. Index = 4
  558. Key = "4"
  559. Tag = "0"
  560. Picture = "FileExplorer.dsx":17238
  561. EndProperty
  562. BeginProperty Item5 {87BC180D-C8FB-11D1-B44A-30F4BC000000}
  563. Persistence.MajorVersion= 0
  564. Persistence.MinorVersion= 12
  565. Index = 5
  566. Key = "5"
  567. Tag = "0"
  568. Picture = "FileExplorer.dsx":1758A
  569. EndProperty
  570. EndProperty
  571. DISPID = 1003
  572. EndProperty
  573. EndProperty
  574. BeginProperty Menus {11517450-27FE-11D3-AA41-00104B880587}
  575. Persistence.MajorVersion= 0
  576. Persistence.MinorVersion= 12
  577. Count = 4
  578. KeysOnly = 0
  579. BeginProperty Item1 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  580. Persistence.MajorVersion= 0
  581. Persistence.MinorVersion= 12
  582. Caption = "Menu1"
  583. Visible = -1
  584. Checked = 0
  585. Enabled = -1
  586. Grayed = 0
  587. MenuBreak = 0
  588. MenuBarBreak = 0
  589. Default = 0
  590. Index = 1
  591. Name = "mnuContext"
  592. Tag = 0
  593. StatusBarText = ""
  594. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  595. Persistence.MajorVersion= 0
  596. Persistence.MinorVersion= 12
  597. Count = 2
  598. KeysOnly = 0
  599. BeginProperty Item1 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  600. Persistence.MajorVersion= 0
  601. Persistence.MinorVersion= 12
  602. Caption = "Run"
  603. Visible = -1
  604. Checked = 0
  605. Enabled = -1
  606. Grayed = 0
  607. MenuBreak = 0
  608. MenuBarBreak = 0
  609. Default = 0
  610. Index = 1
  611. Name = "mnuRun"
  612. Tag = 0
  613. StatusBarText = ""
  614. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  615. Persistence.MajorVersion= 0
  616. Persistence.MinorVersion= 12
  617. Count = 0
  618. KeysOnly = 0
  619. EndProperty
  620. Key = "4"
  621. DISPID = 1011
  622. EndProperty
  623. BeginProperty Item2 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  624. Persistence.MajorVersion= 0
  625. Persistence.MinorVersion= 12
  626. Caption = "RunAs"
  627. Visible = -1
  628. Checked = 0
  629. Enabled = -1
  630. Grayed = 0
  631. MenuBreak = 0
  632. MenuBarBreak = 0
  633. Default = 0
  634. Index = 2
  635. Name = "mnuRunAs"
  636. Tag = 0
  637. StatusBarText = ""
  638. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  639. Persistence.MajorVersion= 0
  640. Persistence.MinorVersion= 12
  641. Count = 0
  642. KeysOnly = 0
  643. EndProperty
  644. Key = "5"
  645. DISPID = 1012
  646. EndProperty
  647. EndProperty
  648. Key = "1"
  649. DISPID = 1007
  650. EndProperty
  651. BeginProperty Item2 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  652. Persistence.MajorVersion= 0
  653. Persistence.MinorVersion= 12
  654. Caption = "Menu1"
  655. Visible = -1
  656. Checked = 0
  657. Enabled = -1
  658. Grayed = 0
  659. MenuBreak = 0
  660. MenuBarBreak = 0
  661. Default = 0
  662. Index = 2
  663. Name = "mnuNew"
  664. Tag = 0
  665. StatusBarText = ""
  666. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  667. Persistence.MajorVersion= 0
  668. Persistence.MinorVersion= 12
  669. Count = 1
  670. KeysOnly = 0
  671. BeginProperty Item1 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  672. Persistence.MajorVersion= 0
  673. Persistence.MinorVersion= 12
  674. Caption = "Folder"
  675. Visible = -1
  676. Checked = 0
  677. Enabled = -1
  678. Grayed = 0
  679. MenuBreak = 0
  680. MenuBarBreak = 0
  681. Default = 0
  682. Index = 1
  683. Name = "mnuNewFolder"
  684. Tag = 0
  685. StatusBarText = "Creates a new foolder under the selected folder"
  686. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  687. Persistence.MajorVersion= 0
  688. Persistence.MinorVersion= 12
  689. Count = 0
  690. KeysOnly = 0
  691. EndProperty
  692. Key = "1"
  693. DISPID = 1016
  694. EndProperty
  695. EndProperty
  696. Key = "2"
  697. DISPID = 1015
  698. EndProperty
  699. BeginProperty Item3 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  700. Persistence.MajorVersion= 0
  701. Persistence.MinorVersion= 12
  702. Caption = "Menu1"
  703. Visible = -1
  704. Checked = 0
  705. Enabled = -1
  706. Grayed = 0
  707. MenuBreak = 0
  708. MenuBarBreak = 0
  709. Default = 0
  710. Index = 3
  711. Name = "mnuFilterOp"
  712. StatusBarText = ""
  713. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  714. Persistence.MajorVersion= 0
  715. Persistence.MinorVersion= 12
  716. Count = 2
  717. KeysOnly = 0
  718. BeginProperty Item1 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  719. Persistence.MajorVersion= 0
  720. Persistence.MinorVersion= 12
  721. Caption = "Filter by name"
  722. Visible = -1
  723. Checked = 0
  724. Enabled = -1
  725. Grayed = 0
  726. MenuBreak = 0
  727. MenuBarBreak = 0
  728. Default = 0
  729. Index = 1
  730. Name = "mnuFilterByName"
  731. StatusBarText = ""
  732. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  733. Persistence.MajorVersion= 0
  734. Persistence.MinorVersion= 12
  735. Count = 0
  736. KeysOnly = 0
  737. EndProperty
  738. Key = "Menu1"
  739. DISPID = 1018
  740. EndProperty
  741. BeginProperty Item2 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  742. Persistence.MajorVersion= 0
  743. Persistence.MinorVersion= 12
  744. Caption = "Filter by extension"
  745. Visible = -1
  746. Checked = 0
  747. Enabled = -1
  748. Grayed = 0
  749. MenuBreak = 0
  750. MenuBarBreak = 0
  751. Default = 0
  752. Index = 2
  753. Name = "mnuFilterByExt"
  754. StatusBarText = ""
  755. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  756. Persistence.MajorVersion= 0
  757. Persistence.MinorVersion= 12
  758. Count = 0
  759. KeysOnly = 0
  760. EndProperty
  761. Key = "Menu1"
  762. DISPID = 1019
  763. EndProperty
  764. EndProperty
  765. Key = "Menu1"
  766. DISPID = 1017
  767. EndProperty
  768. BeginProperty Item4 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  769. Persistence.MajorVersion= 0
  770. Persistence.MinorVersion= 12
  771. Caption = "Menu1"
  772. Visible = -1
  773. Checked = 0
  774. Enabled = -1
  775. Grayed = 0
  776. MenuBreak = 0
  777. MenuBarBreak = 0
  778. Default = 0
  779. Index = 4
  780. Name = "mnuNewURL"
  781. StatusBarText = ""
  782. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  783. Persistence.MajorVersion= 0
  784. Persistence.MinorVersion= 12
  785. Count = 1
  786. KeysOnly = 0
  787. BeginProperty Item1 {91CC37D5-CE2B-11D1-B44D-7E92AF000000}
  788. Persistence.MajorVersion= 0
  789. Persistence.MinorVersion= 12
  790. Caption = "URL..."
  791. Visible = -1
  792. Checked = 0
  793. Enabled = -1
  794. Grayed = 0
  795. MenuBreak = 0
  796. MenuBarBreak = 0
  797. Default = 0
  798. Index = 1
  799. Name = "mnuURL"
  800. StatusBarText = ""
  801. BeginProperty Children {11517450-27FE-11D3-AA41-00104B880587}
  802. Persistence.MajorVersion= 0
  803. Persistence.MinorVersion= 12
  804. Count = 0
  805. KeysOnly = 0
  806. EndProperty
  807. Key = "Menu1"
  808. DISPID = 1021
  809. EndProperty
  810. EndProperty
  811. Key = "Menu1"
  812. DISPID = 1020
  813. EndProperty
  814. EndProperty
  815. BeginProperty Toolbars {FFF9A8FA-06CB-11D2-9791-50C320524153}
  816. Persistence.MajorVersion= 0
  817. Persistence.MinorVersion= 12
  818. Count = 2
  819. KeysOnly = 0
  820. BeginProperty Item1 {91CC37E1-CE2B-11D1-B44D-7E92AF000000}
  821. Persistence.MajorVersion= 0
  822. Persistence.MinorVersion= 12
  823. Index = 1
  824. Key = "tbrFileMgr"
  825. Name = "tbrFileMgr"
  826. Tag = "0"
  827. BeginProperty Buttons {8B034115-FBB2-11D1-9785-EAA220524153}
  828. Persistence.MajorVersion= 0
  829. Persistence.MinorVersion= 12
  830. Count = 3
  831. KeysOnly = 0
  832. BeginProperty Item1 {91CC37E6-CE2B-11D1-B44D-7E92AF000000}
  833. Persistence.MajorVersion= 0
  834. Persistence.MinorVersion= 12
  835. BeginProperty ButtonMenus {91CC37E7-CE2B-11D1-B44D-7E92AF000000}
  836. Persistence.MajorVersion= 0
  837. Persistence.MinorVersion= 12
  838. Count = 0
  839. KeysOnly = 0
  840. EndProperty
  841. Caption = "Add"
  842. Enabled = -1
  843. Image = 1
  844. Index = 1
  845. Key = "1"
  846. MixedState = 0
  847. Style = 0
  848. Tag = ""
  849. ToolTipText = "Add a new folder"
  850. Value = 0
  851. Visible = -1
  852. EndProperty
  853. BeginProperty Item2 {91CC37E6-CE2B-11D1-B44D-7E92AF000000}
  854. Persistence.MajorVersion= 0
  855. Persistence.MinorVersion= 12
  856. BeginProperty ButtonMenus {91CC37E7-CE2B-11D1-B44D-7E92AF000000}
  857. Persistence.MajorVersion= 0
  858. Persistence.MinorVersion= 12
  859. Count = 0
  860. KeysOnly = 0
  861. EndProperty
  862. Caption = "Run"
  863. Enabled = -1
  864. Image = 4
  865. Index = 2
  866. Key = "2"
  867. MixedState = 0
  868. Style = 0
  869. Tag = ""
  870. ToolTipText = "Run"
  871. Value = 0
  872. Visible = -1
  873. EndProperty
  874. BeginProperty Item3 {91CC37E6-CE2B-11D1-B44D-7E92AF000000}
  875. Persistence.MajorVersion= 0
  876. Persistence.MinorVersion= 12
  877. BeginProperty ButtonMenus {91CC37E7-CE2B-11D1-B44D-7E92AF000000}
  878. Persistence.MajorVersion= 0
  879. Persistence.MinorVersion= 12
  880. Count = 0
  881. KeysOnly = 0
  882. EndProperty
  883. Caption = "RunAs"
  884. Enabled = -1
  885. Image = 5
  886. Index = 3
  887. Key = "3"
  888. MixedState = 0
  889. Style = 0
  890. Tag = ""
  891. ToolTipText = "Run with a special command line"
  892. Value = 0
  893. Visible = -1
  894. EndProperty
  895. EndProperty
  896. Images = "imgButtons"
  897. DISPID = 1005
  898. EndProperty
  899. BeginProperty Item2 {91CC37E1-CE2B-11D1-B44D-7E92AF000000}
  900. Persistence.MajorVersion= 0
  901. Persistence.MinorVersion= 12
  902. Index = 2
  903. Key = "tbrMenuButton"
  904. Name = "tbrMenuButton"
  905. Tag = "0"
  906. BeginProperty Buttons {8B034115-FBB2-11D1-9785-EAA220524153}
  907. Persistence.MajorVersion= 0
  908. Persistence.MinorVersion= 12
  909. Count = 1
  910. KeysOnly = 0
  911. BeginProperty Item1 {91CC37E6-CE2B-11D1-B44D-7E92AF000000}
  912. Persistence.MajorVersion= 0
  913. Persistence.MinorVersion= 12
  914. BeginProperty ButtonMenus {91CC37E7-CE2B-11D1-B44D-7E92AF000000}
  915. Persistence.MajorVersion= 0
  916. Persistence.MinorVersion= 12
  917. Count = 4
  918. KeysOnly = 0
  919. BeginProperty Item1 {91CC37E9-CE2B-11D1-B44D-7E92AF000000}
  920. Persistence.MajorVersion= 0
  921. Persistence.MinorVersion= 12
  922. Enabled = -1
  923. Index = 1
  924. Key = "1"
  925. Tag = ""
  926. Text = "New Folder"
  927. Visible = -1
  928. Checked = 0
  929. Grayed = -1
  930. Separator = 0
  931. MenuBreak = 0
  932. MenuBarBreak = 0
  933. EndProperty
  934. BeginProperty Item2 {91CC37E9-CE2B-11D1-B44D-7E92AF000000}
  935. Persistence.MajorVersion= 0
  936. Persistence.MinorVersion= 12
  937. Enabled = -1
  938. Index = 2
  939. Key = "2"
  940. Tag = ""
  941. Text = "Run"
  942. Visible = -1
  943. Checked = 0
  944. Grayed = -1
  945. Separator = 0
  946. MenuBreak = 0
  947. MenuBarBreak = 0
  948. EndProperty
  949. BeginProperty Item3 {91CC37E9-CE2B-11D1-B44D-7E92AF000000}
  950. Persistence.MajorVersion= 0
  951. Persistence.MinorVersion= 12
  952. Enabled = -1
  953. Index = 3
  954. Key = "3"
  955. Tag = ""
  956. Text = "Run As..."
  957. Visible = -1
  958. Checked = 0
  959. Grayed = -1
  960. Separator = 0
  961. MenuBreak = 0
  962. MenuBarBreak = 0
  963. EndProperty
  964. BeginProperty Item4 {91CC37E9-CE2B-11D1-B44D-7E92AF000000}
  965. Persistence.MajorVersion= 0
  966. Persistence.MinorVersion= 12
  967. Enabled = -1
  968. Index = 4
  969. Key = "4"
  970. Tag = ""
  971. Text = "Configuration..."
  972. Visible = -1
  973. Checked = 0
  974. Grayed = 0
  975. Separator = 0
  976. MenuBreak = 0
  977. MenuBarBreak = 0
  978. EndProperty
  979. EndProperty
  980. Caption = "Explorer"
  981. Enabled = -1
  982. Image = 1
  983. Index = 1
  984. Key = ""
  985. MixedState = 0
  986. Style = 16
  987. Tag = ""
  988. ToolTipText = "File Explorer Actions"
  989. Value = 0
  990. Visible = -1
  991. EndProperty
  992. EndProperty
  993. Images = "imgButtons"
  994. DISPID = 1006
  995. EndProperty
  996. EndProperty
  997. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  998. Persistence.MajorVersion= 0
  999. Persistence.MinorVersion= 12
  1000. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1001. Persistence.MajorVersion= 0
  1002. Persistence.MinorVersion= 12
  1003. Count = 3
  1004. KeysOnly = 0
  1005. BeginProperty Item1 {FFF9A8EC-06CB-11D2-9791-50C320524153}
  1006. Persistence.MajorVersion= 0
  1007. Persistence.MinorVersion= 12
  1008. Index = 1
  1009. Key = "lvExplorerFiles"
  1010. Name = "lvExplorerFiles"
  1011. AddToViewMenu = 0
  1012. ViewMenuText = ""
  1013. ViewMenuStatusBarText= ""
  1014. DefaultItemTypeGUID= "{D2B294B2-9F64-11d2-97E1-00104B880587}"
  1015. Extensible = -1
  1016. BeginProperty ListView {87BC180F-C8FB-11D1-B44A-30F4BC000000}
  1017. Persistence.MajorVersion= 0
  1018. Persistence.MinorVersion= 12
  1019. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1020. Persistence.MajorVersion= 0
  1021. Persistence.MinorVersion= 12
  1022. Count = 4
  1023. KeysOnly = 0
  1024. BeginProperty Item1 {3B15D613-CD57-11D1-B44C-44750B000000}
  1025. Persistence.MajorVersion= 0
  1026. Persistence.MinorVersion= 12
  1027. Index = 1
  1028. Key = "1"
  1029. Tag = 0
  1030. Text = "Name"
  1031. Object.Width = 175
  1032. Alignment = 0
  1033. Hidden = 0
  1034. TextFilter = ""
  1035. TextFilterMaxLen= 260
  1036. NumericFilter = ""
  1037. EndProperty
  1038. BeginProperty Item2 {3B15D613-CD57-11D1-B44C-44750B000000}
  1039. Persistence.MajorVersion= 0
  1040. Persistence.MinorVersion= 12
  1041. Index = 2
  1042. Key = "2"
  1043. Tag = 0
  1044. Text = "Size"
  1045. Object.Width = 125
  1046. Alignment = 0
  1047. Hidden = 0
  1048. TextFilter = ""
  1049. TextFilterMaxLen= 260
  1050. NumericFilter = ""
  1051. EndProperty
  1052. BeginProperty Item3 {3B15D613-CD57-11D1-B44C-44750B000000}
  1053. Persistence.MajorVersion= 0
  1054. Persistence.MinorVersion= 12
  1055. Index = 3
  1056. Key = "3"
  1057. Tag = 0
  1058. Text = "Date"
  1059. Object.Width = 125
  1060. Alignment = 0
  1061. Hidden = 0
  1062. TextFilter = ""
  1063. TextFilterMaxLen= 260
  1064. NumericFilter = ""
  1065. EndProperty
  1066. BeginProperty Item4 {3B15D613-CD57-11D1-B44C-44750B000000}
  1067. Persistence.MajorVersion= 0
  1068. Persistence.MinorVersion= 12
  1069. Index = 4
  1070. Key = "4"
  1071. Tag = 0
  1072. Text = "Attributes"
  1073. Object.Width = 75
  1074. Alignment = 0
  1075. Hidden = 0
  1076. TextFilter = ""
  1077. TextFilterMaxLen= 260
  1078. NumericFilter = ""
  1079. EndProperty
  1080. EndProperty
  1081. Icons = "imgLargeFolders"
  1082. SmallIcons = "imgSmallFolders"
  1083. Sorted = 0
  1084. SortKey = 1
  1085. SortOrder = 0
  1086. View = 4
  1087. Tag = 0
  1088. Virtual = 0
  1089. UseFontLinking = 0
  1090. MultiSelect = -1
  1091. HideSelection = 0
  1092. SortHeader = -1
  1093. SortIcon = -1
  1094. FilterChangeTimeout= 500
  1095. ShowChildScopeItems= -1
  1096. LexicalSort = 0
  1097. EndProperty
  1098. EndProperty
  1099. BeginProperty Item2 {FFF9A8EC-06CB-11D2-9791-50C320524153}
  1100. Persistence.MajorVersion= 0
  1101. Persistence.MinorVersion= 12
  1102. Index = 2
  1103. Key = "lvExplorerMain"
  1104. Name = "lvExplorerMain"
  1105. AddToViewMenu = 0
  1106. ViewMenuText = ""
  1107. ViewMenuStatusBarText= ""
  1108. DefaultItemTypeGUID= "{D2B294B3-9F64-11d2-97E1-00104B880587}"
  1109. Extensible = 0
  1110. BeginProperty ListView {87BC180F-C8FB-11D1-B44A-30F4BC000000}
  1111. Persistence.MajorVersion= 0
  1112. Persistence.MinorVersion= 12
  1113. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1114. Persistence.MajorVersion= 0
  1115. Persistence.MinorVersion= 12
  1116. Count = 4
  1117. KeysOnly = 0
  1118. BeginProperty Item1 {3B15D613-CD57-11D1-B44C-44750B000000}
  1119. Persistence.MajorVersion= 0
  1120. Persistence.MinorVersion= 12
  1121. Index = 1
  1122. Key = "1"
  1123. Tag = 0
  1124. Text = "Name"
  1125. Object.Width = 150
  1126. Alignment = 0
  1127. Hidden = 0
  1128. TextFilter = ""
  1129. TextFilterMaxLen= 260
  1130. NumericFilter = ""
  1131. EndProperty
  1132. BeginProperty Item2 {3B15D613-CD57-11D1-B44C-44750B000000}
  1133. Persistence.MajorVersion= 0
  1134. Persistence.MinorVersion= 12
  1135. Index = 2
  1136. Key = "5"
  1137. Tag = 0
  1138. Text = "Type"
  1139. Object.Width = 100
  1140. Alignment = 0
  1141. Hidden = 0
  1142. TextFilter = ""
  1143. TextFilterMaxLen= 260
  1144. NumericFilter = ""
  1145. EndProperty
  1146. BeginProperty Item3 {3B15D613-CD57-11D1-B44C-44750B000000}
  1147. Persistence.MajorVersion= 0
  1148. Persistence.MinorVersion= 12
  1149. Index = 3
  1150. Key = "6"
  1151. Tag = 0
  1152. Text = "Total Size"
  1153. Object.Width = 100
  1154. Alignment = 0
  1155. Hidden = 0
  1156. TextFilter = ""
  1157. TextFilterMaxLen= 260
  1158. NumericFilter = ""
  1159. EndProperty
  1160. BeginProperty Item4 {3B15D613-CD57-11D1-B44C-44750B000000}
  1161. Persistence.MajorVersion= 0
  1162. Persistence.MinorVersion= 12
  1163. Index = 4
  1164. Key = "7"
  1165. Tag = 0
  1166. Text = "Free Space"
  1167. Object.Width = 100
  1168. Alignment = 0
  1169. Hidden = 0
  1170. TextFilter = ""
  1171. TextFilterMaxLen= 260
  1172. NumericFilter = ""
  1173. EndProperty
  1174. EndProperty
  1175. Icons = "imgLargeFolders"
  1176. SmallIcons = "imgSmallFolders"
  1177. Sorted = 0
  1178. SortKey = 0
  1179. SortOrder = 0
  1180. View = 3
  1181. Tag = 0
  1182. Virtual = 0
  1183. UseFontLinking = 0
  1184. MultiSelect = 0
  1185. HideSelection = 0
  1186. SortHeader = -1
  1187. SortIcon = -1
  1188. FilterChangeTimeout= 500
  1189. ShowChildScopeItems= -1
  1190. LexicalSort = 0
  1191. EndProperty
  1192. EndProperty
  1193. BeginProperty Item3 {FFF9A8EC-06CB-11D2-9791-50C320524153}
  1194. Persistence.MajorVersion= 0
  1195. Persistence.MinorVersion= 12
  1196. Index = 3
  1197. Key = "lvExplorerTop"
  1198. Name = "lvExplorerTop"
  1199. AddToViewMenu = -1
  1200. ViewMenuText = "File Explorer"
  1201. ViewMenuStatusBarText= "Start Using File Explorer"
  1202. DefaultItemTypeGUID= "{D2B294B5-9F64-11d2-97E1-00104B880587}"
  1203. Extensible = 0
  1204. BeginProperty ListView {87BC180F-C8FB-11D1-B44A-30F4BC000000}
  1205. Persistence.MajorVersion= 0
  1206. Persistence.MinorVersion= 12
  1207. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1208. Persistence.MajorVersion= 0
  1209. Persistence.MinorVersion= 12
  1210. Count = 1
  1211. KeysOnly = 0
  1212. BeginProperty Item1 {3B15D613-CD57-11D1-B44C-44750B000000}
  1213. Persistence.MajorVersion= 0
  1214. Persistence.MinorVersion= 12
  1215. Index = 1
  1216. Key = "1"
  1217. Tag = 0
  1218. Text = "Name"
  1219. Object.Width = 200
  1220. Alignment = 0
  1221. Hidden = 0
  1222. TextFilter = ""
  1223. TextFilterMaxLen= 260
  1224. NumericFilter = ""
  1225. EndProperty
  1226. EndProperty
  1227. Icons = "imgLargeFolders"
  1228. SmallIcons = "imgSmallFolders"
  1229. Sorted = 0
  1230. SortKey = 0
  1231. SortOrder = 0
  1232. View = 0
  1233. Tag = 0
  1234. Virtual = 0
  1235. UseFontLinking = 0
  1236. MultiSelect = 0
  1237. HideSelection = 0
  1238. SortHeader = -1
  1239. SortIcon = -1
  1240. FilterChangeTimeout= 500
  1241. ShowChildScopeItems= -1
  1242. LexicalSort = 0
  1243. EndProperty
  1244. EndProperty
  1245. EndProperty
  1246. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1247. Persistence.MajorVersion= 0
  1248. Persistence.MinorVersion= 12
  1249. Count = 1
  1250. KeysOnly = 0
  1251. BeginProperty Item1 {FFF9A8EE-06CB-11D2-9791-50C320524153}
  1252. Persistence.MajorVersion= 0
  1253. Persistence.MinorVersion= 12
  1254. Index = 1
  1255. Key = "ovAbout"
  1256. Name = "ovAbout"
  1257. Tag = 0
  1258. AddToViewMenu = -1
  1259. ViewMenuText = "About..."
  1260. ViewMenuStatusBarText= "About File Explorer"
  1261. ProgID = "FileExplorerSample.AboutCtl"
  1262. AlwaysCreateNewOCX= -1
  1263. EndProperty
  1264. EndProperty
  1265. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1266. Persistence.MajorVersion= 0
  1267. Persistence.MinorVersion= 12
  1268. Count = 0
  1269. KeysOnly = 0
  1270. EndProperty
  1271. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1272. Persistence.MajorVersion= 0
  1273. Persistence.MinorVersion= 12
  1274. Count = 1
  1275. KeysOnly = 0
  1276. BeginProperty Item1 {FFF9A8F2-06CB-11D2-9791-50C320524153}
  1277. Persistence.MajorVersion= 0
  1278. Persistence.MinorVersion= 12
  1279. Name = "StaticNodeTaskpad"
  1280. Index = 1
  1281. Key = "StaticNodeTaskpad"
  1282. AddToViewMenu = -1
  1283. ViewMenuText = "Welcome to File Explorer"
  1284. ViewMenuStatusBarText= "First Time Users Select this View"
  1285. UseWhenTaskpadViewPreferred= -1
  1286. BeginProperty Taskpad {861481F2-D867-11D1-B450-C43058000000}
  1287. Persistence.MajorVersion= 0
  1288. Persistence.MinorVersion= 12
  1289. Name = "StaticNodeTaskpad"
  1290. Type = 3
  1291. Title = "File Explorer"
  1292. URL = ""
  1293. DescriptiveText = "Welcome to the Visual Basic Snap-in Sample"
  1294. BackgroundType = 1
  1295. MouseOverImage = ""
  1296. MouseOffImage = ""
  1297. FontFamily = "GLYPH 100"
  1298. EOTFile = "res://mmc.exe/glyph100.eot"
  1299. SymbolString = "4"
  1300. ListpadStyle = 1
  1301. ListpadTitle = ""
  1302. ListpadHasButton= 0
  1303. ListpadButtonText= ""
  1304. ListView = ""
  1305. BeginProperty Tasks {861481F4-D867-11D1-B450-C43058000000}
  1306. Persistence.MajorVersion= 0
  1307. Persistence.MinorVersion= 12
  1308. Count = 4
  1309. KeysOnly = 0
  1310. BeginProperty Item1 {861481F7-D867-11D1-B450-C43058000000}
  1311. Persistence.MajorVersion= 0
  1312. Persistence.MinorVersion= 12
  1313. Index = 1
  1314. Key = "UserGuide"
  1315. Visible = -1
  1316. Tag = 0
  1317. Text = "How to Use the File Explorer"
  1318. ImageType = 1
  1319. MouseOverImage = ""
  1320. MouseOffImage = ""
  1321. FontFamily = "GLYPH 100"
  1322. EOTFile = "res://mmc.exe/glyph100.eot"
  1323. SymbolString = "T"
  1324. HelpString = "First Time Users Click Here"
  1325. ActionType = 1
  1326. URL = "CUSTOM/USERGUIDE"
  1327. Script = ""
  1328. EndProperty
  1329. BeginProperty Item2 {861481F7-D867-11D1-B450-C43058000000}
  1330. Persistence.MajorVersion= 0
  1331. Persistence.MinorVersion= 12
  1332. Index = 2
  1333. Key = "Start"
  1334. Visible = -1
  1335. Tag = 0
  1336. Text = "Start File Explorer"
  1337. ImageType = 1
  1338. MouseOverImage = ""
  1339. MouseOffImage = ""
  1340. FontFamily = "GLYPH 100"
  1341. EOTFile = "res://mmc.exe/glyph100.eot"
  1342. SymbolString = "4"
  1343. HelpString = "Experienced Users Click Here"
  1344. ActionType = 0
  1345. URL = ""
  1346. Script = ""
  1347. EndProperty
  1348. BeginProperty Item3 {861481F7-D867-11D1-B450-C43058000000}
  1349. Persistence.MajorVersion= 0
  1350. Persistence.MinorVersion= 12
  1351. Index = 3
  1352. Key = "mmchome"
  1353. Visible = -1
  1354. Tag = 0
  1355. Text = "MMC Home Page"
  1356. ImageType = 1
  1357. MouseOverImage = ""
  1358. MouseOffImage = ""
  1359. FontFamily = "GLYPH 100"
  1360. EOTFile = "res://mmc.exe/glyph100.eot"
  1361. SymbolString = ":"
  1362. HelpString = "Go to the MMC home page on microsoft.com"
  1363. ActionType = 0
  1364. URL = ""
  1365. Script = ""
  1366. EndProperty
  1367. BeginProperty Item4 {861481F7-D867-11D1-B450-C43058000000}
  1368. Persistence.MajorVersion= 0
  1369. Persistence.MinorVersion= 12
  1370. Index = 4
  1371. Key = "About"
  1372. Visible = -1
  1373. Tag = 0
  1374. Text = "About..."
  1375. ImageType = 1
  1376. MouseOverImage = ""
  1377. MouseOffImage = ""
  1378. FontFamily = "GLYPH 100"
  1379. EOTFile = "res://mmc.exe/glyph100.eot"
  1380. SymbolString = "T"
  1381. HelpString = "About File Explorer"
  1382. ActionType = 0
  1383. URL = ""
  1384. Script = ""
  1385. EndProperty
  1386. EndProperty
  1387. EndProperty
  1388. EndProperty
  1389. EndProperty
  1390. EndProperty
  1391. BeginProperty DataFormats {91FE14C5-7370-11D2-97D8-00104B880587}
  1392. Persistence.MajorVersion= 0
  1393. Persistence.MinorVersion= 12
  1394. Count = 0
  1395. KeysOnly = 0
  1396. EndProperty
  1397. BeginProperty SnapInDef {FFF9A8E4-06CB-11D2-9791-50C320524153}
  1398. Persistence.MajorVersion= 0
  1399. Persistence.MinorVersion= 12
  1400. Name = "FileExplorer"
  1401. NodeTypeName = "FileExplorer"
  1402. NodeTypeGUID = "{873CAEF3-4DA3-11D2-8873-0080C7E0ACE4}"
  1403. DisplayName = "File Explorer"
  1404. Type = 2
  1405. HelpFile = "mmc.chm"
  1406. LinkedTopics = ""
  1407. Description = "Snap-in designer sample"
  1408. Provider = "Microsoft Corporation"
  1409. Version = "1.0"
  1410. SmallFolders = "imgSmallFolders"
  1411. SmallFoldersOpen= "imgSmallOpenFolders"
  1412. LargeFolders = "imgLargeFolders"
  1413. Icon = "FileExplorer.dsx":178DC
  1414. Watermark = "FileExplorer.dsx":17BF6
  1415. Header = "FileExplorer.dsx":89B88
  1416. Palette = "FileExplorer.dsx":9F006
  1417. StretchWatermark= 0
  1418. StaticFolder = "19"
  1419. DefaultView = "lvExplorerTop"
  1420. Extensible = -1
  1421. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1422. Persistence.MajorVersion= 0
  1423. Persistence.MinorVersion= 12
  1424. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1425. Persistence.MajorVersion= 0
  1426. Persistence.MinorVersion= 12
  1427. Count = 1
  1428. KeysOnly = 1
  1429. Item1 = "lvExplorerTop"
  1430. EndProperty
  1431. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1432. Persistence.MajorVersion= 0
  1433. Persistence.MinorVersion= 12
  1434. Count = 0
  1435. KeysOnly = 1
  1436. EndProperty
  1437. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1438. Persistence.MajorVersion= 0
  1439. Persistence.MinorVersion= 12
  1440. Count = 0
  1441. KeysOnly = 1
  1442. EndProperty
  1443. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1444. Persistence.MajorVersion= 0
  1445. Persistence.MinorVersion= 12
  1446. Count = 1
  1447. KeysOnly = 1
  1448. Item1 = "StaticNodeTaskpad"
  1449. EndProperty
  1450. EndProperty
  1451. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1452. Persistence.MajorVersion= 0
  1453. Persistence.MinorVersion= 12
  1454. Count = 0
  1455. KeysOnly = 0
  1456. EndProperty
  1457. IID = "{04750E57-FD3C-4079-9FDB-B3E444539906}"
  1458. Preload = 0
  1459. EndProperty
  1460. BeginProperty ExtensionDefs {FFF9A8E6-06CB-11D2-9791-50C320524153}
  1461. Persistence.MajorVersion= 0
  1462. Persistence.MinorVersion= 12
  1463. ExtendsNewMenu = -1
  1464. ExtendsTaskMenu = 0
  1465. ExtendsTopMenu = -1
  1466. ExtendsViewMenu = -1
  1467. ExtendsPropertyPages= -1
  1468. ExtendsToolbar = -1
  1469. ExtendsNameSpace= -1
  1470. BeginProperty ExtendedSnapIns {BDA4B9D1-0872-11D2-9791-50C320524153}
  1471. Persistence.MajorVersion= 0
  1472. Persistence.MinorVersion= 12
  1473. Count = 1
  1474. KeysOnly = 0
  1475. BeginProperty Item1 {FFF9A8E8-06CB-11D2-9791-50C320524153}
  1476. Persistence.MajorVersion= 0
  1477. Persistence.MinorVersion= 12
  1478. Name = ""
  1479. Index = 1
  1480. Key = "{476e6448-aaff-11d0-b944-00c04fd8d5b0}"
  1481. CLSID = "{476e6448-aaff-11d0-b944-00c04fd8d5b0}"
  1482. DisplayName = ""
  1483. Dynamic = 0
  1484. ExtendsNameSpace= -1
  1485. ExtendsNewMenu = 0
  1486. ExtendsTaskMenu = 0
  1487. ExtendsPropertyPages= 0
  1488. ExtendsToolbar = 0
  1489. ExtendsTaskpad = 0
  1490. EndProperty
  1491. EndProperty
  1492. EndProperty
  1493. BeginProperty AutoCreateNodes {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1494. Persistence.MajorVersion= 0
  1495. Persistence.MinorVersion= 12
  1496. Count = 1
  1497. KeysOnly = 0
  1498. BeginProperty Item1 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1499. Persistence.MajorVersion= 0
  1500. Persistence.MinorVersion= 12
  1501. Name = "Desktop"
  1502. Index = 1
  1503. Key = "Desktop"
  1504. NodeTypeName = "Desktop"
  1505. NodeTypeGUID = "{873CAEFD-4DA3-11D2-8873-0080C7E0ACE4}"
  1506. DisplayName = "Desktop"
  1507. Folder = "1"
  1508. DefaultDataFormat= ""
  1509. AutoCreate = -1
  1510. DefaultView = "lvExplorerFiles"
  1511. HasChildren = -1
  1512. Extensible = 0
  1513. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1514. Persistence.MajorVersion= 0
  1515. Persistence.MinorVersion= 12
  1516. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1517. Persistence.MajorVersion= 0
  1518. Persistence.MinorVersion= 12
  1519. Count = 1
  1520. KeysOnly = 1
  1521. Item1 = "lvExplorerFiles"
  1522. EndProperty
  1523. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1524. Persistence.MajorVersion= 0
  1525. Persistence.MinorVersion= 12
  1526. Count = 0
  1527. KeysOnly = 1
  1528. EndProperty
  1529. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1530. Persistence.MajorVersion= 0
  1531. Persistence.MinorVersion= 12
  1532. Count = 0
  1533. KeysOnly = 1
  1534. EndProperty
  1535. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1536. Persistence.MajorVersion= 0
  1537. Persistence.MinorVersion= 12
  1538. Count = 0
  1539. KeysOnly = 1
  1540. EndProperty
  1541. EndProperty
  1542. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1543. Persistence.MajorVersion= 0
  1544. Persistence.MinorVersion= 12
  1545. Count = 6
  1546. KeysOnly = 0
  1547. BeginProperty Item1 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1548. Persistence.MajorVersion= 0
  1549. Persistence.MinorVersion= 12
  1550. Name = "MyComputer"
  1551. Index = 1
  1552. Key = "MyComputer"
  1553. NodeTypeName = "MyComputer"
  1554. NodeTypeGUID = "{119067B6-4DBC-11D2-8873-0080C7E0ACE4}"
  1555. DisplayName = "My Computer"
  1556. Folder = "2"
  1557. DefaultDataFormat= ""
  1558. AutoCreate = -1
  1559. DefaultView = "lvExplorerMain"
  1560. HasChildren = -1
  1561. Extensible = -1
  1562. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1563. Persistence.MajorVersion= 0
  1564. Persistence.MinorVersion= 12
  1565. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1566. Persistence.MajorVersion= 0
  1567. Persistence.MinorVersion= 12
  1568. Count = 1
  1569. KeysOnly = 1
  1570. Item1 = "lvExplorerMain"
  1571. EndProperty
  1572. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1573. Persistence.MajorVersion= 0
  1574. Persistence.MinorVersion= 12
  1575. Count = 0
  1576. KeysOnly = 1
  1577. EndProperty
  1578. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1579. Persistence.MajorVersion= 0
  1580. Persistence.MinorVersion= 12
  1581. Count = 0
  1582. KeysOnly = 1
  1583. EndProperty
  1584. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1585. Persistence.MajorVersion= 0
  1586. Persistence.MinorVersion= 12
  1587. Count = 0
  1588. KeysOnly = 1
  1589. EndProperty
  1590. EndProperty
  1591. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1592. Persistence.MajorVersion= 0
  1593. Persistence.MinorVersion= 12
  1594. Count = 0
  1595. KeysOnly = 0
  1596. EndProperty
  1597. Tag = "MyComputer"
  1598. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1599. Persistence.MajorVersion= 0
  1600. Persistence.MinorVersion= 12
  1601. Count = 0
  1602. KeysOnly = 0
  1603. EndProperty
  1604. EndProperty
  1605. BeginProperty Item2 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1606. Persistence.MajorVersion= 0
  1607. Persistence.MinorVersion= 12
  1608. Name = "InternetExplorer"
  1609. Index = 2
  1610. Key = "InternetExplorer"
  1611. NodeTypeName = "InternetExplorer"
  1612. NodeTypeGUID = "{1EF2C7CA-5299-11D2-887B-0080C7E0ACE4}"
  1613. DisplayName = "Internet Explorer"
  1614. Folder = "13"
  1615. DefaultDataFormat= ""
  1616. AutoCreate = -1
  1617. DefaultView = "uvBrowser"
  1618. HasChildren = -1
  1619. Extensible = 0
  1620. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1621. Persistence.MajorVersion= 0
  1622. Persistence.MinorVersion= 12
  1623. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1624. Persistence.MajorVersion= 0
  1625. Persistence.MinorVersion= 12
  1626. Count = 0
  1627. KeysOnly = 1
  1628. EndProperty
  1629. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1630. Persistence.MajorVersion= 0
  1631. Persistence.MinorVersion= 12
  1632. Count = 0
  1633. KeysOnly = 1
  1634. EndProperty
  1635. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1636. Persistence.MajorVersion= 0
  1637. Persistence.MinorVersion= 12
  1638. Count = 0
  1639. KeysOnly = 1
  1640. EndProperty
  1641. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1642. Persistence.MajorVersion= 0
  1643. Persistence.MinorVersion= 12
  1644. Count = 0
  1645. KeysOnly = 1
  1646. EndProperty
  1647. EndProperty
  1648. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1649. Persistence.MajorVersion= 0
  1650. Persistence.MinorVersion= 12
  1651. Count = 0
  1652. KeysOnly = 0
  1653. EndProperty
  1654. Tag = "InternetExplorer"
  1655. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1656. Persistence.MajorVersion= 0
  1657. Persistence.MinorVersion= 12
  1658. Count = 0
  1659. KeysOnly = 0
  1660. EndProperty
  1661. EndProperty
  1662. BeginProperty Item3 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1663. Persistence.MajorVersion= 0
  1664. Persistence.MinorVersion= 12
  1665. Name = "NetworkNeighborhood"
  1666. Index = 3
  1667. Key = "NetworkNeighborhood"
  1668. NodeTypeName = "NetworkNeighborhood"
  1669. NodeTypeGUID = "{1EF2C7CB-5299-11D2-887B-0080C7E0ACE4}"
  1670. DisplayName = "Network Neighborhood"
  1671. Folder = "14"
  1672. DefaultDataFormat= ""
  1673. AutoCreate = -1
  1674. DefaultView = ""
  1675. HasChildren = -1
  1676. Extensible = 0
  1677. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1678. Persistence.MajorVersion= 0
  1679. Persistence.MinorVersion= 12
  1680. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1681. Persistence.MajorVersion= 0
  1682. Persistence.MinorVersion= 12
  1683. Count = 0
  1684. KeysOnly = 1
  1685. EndProperty
  1686. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1687. Persistence.MajorVersion= 0
  1688. Persistence.MinorVersion= 12
  1689. Count = 0
  1690. KeysOnly = 1
  1691. EndProperty
  1692. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1693. Persistence.MajorVersion= 0
  1694. Persistence.MinorVersion= 12
  1695. Count = 0
  1696. KeysOnly = 1
  1697. EndProperty
  1698. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1699. Persistence.MajorVersion= 0
  1700. Persistence.MinorVersion= 12
  1701. Count = 0
  1702. KeysOnly = 1
  1703. EndProperty
  1704. EndProperty
  1705. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1706. Persistence.MajorVersion= 0
  1707. Persistence.MinorVersion= 12
  1708. Count = 0
  1709. KeysOnly = 0
  1710. EndProperty
  1711. Tag = "NetworkNeighborhood"
  1712. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1713. Persistence.MajorVersion= 0
  1714. Persistence.MinorVersion= 12
  1715. Count = 0
  1716. KeysOnly = 0
  1717. EndProperty
  1718. EndProperty
  1719. BeginProperty Item4 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1720. Persistence.MajorVersion= 0
  1721. Persistence.MinorVersion= 12
  1722. Name = "RecycleBin"
  1723. Index = 4
  1724. Key = "RecycleBin"
  1725. NodeTypeName = "RecycleBin"
  1726. NodeTypeGUID = "{1EF2C7D0-5299-11D2-887B-0080C7E0ACE4}"
  1727. DisplayName = "Recycle Bin"
  1728. Folder = "15"
  1729. DefaultDataFormat= ""
  1730. AutoCreate = -1
  1731. DefaultView = ""
  1732. HasChildren = -1
  1733. Extensible = 0
  1734. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1735. Persistence.MajorVersion= 0
  1736. Persistence.MinorVersion= 12
  1737. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1738. Persistence.MajorVersion= 0
  1739. Persistence.MinorVersion= 12
  1740. Count = 0
  1741. KeysOnly = 1
  1742. EndProperty
  1743. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1744. Persistence.MajorVersion= 0
  1745. Persistence.MinorVersion= 12
  1746. Count = 0
  1747. KeysOnly = 1
  1748. EndProperty
  1749. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1750. Persistence.MajorVersion= 0
  1751. Persistence.MinorVersion= 12
  1752. Count = 0
  1753. KeysOnly = 1
  1754. EndProperty
  1755. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1756. Persistence.MajorVersion= 0
  1757. Persistence.MinorVersion= 12
  1758. Count = 0
  1759. KeysOnly = 1
  1760. EndProperty
  1761. EndProperty
  1762. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1763. Persistence.MajorVersion= 0
  1764. Persistence.MinorVersion= 12
  1765. Count = 0
  1766. KeysOnly = 0
  1767. EndProperty
  1768. Tag = "RecycleBin"
  1769. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1770. Persistence.MajorVersion= 0
  1771. Persistence.MinorVersion= 12
  1772. Count = 0
  1773. KeysOnly = 0
  1774. EndProperty
  1775. EndProperty
  1776. BeginProperty Item5 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1777. Persistence.MajorVersion= 0
  1778. Persistence.MinorVersion= 12
  1779. Name = "MyBriefcase"
  1780. Index = 5
  1781. Key = "MyBriefcase"
  1782. NodeTypeName = "MyBriefcase"
  1783. NodeTypeGUID = "{1EF2C7D1-5299-11D2-887B-0080C7E0ACE4}"
  1784. DisplayName = "My Briefcase"
  1785. Folder = "16"
  1786. DefaultDataFormat= ""
  1787. AutoCreate = -1
  1788. DefaultView = ""
  1789. HasChildren = -1
  1790. Extensible = 0
  1791. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1792. Persistence.MajorVersion= 0
  1793. Persistence.MinorVersion= 12
  1794. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1795. Persistence.MajorVersion= 0
  1796. Persistence.MinorVersion= 12
  1797. Count = 0
  1798. KeysOnly = 1
  1799. EndProperty
  1800. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1801. Persistence.MajorVersion= 0
  1802. Persistence.MinorVersion= 12
  1803. Count = 0
  1804. KeysOnly = 1
  1805. EndProperty
  1806. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1807. Persistence.MajorVersion= 0
  1808. Persistence.MinorVersion= 12
  1809. Count = 0
  1810. KeysOnly = 1
  1811. EndProperty
  1812. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1813. Persistence.MajorVersion= 0
  1814. Persistence.MinorVersion= 12
  1815. Count = 0
  1816. KeysOnly = 1
  1817. EndProperty
  1818. EndProperty
  1819. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1820. Persistence.MajorVersion= 0
  1821. Persistence.MinorVersion= 12
  1822. Count = 0
  1823. KeysOnly = 0
  1824. EndProperty
  1825. Tag = "MyBriefcase"
  1826. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1827. Persistence.MajorVersion= 0
  1828. Persistence.MinorVersion= 12
  1829. Count = 0
  1830. KeysOnly = 0
  1831. EndProperty
  1832. EndProperty
  1833. BeginProperty Item6 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1834. Persistence.MajorVersion= 0
  1835. Persistence.MinorVersion= 12
  1836. Name = "About"
  1837. Index = 6
  1838. Key = "About"
  1839. NodeTypeName = "About"
  1840. NodeTypeGUID = "{74F84006-618B-4B3B-9EF3-C23E0723FA9D}"
  1841. DisplayName = "About FileExplorer"
  1842. Folder = 19
  1843. DefaultDataFormat= ""
  1844. AutoCreate = -1
  1845. DefaultView = "ovAbout"
  1846. HasChildren = -1
  1847. Extensible = -1
  1848. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1849. Persistence.MajorVersion= 0
  1850. Persistence.MinorVersion= 12
  1851. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1852. Persistence.MajorVersion= 0
  1853. Persistence.MinorVersion= 12
  1854. Count = 0
  1855. KeysOnly = 1
  1856. EndProperty
  1857. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1858. Persistence.MajorVersion= 0
  1859. Persistence.MinorVersion= 12
  1860. Count = 1
  1861. KeysOnly = 1
  1862. Item1 = "ovAbout"
  1863. EndProperty
  1864. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1865. Persistence.MajorVersion= 0
  1866. Persistence.MinorVersion= 12
  1867. Count = 0
  1868. KeysOnly = 1
  1869. EndProperty
  1870. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1871. Persistence.MajorVersion= 0
  1872. Persistence.MinorVersion= 12
  1873. Count = 0
  1874. KeysOnly = 1
  1875. EndProperty
  1876. EndProperty
  1877. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1878. Persistence.MajorVersion= 0
  1879. Persistence.MinorVersion= 12
  1880. Count = 0
  1881. KeysOnly = 0
  1882. EndProperty
  1883. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1884. Persistence.MajorVersion= 0
  1885. Persistence.MinorVersion= 12
  1886. Count = 0
  1887. KeysOnly = 0
  1888. EndProperty
  1889. EndProperty
  1890. EndProperty
  1891. Tag = "Desktop"
  1892. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1893. Persistence.MajorVersion= 0
  1894. Persistence.MinorVersion= 12
  1895. Count = 0
  1896. KeysOnly = 0
  1897. EndProperty
  1898. EndProperty
  1899. EndProperty
  1900. BeginProperty OtherNodes {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1901. Persistence.MajorVersion= 0
  1902. Persistence.MinorVersion= 12
  1903. Count = 2
  1904. KeysOnly = 0
  1905. BeginProperty Item1 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1906. Persistence.MajorVersion= 0
  1907. Persistence.MinorVersion= 12
  1908. Name = "Directory"
  1909. Index = 1
  1910. Key = "Directory"
  1911. NodeTypeName = "Directory"
  1912. NodeTypeGUID = "{119067F7-4DBC-11D2-8873-0080C7E0ACE4}"
  1913. DisplayName = "Directory"
  1914. Folder = "6"
  1915. DefaultDataFormat= ""
  1916. AutoCreate = 0
  1917. DefaultView = "lvExplorerFiles"
  1918. HasChildren = -1
  1919. Extensible = -1
  1920. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1921. Persistence.MajorVersion= 0
  1922. Persistence.MinorVersion= 12
  1923. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1924. Persistence.MajorVersion= 0
  1925. Persistence.MinorVersion= 12
  1926. Count = 1
  1927. KeysOnly = 1
  1928. Item1 = "lvExplorerFiles"
  1929. EndProperty
  1930. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1931. Persistence.MajorVersion= 0
  1932. Persistence.MinorVersion= 12
  1933. Count = 0
  1934. KeysOnly = 1
  1935. EndProperty
  1936. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1937. Persistence.MajorVersion= 0
  1938. Persistence.MinorVersion= 12
  1939. Count = 0
  1940. KeysOnly = 1
  1941. EndProperty
  1942. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  1943. Persistence.MajorVersion= 0
  1944. Persistence.MinorVersion= 12
  1945. Count = 0
  1946. KeysOnly = 1
  1947. EndProperty
  1948. EndProperty
  1949. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  1950. Persistence.MajorVersion= 0
  1951. Persistence.MinorVersion= 12
  1952. Count = 0
  1953. KeysOnly = 0
  1954. EndProperty
  1955. Tag = "Directory"
  1956. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  1957. Persistence.MajorVersion= 0
  1958. Persistence.MinorVersion= 12
  1959. Count = 0
  1960. KeysOnly = 0
  1961. EndProperty
  1962. EndProperty
  1963. BeginProperty Item2 {FFF9A8EA-06CB-11D2-9791-50C320524153}
  1964. Persistence.MajorVersion= 0
  1965. Persistence.MinorVersion= 12
  1966. Name = "ExtensionRoot"
  1967. Index = 2
  1968. Key = "ExtensionRoot"
  1969. NodeTypeName = "ExtensionRoot"
  1970. NodeTypeGUID = "{2F6E942D-A3EB-11D2-97E4-00104B880587}"
  1971. DisplayName = "File Explorer"
  1972. Folder = "19"
  1973. DefaultDataFormat= ""
  1974. AutoCreate = 0
  1975. DefaultView = "lvExplorerTop"
  1976. HasChildren = -1
  1977. Extensible = 0
  1978. BeginProperty ViewDefs {FFF9A8E1-06CB-11D2-9791-50C320524153}
  1979. Persistence.MajorVersion= 0
  1980. Persistence.MinorVersion= 12
  1981. BeginProperty ListViews {FFF9A8FC-06CB-11D2-9791-50C320524153}
  1982. Persistence.MajorVersion= 0
  1983. Persistence.MinorVersion= 12
  1984. Count = 1
  1985. KeysOnly = 1
  1986. Item1 = "lvExplorerTop"
  1987. EndProperty
  1988. BeginProperty OCXViews {FFF9A8FF-06CB-11D2-9791-50C320524153}
  1989. Persistence.MajorVersion= 0
  1990. Persistence.MinorVersion= 12
  1991. Count = 0
  1992. KeysOnly = 1
  1993. EndProperty
  1994. BeginProperty URLViews {FFF9A902-06CB-11D2-9791-50C320524153}
  1995. Persistence.MajorVersion= 0
  1996. Persistence.MinorVersion= 12
  1997. Count = 0
  1998. KeysOnly = 1
  1999. EndProperty
  2000. BeginProperty TaskpadViews {FFF9A904-06CB-11D2-9791-50C320524153}
  2001. Persistence.MajorVersion= 0
  2002. Persistence.MinorVersion= 12
  2003. Count = 1
  2004. KeysOnly = 1
  2005. Item1 = "StaticNodeTaskpad"
  2006. EndProperty
  2007. EndProperty
  2008. BeginProperty Children {FFF9A8F4-06CB-11D2-9791-50C320524153}
  2009. Persistence.MajorVersion= 0
  2010. Persistence.MinorVersion= 12
  2011. Count = 0
  2012. KeysOnly = 0
  2013. EndProperty
  2014. Tag = 0
  2015. BeginProperty ColumnHeaders {3B15D611-CD57-11D1-B44C-44750B000000}
  2016. Persistence.MajorVersion= 0
  2017. Persistence.MinorVersion= 12
  2018. Count = 0
  2019. KeysOnly = 0
  2020. EndProperty
  2021. EndProperty
  2022. EndProperty
  2023. TypeinfoCookie = 199
  2024. ProjectName = "FileExplorerSample"
  2025. End
  2026. Attribute VB_Name = "FileExplorer"
  2027. Attribute VB_GlobalNameSpace = False
  2028. Attribute VB_Creatable = True
  2029. Attribute VB_PredeclaredId = False
  2030. Attribute VB_Exposed = True
  2031. ' ===========================================================================
  2032. ' | THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF |
  2033. ' | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
  2034. ' | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A |
  2035. ' | PARTICULAR PURPOSE. |
  2036. ' | Copyright (c) 1998-1999 Microsoft Corporation |
  2037. ' ===========================================================================
  2038. ' =============================================================================
  2039. ' File: FileExplorer.dsr
  2040. ' Project: FileExplorerSample
  2041. ' Type: SnapIn Designer
  2042. ' =============================================================================
  2043. Option Explicit
  2044. ' Create the FileSystemObject once and hold onto it. Since this object
  2045. ' will be used repeatedly, it is more convenient to have it as a global.
  2046. ' This will not necessarily improve performance, as this is a UI-based
  2047. ' component and the cycles used on creation/destruction of the object
  2048. ' will be insignificant relative to the user's interaction.
  2049. Private m_FileSystemObject As New Scripting.FileSystemObject
  2050. ' Create the configuration object once and hold onto it. This object has
  2051. ' properties that hold the settings gathered by the configuration wizard
  2052. ' property pages.
  2053. Private m_ConfigData As New ConfigData
  2054. ' These variables hold the current filter operator. They are mutually exclusive i.e. one
  2055. ' is always True and one is always False. The default is to filter by name.
  2056. Private m_FilterByName As Boolean
  2057. Private m_FilterByExt As Boolean
  2058. ' This variable holds the current filter value. The default is "*"
  2059. Private m_FilterValue As String
  2060. Const S_OK = 0&
  2061. Const S_FALSE = 1&
  2062. ' Definitions of all literal strings needed
  2063. ' These are node type names
  2064. Const SZ_DIRECTORY = "Directory"
  2065. Const SZ_EXTENSION_ROOT = "ExtensionRoot"
  2066. Const SZ_STATICNODE = "Static Node"
  2067. Const SZ_DESKTOP = "Desktop"
  2068. Const SZ_MYCOMPUTER = "MyComputer"
  2069. Const SZ_INTERNETEXPLORER = "InternetExplorer"
  2070. Const SZ_NETWORKNEIGHBORHOOD = "NetworkNeighborhood"
  2071. Const SZ_RECYCLEBIN = "RecycleBin"
  2072. Const SZ_MYBRIEFCASE = "MyBriefcase"
  2073. Const SZ_DRIVENODE = "Drive Node"
  2074. Const SZ_ABOUT = "About"
  2075. ' Key values for toolbar buttons, menu buttons, and menu items.
  2076. Const KEY_ADD = "1"
  2077. Const KEY_RUN = "2"
  2078. Const KEY_RUNAS = "3"
  2079. Const KEY_CONFIGURATION = "4"
  2080. ' Key values for images
  2081. Const KEY_DESKTOP = "1"
  2082. Const KEY_MYCOMPUTER = "2"
  2083. Const KEY_FLOPPYDRIVE = "3"
  2084. Const KEY_LOCALDRIVE = "4"
  2085. Const KEY_CDROM = "5"
  2086. Const KEY_FOLDER = "6"
  2087. Const KEY_REMOTEDRIVE = "7"
  2088. Const KEY_REMOTEDRIVEOFFLINE = "8"
  2089. Const KEY_FILE = "9"
  2090. Const KEY_APPLICATION = "10"
  2091. Const KEY_APPEXTENSION = "11"
  2092. Const KEY_UNKNOWN = "12"
  2093. Const KEY_INTERNETEXPLORER = "13"
  2094. Const KEY_NETWORKNEIGHBORHOOD = "14"
  2095. Const KEY_RECYCLEBIN = "15"
  2096. Const KEY_MYBRIEFCASE = "16"
  2097. Const KEY_FOLDERGRAY = "17"
  2098. Const KEY_FILEGRAY = "18"
  2099. Const KEY_EXPLORER = "19"
  2100. ' Display names
  2101. Const SZDISPLAY_FLOPPYDRIVE = "Floppy Disk"
  2102. Const SZDISPLAY_LOCALDRIVE = "Local Disk"
  2103. Const SZDISPLAY_CDROM = "CD-ROM Disk"
  2104. Const SZDISPLAY_REMOTEDRIVE = "Network Connection"
  2105. Const SZDISPLAY_UNKNOWN = "Unknown Type"
  2106. Const SZDISPLAY_DESKTOP = "Desktop"
  2107. Const SZDISPLAY_MYCOMPUTER = "My Computer"
  2108. Const SZDISPLAY_SYSTEMFOLDER = "System Folder"
  2109. Const SZDISPLAY_FOLDER = "File Folder"
  2110. Const SZDISPLAY_REMOTEDRIVEOFFLINE = "Network Connection"
  2111. Const SZDISPLAY_FILE = " File"
  2112. Const SZDISPLAY_APPLICATION = "Application"
  2113. Const SZDISPLAY_APPEXTENSION = "Application Extension"
  2114. Const SZDISPLAY_INTERNETEXPLORER = "Internet Explorer"
  2115. Const SZDISPLAY_NETWORKNEIGHBORHOOD = "Network Neighborhood"
  2116. Const SZDISPLAY_RECYCLEBIN = "Recycle Bin"
  2117. Const SZDISPLAY_MYBRIEFCASE = "My Briefcase"
  2118. ' Column keys for detail view
  2119. Const KEY_NAME = "1"
  2120. Const COLNUM_NAME = 1
  2121. Const KEY_TYPE = "5"
  2122. Const KEY_TOTALSIZE = "6"
  2123. Const COLNUM_TOTALSIZE = 3
  2124. Const KEY_FREESPACE = "7"
  2125. Const COLNUM_FREESPACE = 4
  2126. Const KEY_SIZE = "2"
  2127. Const COLNUM_SIZE = 2
  2128. Const KEY_DATE = "3"
  2129. Const COLNUM_DATE = 3
  2130. Const KEY_ATTRIBUTES = "4"
  2131. ' Column header text
  2132. Const SZDISPLAY_NAME = "Name"
  2133. Const SZDISPLAY_SIZE = "Size"
  2134. Const SZDISPLAY_DATE = "Date Modified"
  2135. Const SZDISPLAY_TOTALSIZE = "Total Size"
  2136. Const SZDISPLAY_FREESPACE = "Free Space"
  2137. Const SZDISPLAY_ATTRIBUTES = "Attributes"
  2138. Const SZDISPLAY_TYPE = "Type"
  2139. ' Static node taskpad task keys
  2140. Const KEY_START = "Start"
  2141. Const KEY_MMC_HOME_PAGE = "mmchome"
  2142. Const KEY_ABOUT = "About"
  2143. ' ResultView names
  2144. Const SZ_STATIC_NODE_TASKPAD = "StaticNodeTaskpad"
  2145. Const SZ_ABOUT_OCX = "ovAbout"
  2146. ' Shell library constants
  2147. Const SW_SHOWNORMAL = 1
  2148. Const MAX_PATH = 260
  2149. Const CSIDL_DESKTOP = 0
  2150. ' Potential error values returned from ShellExecute
  2151. Const ERROR_FILE_NOT_FOUND = 2&
  2152. Const ERROR_PATH_NOT_FOUND = 3&
  2153. Const ERROR_BAD_FORMAT = 11&
  2154. Const SE_ERR_FNF = 2&
  2155. Const SE_ERR_PNF = 3&
  2156. Const SE_ERR_ACCESSDENIED = 5&
  2157. Const SE_ERR_OOM = 8&
  2158. Const SE_ERR_SHARE = 26&
  2159. Const SE_ERR_ASSOCINCOMPLETE = 27&
  2160. Const SE_ERR_DDETIMEOUT = 28&
  2161. Const SE_ERR_DDEFAIL = 29&
  2162. Const SE_ERR_DDEBUSY = 30&
  2163. Const SE_ERR_NOASSOC = 31&
  2164. Const SE_ERR_DLLNOTFOUND = 32&
  2165. ' Format specifiers for file dates and sizes
  2166. Const SIZE_FORMAT_SPECIFIER = "##,##0"
  2167. Const DATE_FORMAT_SPECIFIER = "M/D/YY HH:MM AMPM"
  2168. Const GIGA_FORMAT_SPECIFIER = "#,##0.0 GB"
  2169. Const MEGA_FORMAT_SPECIFIER = "#,##0 MB"
  2170. Const KILO_FORMAT_SPECIFIER = "#,##0 KB"
  2171. Const BYTE_FORMAT_SPECIFIER = "#,##0 bytes"
  2172. Const GIGABYTE = 2 ^ 30
  2173. Const MEGABYTE = 2 ^ 20
  2174. Const KILOBYTE = 2 ^ 10
  2175. ' Error message strings
  2176. Const SZ_ERRTITLE = "FileExplorer Runtime Error"
  2177. Const SZ_ERRSHELLEXEC = "FileExplorer Application Launch Error"
  2178. ' Shell library DLL function declarations
  2179. Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal Path As String) As Long
  2180. Private Declare Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As Long, ByVal ProcName As String) As Long
  2181. Private Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hModule As Long)
  2182. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  2183. Private Declare Function SHGetSpecialFolderPath Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hwnd As Long, ByVal lpPath As String, ByVal nFolder As Long, ByVal fCreate As Boolean) As Long
  2184. ' =============================================================================
  2185. ' Method: AddDrivesToScope
  2186. ' Type: Subroutine
  2187. ' Description: Enumerate all the disk drives located on this computer
  2188. ' (using the FileSystemObject) and add a scope item for
  2189. ' each drive.
  2190. ' Parameters: nodeParent The ScopeNode under which to insert
  2191. ' the scope items
  2192. ' Output: None
  2193. ' Notes: This method is called as part of the processing for
  2194. ' the ScopeItems_Expand event, when the node being expanded
  2195. ' is "MyComputer". By the time this method has been called,
  2196. ' we have reached the last of our pre-defined, auto-created nodes.
  2197. ' We use the FileSystemObject to provide the list of drives
  2198. ' available, and we create a new ScopeItem for each.
  2199. '
  2200. ' The MyComputer ScopeItem is extensible and it exports a data
  2201. ' format called "Drives" that contains a string array of the
  2202. ' drive names being displayed in FileExplorer. The DriveStats
  2203. ' extension will use that format to display its listpad as the
  2204. ' result view for the <Stats> node it adds under "My Computer".
  2205. ' =============================================================================
  2206. '
  2207. Private Sub AddDrivesToScope(nodeParent As ScopeNode)
  2208. On Error GoTo ErrTrap_AddDrivesToScope
  2209. Dim Drives As Drives ' the Drives collection
  2210. Dim Drive As Drive ' empty drive object for For...Each
  2211. Dim DriveScopeItem As ScopeItem ' reference to the newly added ScopeItem
  2212. Dim szDisplay As String ' display text for scope pane node
  2213. Dim szType As String ' display text for type of drive
  2214. Dim szDriveNames() As String ' array of drive names for exported data
  2215. Dim cDrives As Integer ' count of drives displayed
  2216. cDrives = 0
  2217. ' Get the drives collection...
  2218. Set Drives = m_FileSystemObject.Drives
  2219. ' ...and start to step through the list
  2220. For Each Drive In Drives
  2221. ' If this is a remote drive then check configuration data gathered
  2222. ' during the configuration wizard to determine whether to add it.
  2223. If (Drive.DriveType <> Remote) Or (m_ConfigData.ShowNetDrives) Then
  2224. ' Add the drive name to the array for MyComputer's exported data
  2225. cDrives = cDrives + 1
  2226. ReDim Preserve szDriveNames(1 To cDrives) As String
  2227. szDriveNames(cDrives) = Drive.Path
  2228. ' Build the display string for the drive nodes
  2229. szDisplay = "(" & Drive.Path & ")"
  2230. ' There is only one global ScopeItems collection, and it is
  2231. ' a property of the snap-in itself. As such, it is globally
  2232. ' available to be referenced.
  2233. Set DriveScopeItem = ScopeItems.AddPreDefined(SZ_DIRECTORY, Drive.Path & "\", nodeParent, siParent)
  2234. With DriveScopeItem
  2235. ' Set the NodeID to the path as that is a unique non-localized string that can
  2236. ' identify the node in the scope pane. Set SlowRetrieval to False so that
  2237. ' when a console file is reloaded the same scope item will be selected.
  2238. .NodeID = Drive.Path
  2239. .SlowRetrieval = False
  2240. ' Set exported data: Format is "Drive", data is drive name
  2241. .Data.SetData Drive.Path, "Drive"
  2242. ' Enable the DriveStats dynamic extension for this scope item.
  2243. ' This is indexed by CLSID as node type names are not guaranteed to be registered
  2244. ' or unique.
  2245. .DynamicExtensions("{8A7A7E11-A8AC-11D2-97E5-00104B880587}").NameSpaceEnabled = True
  2246. ' We have to separately set the displayed text for this new ScopeItem
  2247. ' through its ScopeNode.
  2248. .ScopeNode.DisplayName = szDisplay
  2249. ' When displaying properties for the node we need to know
  2250. ' what it represents so set ScopeItem.Tag to the Drive object
  2251. Set .Tag = Drive
  2252. ' Assign the appropriate bitmap and type description to the
  2253. ' new ScopeItem, depending on what kind of drive it is.
  2254. Select Case Drive.DriveType
  2255. Case Removable
  2256. .Folder = KEY_FLOPPYDRIVE
  2257. szType = SZDISPLAY_FLOPPYDRIVE
  2258. Case Fixed
  2259. .Folder = KEY_LOCALDRIVE
  2260. szType = SZDISPLAY_LOCALDRIVE
  2261. Case CDRom
  2262. .Folder = KEY_CDROM
  2263. szType = SZDISPLAY_CDROM
  2264. Case Remote
  2265. .Folder = KEY_REMOTEDRIVE
  2266. szType = SZDISPLAY_REMOTEDRIVE
  2267. Case Else
  2268. ' This is just a catch-all for anything that comes through
  2269. ' that we don't expect or know how to deal with.
  2270. .Folder = KEY_UNKNOWN
  2271. szType = SZDISPLAY_UNKNOWN
  2272. End Select ' Drive.DriveType
  2273. ' The key for each item will be the fully
  2274. ' qualified pathname. This is guaranteed to be unique,
  2275. ' we don't have to create anything new, and we can easily
  2276. ' make use of this in other parts of the code
  2277. .Key = Drive.Path & "\"
  2278. ' ColumnHeader objects define each of the columns shown in a ListView
  2279. ' when the view mode is set to Report. ListSubItems CAN'T be added to
  2280. ' a ListView unless there have been ColumnHeaders defined before then.
  2281. ' For ListItems, these ColumnHeaders have already been defined as part
  2282. ' of the ListView definition done through the designer at design-time.
  2283. ' We add ColumnHeaders here in code to show how that can be done,
  2284. ' but they could also be defined in the designer in the scope item
  2285. ' property pages.
  2286. ' NOTE: These ColumnHeaders MUST match the ColumnHeaders defined
  2287. ' in the ListView, otherwise they will not display.
  2288. With .ColumnHeaders
  2289. .Add 1, KEY_NAME, SZDISPLAY_NAME
  2290. .Add 2, KEY_TYPE, SZDISPLAY_TYPE
  2291. .Add 3, KEY_TOTALSIZE, SZDISPLAY_TOTALSIZE
  2292. .Add 4, KEY_FREESPACE, SZDISPLAY_FREESPACE
  2293. End With ' .ColumnHeaders
  2294. ' This is where we add the actual data that will be displayed in the
  2295. ' in the ResultView for these nodes when the user selects detail view.
  2296. With .ListSubItems
  2297. .Add 1, KEY_NAME, szDisplay ' Column "Name"
  2298. .Add 2, KEY_TYPE, szType ' Column "Type"
  2299. If Drive.IsReady Then
  2300. .Add 3, KEY_TOTALSIZE, Format(Drive.TotalSize, SIZE_FORMAT_SPECIFIER) ' Column "Total Size"
  2301. .Add 4, KEY_FREESPACE, Format(Drive.FreeSpace, SIZE_FORMAT_SPECIFIER) ' Column "Free Space"
  2302. Else
  2303. .Add 3, KEY_TOTALSIZE, "0" ' Column "Total Size"
  2304. .Add 4, KEY_FREESPACE, "0" ' Column "Free Space"
  2305. End If
  2306. End With ' .ListSubItems
  2307. End With ' .DriveScopeItem
  2308. End If ' Drive.DriveType <> Remote
  2309. Next Drive
  2310. ' At this point the array of drive names is complete and can be exported
  2311. With ScopeItems(SZ_MYCOMPUTER)
  2312. .Data.SetData szDriveNames, "DriveNames"
  2313. ' Enable the DriveStats dynamic extension for the MyComputer scope item.
  2314. .DynamicExtensions("{8A7A7E11-A8AC-11D2-97E5-00104B880587}").NameSpaceEnabled = True
  2315. End With
  2316. Exit Sub
  2317. ' Error Handler for this method
  2318. ErrTrap_AddDrivesToScope:
  2319. DisplayError "AddDrivesToScope"
  2320. End Sub
  2321. ' =============================================================================
  2322. ' Method: AddFilesToView
  2323. ' Type: Subroutine
  2324. ' Description: Enumerate all the files located within the specified folder
  2325. ' Parameters: Folder A FileSystemObject object encapsulating a
  2326. ' directory folder to use for the enumeration
  2327. ' ResultView A reference to the specific ResultView object
  2328. ' being activated
  2329. ' Output: None
  2330. ' Notes: This method is called as part of the processing for
  2331. ' the ResultViews_Initialize event, when the user has selected
  2332. ' a drive or directory in the scope pane.
  2333. ' We use the Folder object to provide the list of files
  2334. ' available, and we create a new ListItem for each one.
  2335. ' =============================================================================
  2336. '
  2337. Private Sub AddFilesToView(Folder As Scripting.Folder, _
  2338. ResultView As SnapInLib.ResultView)
  2339. On Error GoTo ErrTrap_AddFilesToView
  2340. Dim Files As Scripting.Files ' collection of files from within a folder
  2341. Dim File As Scripting.File ' reference to each file in the Files collection
  2342. ' From the folder, get the Files collection...
  2343. Set Files = Folder.Files
  2344. ' Create each of the list items and all of their list sub-items.
  2345. With ResultView.ListView
  2346. For Each File In Files
  2347. AddNewFile .ListItems, File
  2348. Next File
  2349. End With
  2350. Exit Sub
  2351. ' Error Handler for this method
  2352. ErrTrap_AddFilesToView:
  2353. DisplayError "AddFilesToView"
  2354. End Sub
  2355. ' =============================================================================
  2356. ' Method: AddNewFile
  2357. ' Type: Subroutine
  2358. ' Description: Add a list item for a file
  2359. ' data
  2360. ' Parameters: ListItems The MMCListItems object belonging to the
  2361. ' ResultView.ListView being populated
  2362. ' File The FileSystemObject object representing the file
  2363. '
  2364. ' Output: None
  2365. ' Notes: This method adds a new list item to the list view, sets the
  2366. ' text for each of the list subitems used in the detail view, and
  2367. ' sets the data exported for use by extension snap-ins.
  2368. ' =============================================================================
  2369. '
  2370. Private Sub AddNewFile(ListItems As MMCListItems, File As Scripting.File)
  2371. On Error GoTo ErrTrap_AddNewFile
  2372. Dim ListItem As MMCListItem ' reference to the newly added ListItem
  2373. ' Check whether the file name matches the current filtering criteria.
  2374. If Not FileMatchesFilter(File.Name) Then
  2375. Exit Sub
  2376. End If
  2377. ' The ListItems.Add call will add a new row entry
  2378. ' .ListItems.Add(, ' omit index to append to the collection
  2379. ' File.Path ' The key value, using the full pathname
  2380. ' File.Name ' The display text for the item when not in
  2381. ' ' in detail view
  2382. ' KEY_FILE ' The index of the image to use
  2383. Set ListItem = ListItems.Add(, File.Path, File.Name, KEY_FILE)
  2384. ' Set the subitem text
  2385. InitListItem ListItem, File
  2386. ' Set the exported data
  2387. InitListItemData ListItem, File
  2388. Exit Sub
  2389. ' Error Handler for this method
  2390. ErrTrap_AddNewFile:
  2391. DisplayError "AddNewFile"
  2392. End Sub
  2393. ' =============================================================================
  2394. ' Method: FileMatchesFilter
  2395. ' Type: Subroutine
  2396. ' Description: Check the file name against the current filtering criteria
  2397. '
  2398. ' Parameters: FQFileName Fully qualified file name (drive + path + name)
  2399. ' Output: True - file matches current filter
  2400. ' False - file does not match current filter
  2401. ' Notes: On MMC 1.1 or when the user disables filtering on MMC 1.2 the
  2402. ' filter value will be * which means that everything matches.
  2403. ' =============================================================================
  2404. '
  2405. Private Function FileMatchesFilter(FQFileName As String)
  2406. Dim BaseName As String ' file name without path prefix
  2407. Dim FileName As String ' file name portion before the last dot
  2408. Dim FileExt As String ' file name portion after the last dot
  2409. Dim DotPos As Integer ' position of dot in file name
  2410. On Error GoTo ErrTrap_FileMatchesFilter
  2411. ' We don 't really support a value of *.* but users are likely to type it in so
  2412. ' treat it the same as *
  2413. If (m_FilterValue = "*") Or (m_FilterValue = "*.*") Then
  2414. FileMatchesFilter = True
  2415. Exit Function
  2416. End If
  2417. ' Get file name without the path
  2418. BaseName = FQFileName
  2419. ' Get the position of the last dot in the file name
  2420. DotPos = InStrRev(BaseName, ".", , vbTextCompare)
  2421. ' Get the file name and extension
  2422. If DotPos <> 0 Then
  2423. FileName = Left(BaseName, DotPos - 1)
  2424. FileExt = Right(BaseName, Len(BaseName) - DotPos)
  2425. End If
  2426. ' Apply filter
  2427. If m_FilterByName Then
  2428. If DotPos = 0 Then ' no dot, name must match as is
  2429. If StrComp(BaseName, m_FilterValue, vbTextCompare) <> 0 Then
  2430. FileMatchesFilter = False
  2431. Else
  2432. FileMatchesFilter = True
  2433. End If
  2434. Else ' dot found, check name before dot against filter
  2435. If StrComp(FileName, m_FilterValue, vbTextCompare) <> 0 Then
  2436. FileMatchesFilter = False
  2437. Else
  2438. FileMatchesFilter = True
  2439. End If
  2440. End If
  2441. Else ' filtering by extension
  2442. If DotPos = 0 Then ' no dot, not a match because file has no extension
  2443. FileMatchesFilter = False
  2444. Else ' dot found, check name after dot against filter
  2445. If StrComp(FileExt, m_FilterValue, vbTextCompare) <> 0 Then
  2446. FileMatchesFilter = False
  2447. Else
  2448. FileMatchesFilter = True
  2449. End If
  2450. End If
  2451. End If
  2452. Exit Function
  2453. ' Error Handler for this method
  2454. ErrTrap_FileMatchesFilter:
  2455. DisplayError "FileMatchesFilter"
  2456. End Function
  2457. ' =============================================================================
  2458. ' Method: InitListItem
  2459. ' Type: Subroutine
  2460. ' Description: Set the list subitems for a new list item
  2461. ' data
  2462. ' Parameters: ListItem The MMCListItem object to be initialized
  2463. ' File The FileSystemObject object for the file
  2464. ' represented by the list item.
  2465. ' Output: None
  2466. ' Notes: This method adds the list subitems to a new list item and sets
  2467. ' their text according to the column definitions. It also sets
  2468. ' ListItem.Tag to the File object.
  2469. ' =============================================================================
  2470. '
  2471. Private Sub InitListItem(ListItem As MMCListItem, File As Scripting.File)
  2472. On Error GoTo ErrTrap_InitListItem
  2473. Dim szAttributes As String ' display string to use to build file attributes
  2474. Dim Index As String
  2475. ' ListSubItems.Add will add the text to be displayed in all the columns of
  2476. ' the ListView when shown in Report mode. First clear the subitems
  2477. ' collection in case this method is being called due to a rename operation.
  2478. Index = CStr(ListItem.Index)
  2479. With ListItem.ListSubItems
  2480. .Clear
  2481. .Add 1, KEY_NAME & Index, File.Name
  2482. .Add 2, KEY_SIZE & Index, Format(File.Size, SIZE_FORMAT_SPECIFIER)
  2483. .Add 3, KEY_DATE & Index, Format(File.DateLastModified, DATE_FORMAT_SPECIFIER)
  2484. ' Attributes is stored as a bitfield, so translate it
  2485. ' into a readable string
  2486. szAttributes = ""
  2487. If File.Attributes And ReadOnly Then szAttributes = "R"
  2488. If File.Attributes And Archive Then szAttributes = szAttributes & "A"
  2489. If File.Attributes And System Then szAttributes = szAttributes & "S"
  2490. If File.Attributes And Hidden Then szAttributes = szAttributes & "H"
  2491. .Add 4, KEY_ATTRIBUTES & Index, szAttributes
  2492. End With
  2493. ' In order to display properties for the item we'll need the File
  2494. ' object so put into MMCListItem.Tag
  2495. Set ListItem.Tag = File
  2496. Exit Sub
  2497. ' Error Handler for this method
  2498. ErrTrap_InitListItem:
  2499. DisplayError "InitListItem"
  2500. End Sub
  2501. ' =============================================================================
  2502. ' Method: InitListItemData
  2503. ' Type: Subroutine
  2504. ' Description: Set the exported data for a new list item
  2505. ' data
  2506. ' Parameters: ListItem The MMCListItem object to be initialized
  2507. ' File The FileSystemObject object for the file
  2508. ' represented by the list item.
  2509. ' Output: None
  2510. ' Notes: This method stores the exported data in ListItem.Data to be
  2511. ' used by extension snap-ins. It the file is a DLL then the
  2512. ' ComDetect sample dynamic extension is enabled. This allows
  2513. ' ComDetect to add an item to the Task context menu for this
  2514. ' file allowing the user to query whether the DLL is a COM server.
  2515. ' =============================================================================
  2516. '
  2517. Private Sub InitListItemData(ListItem As MMCListItem, File As Scripting.File)
  2518. On Error GoTo ErrTrap_InitListItemData
  2519. ' Set exported data:
  2520. 'The 1st format is called "File". The data is the file name without the path
  2521. ListItem.Data.SetData File.Name, "File"
  2522. 'The 2nd format is called "Path". The data is the fully qualified file name
  2523. ListItem.Data.SetData File.Path, "Path"
  2524. ' If this file is a DLL then enable the dynamic extension ComDetect.
  2525. ' We must use the CLSID as the key because node type names are not required
  2526. ' by MMC in the registry and even if present, they may not be unique.
  2527. If Len(File.Name) > 4 Then
  2528. If InStr(1, Right$(File.Name, 4), ".DLL", vbTextCompare) <> 0 Then
  2529. ListItem.DynamicExtensions("{EB882E49-CDD4-11D2-97ED-00104B880587}").Enabled = True
  2530. End If
  2531. End If
  2532. Exit Sub
  2533. ' Error Handler for this method
  2534. ErrTrap_InitListItemData:
  2535. DisplayError "InitListItemData"
  2536. End Sub
  2537. ' =============================================================================
  2538. ' Method: AddFoldersToScope
  2539. ' Type: Subroutine
  2540. ' Description: Enumerate all the folders located under the specified folder
  2541. ' (represented by the ParentScopeItem.Key value) using the
  2542. ' FileSystemObject
  2543. ' Parameters: ParentScopeItem The ScopeItem under whose ScopeNode to insert
  2544. ' the new nodes being added
  2545. ' Output: None
  2546. ' Notes: This method is called to support the processing taking place
  2547. ' during ScopeItems_Expand.
  2548. ' =============================================================================
  2549. '
  2550. Private Sub AddFoldersToScope(ParentScopeItem As ScopeItem)
  2551. On Error GoTo ErrTrap_AddFoldersToScope
  2552. Dim ParentFolder As Scripting.Folder
  2553. Dim SubFolder As Scripting.Folder
  2554. Dim Folders As Scripting.Folders
  2555. ' Make sure that this drive is available to be queried
  2556. If m_FileSystemObject.GetDrive(m_FileSystemObject.GetDriveName(ParentScopeItem.Key)).IsReady Then
  2557. ' Get a reference to the actual folder represented by the
  2558. Set ParentFolder = m_FileSystemObject.GetFolder(ParentScopeItem.Key)
  2559. ' Get the folders collection containing the subdirectories of this folder...
  2560. Set Folders = ParentFolder.SubFolders
  2561. '...and iterate through the list
  2562. For Each SubFolder In Folders
  2563. AddNewFolder ParentScopeItem, SubFolder
  2564. Next SubFolder
  2565. End If
  2566. Exit Sub
  2567. ' Error Handler for this method
  2568. ErrTrap_AddFoldersToScope:
  2569. DisplayError "AddFoldersToScope"
  2570. End Sub
  2571. ' =============================================================================
  2572. ' Method: AddNewFolder
  2573. ' Type: Subroutine
  2574. ' Description: Add a new ScopeItem representing the specified SubFolder and
  2575. ' initialize it
  2576. '
  2577. ' Parameters: ParentScopeItem The ScopeItem under whose ScopeNode to insert
  2578. ' the new nodes being added
  2579. ' Output: None
  2580. ' Notes: This method is called to support the processing taking place
  2581. ' during ScopeItems_Expand.
  2582. ' =============================================================================
  2583. '
  2584. Private Sub AddNewFolder(ParentScopeItem As ScopeItem, _
  2585. SubFolder As Scripting.Folder)
  2586. On Error GoTo ErrTrap_AddNewFolder
  2587. Dim FolderScopeItem As ScopeItem
  2588. ' There is only one global ScopeItems collection, and it is
  2589. ' a property of the snap-in itself. As such, it is globally
  2590. ' available to be referenced.
  2591. Set FolderScopeItem = ScopeItems.AddPreDefined(SZ_DIRECTORY, _
  2592. SubFolder.Path, _
  2593. ParentScopeItem.ScopeNode, _
  2594. siParent)
  2595. ' Set the NodeID to the path as that is a unique non-localized string that can
  2596. ' identify the node in the scope pane. Set SlowRetrieval to False so that
  2597. ' when a console file is reloaded the same scope node will be selected.
  2598. FolderScopeItem.NodeID = SubFolder.Path
  2599. FolderScopeItem.SlowRetrieval = False
  2600. ' Set exported data: Format is "Folder", data is folder path
  2601. FolderScopeItem.Data.SetData SubFolder.Path, "Folder"
  2602. ' We have to separately set the displayed text for this new ScopeItem
  2603. FolderScopeItem.ScopeNode.DisplayName = SubFolder.Name
  2604. ' Store the fully qualified pathname as the key of the newly created node
  2605. FolderScopeItem.Key = SubFolder.Path
  2606. ' Set the image key
  2607. FolderScopeItem.Folder = KEY_FOLDER
  2608. ' Set the Folder object in the tag so we can display properties for
  2609. ' the directory
  2610. Set FolderScopeItem.Tag = SubFolder
  2611. ' ColumnHeader objects define each of the columns shown in a ListView
  2612. ' when the view mode is set to Report. ListSubItems CAN'T be added to
  2613. ' a ListView unless there have been ColumnHeaders defined before then.
  2614. ' For ListItems, these ColumnHeaders have already been defined as part
  2615. ' of the ListView definition done through the designer at design-time.
  2616. ' We add ColumnHeaders here in code to show how that can be done,
  2617. ' but they could also be defined in the designer in the scope item
  2618. ' property pages.
  2619. ' NOTE: These ColumnHeaders MUST match the ColumnHeaders defined
  2620. ' in the ListView, otherwise they will not display.
  2621. With FolderScopeItem.ColumnHeaders
  2622. .Add 1, KEY_NAME, SZDISPLAY_NAME
  2623. .Add 2, KEY_SIZE, SZDISPLAY_SIZE
  2624. .Add 3, KEY_DATE, SZDISPLAY_DATE
  2625. .Add 4, KEY_ATTRIBUTES, SZDISPLAY_ATTRIBUTES
  2626. End With
  2627. ' This is where we add the actual data that will be displayed in the
  2628. ' in the ResultView for these nodes.
  2629. With FolderScopeItem.ListSubItems
  2630. .Add 1, KEY_NAME, SubFolder.Name ' Column "Name"
  2631. .Add 2, KEY_SIZE, "" ' Column "Size", not used for folders
  2632. .Add 3, KEY_DATE, Format(SubFolder.DateLastModified, DATE_FORMAT_SPECIFIER)
  2633. ' Column "Date"
  2634. .Add 4, KEY_ATTRIBUTES, "" ' Column "Attributes", not used for folders
  2635. End With
  2636. Exit Sub
  2637. ' Error Handler for this method
  2638. ErrTrap_AddNewFolder:
  2639. DisplayError "AddNewFolder"
  2640. End Sub
  2641. ' =============================================================================
  2642. ' Method: DisplayError
  2643. ' Type: Subroutine
  2644. ' Description: A method to format and display a runtime error
  2645. ' Parameters: szLocation A string identifying the source location
  2646. ' (i.e. method name) where the error occurred
  2647. ' Output: None
  2648. ' Notes: The error will be displayed in a messagebox formatted as the
  2649. ' following sample:
  2650. '
  2651. ' Method: SomeMethodName
  2652. ' Source: MMCListSubItems
  2653. ' Error: 2527h (9511)
  2654. ' Description: There is already an item in the collection that has the specified key
  2655. '
  2656. ' =============================================================================
  2657. '
  2658. Private Sub DisplayError(szLocation As String)
  2659. ConsoleMsgBox "Method:" & vbTab & vbTab & szLocation & vbCrLf _
  2660. & "Source:" & vbTab & vbTab & Err.Source & vbCrLf _
  2661. & "Error:" & vbTab & vbTab & Hex(Err.Number) & "h (" & CStr(Err.Number) & ")" & vbCrLf _
  2662. & "Description:" & vbTab & Err.Description, _
  2663. vbCritical, SZ_ERRTITLE
  2664. End Sub
  2665. ' =============================================================================
  2666. ' Method: FormatByteCount
  2667. ' Type: Function
  2668. ' Description: A function to format a byte count as a string for display
  2669. ' Parameters: nCount Value to be rounded and formatted
  2670. ' Output: String A formatted, punctuated numeric string
  2671. ' Notes: This function will first determine the appropriate suffix
  2672. ' for the value size (i.e. GB, MB, etc.). It will then round
  2673. ' the value and format it, with comma and appropriate suffix
  2674. ' =============================================================================
  2675. '
  2676. Private Function FormatByteCount(nCount As Double) As String
  2677. On Error GoTo ErrTrap_FormatByteCount
  2678. If nCount >= GIGABYTE Then
  2679. FormatByteCount = Format(nCount / GIGABYTE, GIGA_FORMAT_SPECIFIER)
  2680. ElseIf nCount >= MEGABYTE And nCount < GIGABYTE Then
  2681. FormatByteCount = Format(nCount / MEGABYTE, MEGA_FORMAT_SPECIFIER)
  2682. ElseIf nCount >= KILOBYTE And nCount < MEGABYTE Then
  2683. FormatByteCount = Format(nCount / KILOBYTE, KILO_FORMAT_SPECIFIER)
  2684. Else
  2685. FormatByteCount = Format(nCount, BYTE_FORMAT_SPECIFIER)
  2686. End If
  2687. Exit Function
  2688. ' Error Handler for this method
  2689. ErrTrap_FormatByteCount:
  2690. DisplayError "FormatByteCount"
  2691. End Function
  2692. ' =============================================================================
  2693. ' Method: LaunchFile
  2694. ' Type: Subroutine
  2695. ' Description: A method to start a program, either by starting an executable
  2696. ' directly or by "executing" a well-known extension, whose
  2697. ' association is recorded in the registry
  2698. ' Parameters: FileName A string containing a fully qualified pathname
  2699. ' Output: None
  2700. ' Notes: This method utilizes the ShellExecute API. Telling ShellExecute
  2701. ' to "Open" the file is the same as double-clicking on a file
  2702. ' listing in the Windows Explorer. If the specified file is an
  2703. ' application, it will be launched directly. If it is a data file
  2704. ' and its extension is associated with an application in the
  2705. ' registry, that application will be launched and loaded with
  2706. ' this file. Otherwise, this call will fail.
  2707. ' =============================================================================
  2708. '
  2709. Private Sub LaunchFile(szFileName As String)
  2710. On Error GoTo ErrTrap_LaunchFile
  2711. Dim handle As Long
  2712. Dim szErrString As Long
  2713. handle = ShellExecute(0, "Open", szFileName, 0, 0, SW_SHOWNORMAL)
  2714. ' Check for failure and report it
  2715. If handle <= 32 Then
  2716. ' NOTE: Ordinarily, these strings should be stored in a string table as part
  2717. ' of a resource file attached to this project. This would allow for a
  2718. ' single place manage all literal strings, as well as allow for
  2719. ' easy localization for international versions. For the purposes of
  2720. ' simplicity, however, the strings have been placed here directly.
  2721. Select Case handle
  2722. Case ERROR_FILE_NOT_FOUND
  2723. szErrString = "The specified file was not found."
  2724. Case ERROR_PATH_NOT_FOUND
  2725. szErrString = "The specified path was not found."
  2726. Case ERROR_BAD_FORMAT
  2727. szErrString = "The .exe file is invalid (non-Win32� .exe or error in .exe image)."
  2728. Case SE_ERR_ACCESSDENIED
  2729. szErrString = "The operating system denied access to the specified file."
  2730. Case SE_ERR_ASSOCINCOMPLETE
  2731. szErrString = "The file name association is incomplete or invalid."
  2732. Case SE_ERR_DDEBUSY
  2733. szErrString = "The DDE transaction could not be completed because other DDE transactions were being processed."
  2734. Case SE_ERR_DDEFAIL
  2735. szErrString = "The DDE transaction failed."
  2736. Case SE_ERR_DDETIMEOUT
  2737. szErrString = "The DDE transaction could not be completed because the request timed out."
  2738. Case SE_ERR_DLLNOTFOUND
  2739. szErrString = "The specified dynamic-link library was not found."
  2740. Case SE_ERR_FNF
  2741. szErrString = "The specified file was not found."
  2742. Case SE_ERR_NOASSOC
  2743. szErrString = "There is no application associated with the given file name extension."
  2744. Case SE_ERR_OOM
  2745. szErrString = "There was not enough memory to complete the operation."
  2746. Case SE_ERR_PNF
  2747. szErrString = "The specified path was not found."
  2748. Case SE_ERR_SHARE
  2749. szErrString = "A sharing violation occurred"
  2750. End Select
  2751. ConsoleMsgBox szErrString, vbExclamation, SZ_ERRSHELLEXEC
  2752. End If ' handle <= 32
  2753. Exit Sub
  2754. ' Error Handler for this method
  2755. ErrTrap_LaunchFile:
  2756. DisplayError "LaunchFile"
  2757. End Sub
  2758. ' =============================================================================
  2759. ' Method: LaunchFiles
  2760. ' Type: Subroutine
  2761. ' Description: Calls LaunchFile for each file in the specified ListItems
  2762. ' collection.
  2763. ' Parameters: ListItems An MMCListItems collection.
  2764. ' Output: None
  2765. ' Notes: None
  2766. ' =============================================================================
  2767. '
  2768. Private Sub LaunchFiles(ListItems As MMCListItems)
  2769. On Error GoTo ErrTrap_LaunchFiles
  2770. Dim ListItem As MMCListItem
  2771. For Each ListItem In ListItems
  2772. LaunchFile ListItem.Key
  2773. Next ListItem
  2774. Exit Sub
  2775. ' Error Handler for this method
  2776. ErrTrap_LaunchFiles:
  2777. DisplayError "LaunchFiles"
  2778. End Sub
  2779. ' =============================================================================
  2780. ' Method: LaunchFileRunAs
  2781. ' Type: Subroutine
  2782. ' Description: A method to start a program. This method will present a dialog
  2783. ' box to allow the user to modify the command line before it
  2784. ' is executed
  2785. ' Parameters: FileName A string containing a fully qualified pathname
  2786. ' Output: None
  2787. ' Notes: In this method we use the Shell command rather than the
  2788. ' ShellExecute. This is because the ShellExecute API does not
  2789. ' search through the PATH string, but here we want the RunAs
  2790. ' behavior to mimic a CommandPrompt
  2791. ' =============================================================================
  2792. '
  2793. Private Sub LaunchFileRunAs(szFileName As String)
  2794. On Error GoTo ErrTrap_LaunchFileRunAs
  2795. Dim szCommandLine As String
  2796. ' Bring the dialog form into memory
  2797. Load frmRunAs
  2798. ' Prep the edit field for presentation to the user
  2799. frmRunAs.txtCmdLine = szFileName
  2800. ' Display the form as a Modal dialog. This is necessary since we
  2801. ' cannot display modeless dialogs while running as a snap-in.
  2802. frmRunAs.Show vbModal
  2803. ' Check to see if there is a command line to execute
  2804. If frmRunAs.txtCmdLine.Text <> "" Then
  2805. ' The shell command will return a taskID upon successful
  2806. ' completion. At this point, we don't really care what happens
  2807. ' to the process we're launching, so we're not assigning
  2808. ' the return value to anything.
  2809. Shell frmRunAs.txtCmdLine, vbNormalFocus
  2810. End If
  2811. ' Dump the form from memory
  2812. Unload frmRunAs
  2813. Exit Sub
  2814. ' Error Handler for this method
  2815. ErrTrap_LaunchFileRunAs:
  2816. DisplayError "LaunchFileRunAs"
  2817. End Sub
  2818. ' =============================================================================
  2819. ' Method: LaunchFilesRunAs
  2820. ' Type: Subroutine
  2821. ' Description: Calls LaunchFileRunAs for each file in the specified ListItems
  2822. ' collection.
  2823. ' Parameters: ListItems An MMCListItems collection.
  2824. ' Output: None
  2825. ' Notes: None
  2826. ' =============================================================================
  2827. '
  2828. Private Sub LaunchFilesRunAs(ListItems As MMCListItems)
  2829. On Error GoTo ErrTrap_LaunchFilesRunAs
  2830. Dim ListItem As MMCListItem
  2831. For Each ListItem In ListItems
  2832. LaunchFileRunAs ListItem.Key
  2833. Next ListItem
  2834. Exit Sub
  2835. ' Error Handler for this method
  2836. ErrTrap_LaunchFilesRunAs:
  2837. DisplayError "LaunchFilesRunAs"
  2838. End Sub
  2839. ' =============================================================================
  2840. ' Method: GetBaseName
  2841. ' Type: Function
  2842. ' Description: Returns the base name extracted from a fully qualified file path.
  2843. '
  2844. ' Parameters: Path Fully qualified path name
  2845. ' varLastBackSlashPos Optional. If present then 1 based index of
  2846. ' last backslash is returned here
  2847. ' Output: Base name of file
  2848. ' Notes: Example: If path is "c:\winnt\system32\event.log" the returned
  2849. ' string is "event.log"
  2850. ' =============================================================================
  2851. '
  2852. Private Function GetBaseName(ByVal Path As String, _
  2853. ByRef varLastBackSlashPos As Variant) As String
  2854. On Error GoTo ErrTrap_GetBaseName
  2855. ' Search from the last character of the string for the last occurrence of '\'
  2856. Dim iLastBackSlashPos As Integer
  2857. iLastBackSlashPos = InStrRev(Path, "\", -1, vbTextCompare)
  2858. If iLastBackSlashPos = 0 Then
  2859. Err.Raise vbObjectError + 513, _
  2860. "FileExplorer", "Could not find last backslash in path " & Path
  2861. End If
  2862. 'Extract the file name from the right side of the path
  2863. GetBaseName = Right$(Path, Len(Path) - iLastBackSlashPos)
  2864. ' If requested, return the position of the last backslash
  2865. If Not IsMissing(varLastBackSlashPos) Then
  2866. varLastBackSlashPos = iLastBackSlashPos
  2867. End If
  2868. Exit Function
  2869. ' Error Handler for this method
  2870. ErrTrap_GetBaseName:
  2871. DisplayError "GetBaseName"
  2872. End Function
  2873. ' =============================================================================
  2874. ' Method: Rename
  2875. ' Type: Function
  2876. ' Description: Replaces the file name within a fully qualified path
  2877. '
  2878. ' Parameters: OldPath Fully qualified path name
  2879. ' NewName New file name
  2880. '
  2881. ' Output: New fully qualified path with file name replaced.
  2882. ' Notes: Example: If OldPath is "c:\winnt\system32\event.log" and
  2883. ' NewName is "event.txt", returns "c:\winnt\system32\event.txt"
  2884. ' =============================================================================
  2885. '
  2886. Private Function Rename(OldPath As String, NewName As String) As String
  2887. On Error GoTo ErrTrap_Rename
  2888. Dim LastBackSlashPos As Integer
  2889. Dim OldName As String
  2890. ' Build the new complete path
  2891. ' Get the old file name from the old path
  2892. OldName = GetBaseName(OldPath, LastBackSlashPos)
  2893. Rename = Left$(OldPath, LastBackSlashPos) & NewName
  2894. Exit Function
  2895. ' Error Handler for this method
  2896. ErrTrap_Rename:
  2897. DisplayError "Rename"
  2898. End Function
  2899. ' =============================================================================
  2900. ' Method: CreateNewDirectory
  2901. ' Type: Subroutine
  2902. ' Description: Creates a new directory in the file system and adds a new
  2903. ' scope item for it
  2904. '
  2905. ' Parameters: ParentScopeItem ScopeItem of parent directory in which to
  2906. ' create the new directory
  2907. '
  2908. ' Output: None
  2909. ' Notes: Creates a new directory under the specified parent using the
  2910. ' name "New Folder". If that name exists then searches for an
  2911. ' unused name by appending digits e.g. "New Folder (1)".
  2912. ' If the parent scope item has not yet been expanded in the
  2913. ' namespace then that is done so that the scope item for the new
  2914. ' folder may be added at this time.
  2915. ' =============================================================================
  2916. '
  2917. Private Sub CreateNewDirectory(ParentScopeItem As SnapInLib.ScopeItem)
  2918. On Error GoTo ErrTrap_CreateNewDirectory
  2919. Dim Drive As Scripting.Drive
  2920. Dim Folder As Scripting.Folder
  2921. Dim NewFolder As Scripting.Folder
  2922. Dim NewFolderName As String
  2923. Dim Digit As Integer
  2924. If TypeOf ParentScopeItem.Tag Is Scripting.Drive Then
  2925. Set Drive = ParentScopeItem.Tag
  2926. Set Folder = Drive.RootFolder
  2927. Else
  2928. Set Folder = ParentScopeItem.Tag
  2929. End If
  2930. ' Find a unique name for the new folder. Try "New Folder". If that is used then try
  2931. ' "New Folder(1)", "New Folder (2)", etc.
  2932. NewFolderName = Folder.Path & "\New Folder"
  2933. Digit = 0
  2934. While m_FileSystemObject.FolderExists(NewFolderName)
  2935. Digit = Digit + 1
  2936. NewFolderName = Folder.Path & "\New Folder (" & LTrim$(Str$(Digit)) & ")"
  2937. Wend
  2938. ' Create the new folder
  2939. Set NewFolder = m_FileSystemObject.CreateFolder(NewFolderName)
  2940. ' Add a new scope item for the sub-directory. If the parent hasn't yet been expanded
  2941. ' then do it now and the scope item will be added. If it has already been expanded
  2942. ' then add the new scope item.
  2943. If Not ParentScopeItem.ScopeNode.ExpandedOnce Then
  2944. ParentScopeItem.ScopeNode.ExpandInNameSpace
  2945. Else
  2946. AddNewFolder ParentScopeItem, NewFolder
  2947. End If
  2948. Exit Sub
  2949. ' Error Handler for this method
  2950. ErrTrap_CreateNewDirectory:
  2951. DisplayError "CreateNewDirectory"
  2952. End Sub
  2953. ' =============================================================================
  2954. ' Method: ProcessUICommand
  2955. ' Type: Subroutine
  2956. ' Description: Processes user input from toolbar, menu button, and context menus.
  2957. '
  2958. ' Parameters: Selection MMCClipboard object containing the current selected
  2959. ' items. The selection may be in either the scope pane
  2960. ' or in the result pane.
  2961. ' Command String containing key of command to execute (KEY_ADD,
  2962. ' KEY_RUN, or KEY_RUNAS).
  2963. '
  2964. ' Output: None
  2965. ' Notes: For KEY_ADD creates a new directory under the selected directory
  2966. ' For KEY_RUN calls LaunchFiles for the selected files
  2967. ' For KEY_RUNAS calls LaunchFilesRunAs for the selected files
  2968. ' =============================================================================
  2969. '
  2970. Private Sub ProcessUICommand(ByVal Selection As SnapInLib.IMMCClipboard, _
  2971. ByVal Command As String)
  2972. On Error GoTo ErrTrap_ProcessUICommand
  2973. Dim RootScopeItem As ScopeItem
  2974. Dim SelectionType As SnapInSelectionTypeConstants
  2975. SelectionType = Selection.SelectionType
  2976. Select Case Command
  2977. Case KEY_ADD
  2978. If SelectionType = siSingleScopeItem Then
  2979. CreateNewDirectory Selection.ScopeItems(1)
  2980. End If
  2981. Case KEY_RUN
  2982. If (SelectionType = siSingleListItem) Or (SelectionType = siMultiListItems) Then
  2983. ' Launch the requested files, using the LaunchFile utility method
  2984. LaunchFiles Selection.ListItems
  2985. End If
  2986. Case KEY_RUNAS
  2987. If (SelectionType = siSingleListItem) Or (SelectionType = siMultiListItems) Then
  2988. ' Launch the requested files, using the LaunchFileRunAs utility method
  2989. LaunchFilesRunAs Selection.ListItems
  2990. End If
  2991. Case KEY_CONFIGURATION
  2992. ' Get the root scope item of the snap-in
  2993. On Error Resume Next
  2994. Set RootScopeItem = ScopeItems(SZ_STATICNODE)
  2995. On Error GoTo ErrTrap_ProcessUICommand
  2996. If RootScopeItem Is Nothing Then
  2997. Set RootScopeItem = ScopeItems(SZ_EXTENSION_ROOT)
  2998. End If
  2999. ' Create a property sheet with the configuration wizard. This is the same
  3000. ' wizard that is displayed when FileExplorer is added to a console.
  3001. With Views.CurrentView.PropertySheetProvider
  3002. ' Create the property sheet as a wizard.
  3003. .CreatePropertySheet "FileExplorer Configuration Wizard", siWizard, RootScopeItem
  3004. ' Tell MMC to add the pages for the primary snap-in. This will fire
  3005. ' Views_QueryPagesFor and Views_CreatePropertyPages
  3006. .AddPrimaryPages True
  3007. ' Tell MMC to show the property sheet starting with the 1st page
  3008. .Show 1
  3009. ' Call the SnapIn_ConfigurationComplete event handler as it
  3010. ' knows what to do after running the wizard.
  3011. SnapIn_ConfigurationComplete m_ConfigData
  3012. End With
  3013. Case Else
  3014. ' This should not occur. If it does, it is because the
  3015. ' toolbar, menu button, or context menus have been modified and
  3016. ' this select statement has not been updated to deal with it.
  3017. ' This will catch the developer's attention without causing problems
  3018. ' for any unwary end users.
  3019. Debug.Assert False
  3020. End Select
  3021. Exit Sub
  3022. ' Error Handler for this method
  3023. ErrTrap_ProcessUICommand:
  3024. DisplayError "ProcessUICommand"
  3025. End Sub
  3026. ' =============================================================================
  3027. ' Method: ConfirmOverwrite
  3028. ' Type: Function
  3029. ' Description: Displays a message box asking the user whether to overwrite
  3030. ' an existing file.
  3031. '
  3032. ' Parameters: Path Fully qualified path of file that will be overwritten
  3033. '
  3034. ' Output: True if user indicated it is OK to overwrite, otherwise False
  3035. ' Notes: None
  3036. ' =============================================================================
  3037. '
  3038. Private Function ConfirmOverwrite(Path As String) As Boolean
  3039. On Error GoTo ErrTrap_ConfirmOverwrite
  3040. Dim Choice As Integer
  3041. Choice = ConsoleMsgBox(Path & " exists." & vbCrLf & _
  3042. "Do you wish to overwrite?", _
  3043. vbYesNo, "FileExplorer")
  3044. If Choice = vbYes Then
  3045. ConfirmOverwrite = True
  3046. Else
  3047. ConfirmOverwrite = False
  3048. End If
  3049. Exit Function
  3050. ' Error Handler for this method
  3051. ErrTrap_ConfirmOverwrite:
  3052. DisplayError "ConfirmOverwrite"
  3053. End Function
  3054. ' =============================================================================
  3055. ' Method: SetUpFilter
  3056. ' Type: Subroutine
  3057. ' Description: Initializes column header filters
  3058. '
  3059. ' Parameters: ResultView ResultView being initialized
  3060. '
  3061. ' Output: None
  3062. ' Notes: We only support filtering on the file name so all other columns
  3063. ' are set to a zero length empty string filter to prevent the user from
  3064. ' typing in a value
  3065. '
  3066. ' =============================================================================
  3067. '
  3068. Private Sub SetUpFilter(ResultView As SnapInLib.ResultView)
  3069. On Error GoTo ErrTrap_SetUpFilter
  3070. m_FilterValue = "*"
  3071. m_FilterByName = False
  3072. m_FilterByExt = True
  3073. With ResultView.ListView
  3074. .ColumnHeaders(KEY_NAME).TextFilter = "*"
  3075. .ColumnHeaders(KEY_NAME).TextFilterMaxLen = 256
  3076. .ColumnHeaders(KEY_SIZE).TextFilter = ""
  3077. .ColumnHeaders(KEY_SIZE).TextFilterMaxLen = 0
  3078. .ColumnHeaders(KEY_DATE).TextFilter = ""
  3079. .ColumnHeaders(KEY_DATE).TextFilterMaxLen = 0
  3080. .ColumnHeaders(KEY_ATTRIBUTES).TextFilter = ""
  3081. .ColumnHeaders(KEY_ATTRIBUTES).TextFilterMaxLen = 0
  3082. End With
  3083. Exit Sub
  3084. ' Error Handler for this method
  3085. ErrTrap_SetUpFilter:
  3086. DisplayError "SetUpFilter"
  3087. End Sub
  3088. ' =============================================================================
  3089. ' Method: ExtensionSnapIn_Expand
  3090. ' Type: Event
  3091. ' Description: Called when this snap-in is added as a namespace extension of
  3092. ' Computer Management\System Tools on Windows 2000.
  3093. '
  3094. ' Parameters: Data MMCDataObject containing the data exported by the
  3095. ' parent node of the snap-in we are extending
  3096. ' ScopeNode Represents the parent node
  3097. '
  3098. ' Output: None
  3099. ' Notes: The actual data exported by the System Tools node is not
  3100. ' important so we do not examine it. We double check the parent
  3101. ' node's node type GUID but in theory this is not necessary as
  3102. ' this event would only be fired when the System Tools node is
  3103. ' expanding as that it the only node type we extend. When extending
  3104. ' multiple node types that check would be essential. We add our
  3105. ' ExtensionRoot predefined node underneath the parent. This node
  3106. ' is a carbon copy of our static node.
  3107. ' =============================================================================
  3108. '
  3109. Private Sub ExtensionSnapIn_Expand(ByVal Data As SnapInLib.IMMCDataObject, _
  3110. ByVal ScopeNode As SnapInLib.IScopeNode)
  3111. On Error GoTo ErrTrap_ExtensionSnapIn_Expand
  3112. Dim MachineName As String
  3113. Dim ExtensionRoot As ScopeItem
  3114. ' If the expanding node is Computer Management\System Tools then add our
  3115. ' extension root underneath it.
  3116. If ScopeNode.NodeTypeGUID = "{476e6448-aaff-11d0-b944-00c04fd8d5b0}" Then
  3117. On Error Resume Next
  3118. MachineName = FormatData(Data.GetData("MMC_SNAPIN_MACHINE_NAME", 512), 1, siString)
  3119. On Error GoTo ErrTrap_ExtensionSnapIn_Expand
  3120. If MachineName = "" Then
  3121. MachineName = "Local Machine"
  3122. End If
  3123. Set ExtensionRoot = ScopeItems.AddPreDefined(SZ_EXTENSION_ROOT, _
  3124. SZ_EXTENSION_ROOT, _
  3125. ScopeNode, siParent)
  3126. ExtensionRoot.ScopeNode.DisplayName = "FileExplorer for " & MachineName
  3127. End If
  3128. Exit Sub
  3129. ' Error Handler for this method
  3130. ErrTrap_ExtensionSnapIn_Expand:
  3131. DisplayError "ExtensionSnapIn_Expand"
  3132. End Sub
  3133. ' =============================================================================
  3134. ' Method: mnuNewFolder_Click
  3135. ' Type: Event
  3136. ' Description: Called when the "Folder" item on the "New" context menu is clicked
  3137. '
  3138. '
  3139. ' Parameters: Index This will always be 1 as we are directly handling
  3140. ' the event on the individual menu item rather than
  3141. ' the event on its parent.
  3142. ' Selection MMCClipboard object containing the currently selected
  3143. ' items. The selection may be in either the scope pane
  3144. ' or in the result pane.
  3145. '
  3146. ' Output: None
  3147. ' Notes: Calls ProcessUICommand to do the work.
  3148. ' =============================================================================
  3149. '
  3150. Private Sub mnuNewFolder_Click(ByVal Index As Long, _
  3151. ByVal Selection As SnapInLib.IMMCClipboard)
  3152. On Error GoTo ErrTrap_mnuNewFolder_Click
  3153. ProcessUICommand Selection, KEY_ADD
  3154. Exit Sub
  3155. ' Error Handler for this method
  3156. ErrTrap_mnuNewFolder_Click:
  3157. DisplayError "mnuNewFolder_Click"
  3158. End Sub
  3159. ' =============================================================================
  3160. ' Method: mnuRun_Click
  3161. ' Type: Event
  3162. ' Description: Called when the "Run" item on the context menu is clicked
  3163. '
  3164. '
  3165. ' Parameters: Index This will always be 1 as we are directly handling
  3166. ' the event on the individual menu item rather than
  3167. ' the event on its parent.
  3168. ' Selection MMCClipboard object containing the currently selected
  3169. ' items. The selection may be in either the scope pane
  3170. ' or in the result pane.
  3171. '
  3172. ' Output: None
  3173. ' Notes: Calls ProcessUICommand to do the work.
  3174. ' =============================================================================
  3175. '
  3176. Private Sub mnuRun_Click(ByVal Index As Long, _
  3177. ByVal Selection As SnapInLib.IMMCClipboard)
  3178. On Error GoTo ErrTrap_mnuRun_Click
  3179. ProcessUICommand Selection, KEY_RUN
  3180. Exit Sub
  3181. ' Error Handler for this method
  3182. ErrTrap_mnuRun_Click:
  3183. DisplayError "mnuRun_Click"
  3184. End Sub
  3185. ' =============================================================================
  3186. ' Method: mnuRunAs_Click
  3187. ' Type: Event
  3188. ' Description: Called when the "Run As..." item on the context menu is clicked
  3189. '
  3190. '
  3191. ' Parameters: Index This will always be 1 as we are directly handling
  3192. ' the event on the individual menu item rather than
  3193. ' the event on its parent.
  3194. ' Selection MMCClipboard object containing the currently selected
  3195. ' items. The selection may be in either the scope pane
  3196. ' or in the result pane.
  3197. '
  3198. ' Output: None
  3199. ' Notes: Calls ProcessUICommand to do the work.
  3200. ' =============================================================================
  3201. '
  3202. Private Sub mnuRunAs_Click(ByVal Index As Long, _
  3203. ByVal Selection As SnapInLib.IMMCClipboard)
  3204. On Error GoTo ErrTrap_mnuRunAs_Click
  3205. ProcessUICommand Selection, KEY_RUNAS
  3206. Exit Sub
  3207. ' Error Handler for this method
  3208. ErrTrap_mnuRunAs_Click:
  3209. DisplayError "mnuRunAs_Click"
  3210. End Sub
  3211. ' =============================================================================
  3212. ' Method: FilterResultPane
  3213. ' Type: Subroutine
  3214. ' Description: Filters the contents of the list view in the result pane
  3215. ' Parameters: ResultView The ResultView to be filtered
  3216. ' Output: None
  3217. ' Notes: See ResultViews_FilterButtonClick for an explanation of how the
  3218. ' filter operator is applied.
  3219. ' =============================================================================
  3220. Private Sub FilterResultPane(ResultView As SnapInLib.ResultView)
  3221. On Error GoTo ErrTrap_FilterResultPane
  3222. Dim Folder As Scripting.Folder
  3223. Dim Drive As Scripting.Drive
  3224. With ResultView.ScopePaneItem.ScopeItem
  3225. ' Get the folder of the currently selected scope item in the scope pane
  3226. Set Folder = Nothing
  3227. If TypeOf .Tag Is Scripting.Folder Then
  3228. Set Folder = .Tag
  3229. ElseIf TypeOf .Tag Is Scripting.Drive Then
  3230. Set Drive = .Tag
  3231. If Drive.IsReady Then
  3232. Set Folder = Drive.RootFolder
  3233. End If
  3234. End If
  3235. If Folder Is Nothing Then
  3236. Exit Sub
  3237. End If
  3238. ' Remove all the files from the result pane
  3239. ResultView.ListView.ListItems.Clear
  3240. ' Re-add all of the files. AddFilesToView will filter out files that do not
  3241. ' apply
  3242. AddFilesToView Folder, ResultView
  3243. End With
  3244. Exit Sub
  3245. ' Error Handler for this method
  3246. ErrTrap_FilterResultPane:
  3247. DisplayError "FilterResultPane"
  3248. End Sub
  3249. ' =============================================================================
  3250. ' Method: mnuURL_Click
  3251. ' Type: Event
  3252. ' Description: Called when the "URL..." item is clicked on the "New" submenu
  3253. ' for the Internet Explorer node
  3254. '
  3255. ' Parameters: Index This will always be 1 as we are directly handling
  3256. ' the event on the individual menu item rather than
  3257. ' the event on its parent.
  3258. ' Selection MMCClipboard object containing the currently selected
  3259. ' items. The selection may be in either the scope pane
  3260. ' or in the result pane.
  3261. '
  3262. ' Output: None
  3263. ' Notes: Display the property sheet for the Internet Explorer node.
  3264. ' =============================================================================
  3265. '
  3266. Private Sub mnuURL_Click(ByVal Index As Long, _
  3267. ByVal Selection As SnapInLib.MMCClipboard)
  3268. On Error GoTo ErrTrap_mnuURL_Click
  3269. ' Display the property sheet for the Internet Explorer node programmatically.
  3270. With CurrentView.PropertySheetProvider
  3271. .CreatePropertySheet "Internet Explorer", siPropertySheet, _
  3272. ScopeItems(SZ_INTERNETEXPLORER), True, True
  3273. ' Check if the Internet Explorer scope item is selected in the scope pane
  3274. If CurrentScopePaneItem.Key = SZ_INTERNETEXPLORER Then
  3275. .AddPrimaryPages True
  3276. Else
  3277. .AddPrimaryPages False
  3278. End If
  3279. .Show 1
  3280. End With
  3281. Exit Sub
  3282. ' Error Handler for this method
  3283. ErrTrap_mnuURL_Click:
  3284. DisplayError "mnuURL_Click"
  3285. End Sub
  3286. ' =============================================================================
  3287. ' Method: ResultViews_Activate
  3288. ' Type: Event
  3289. ' Description: Fired when a ResultView is about to be displayed in the result
  3290. ' pane
  3291. ' Parameters: ResultView The ResultView being shown
  3292. ' Output: None
  3293. ' Notes: We use this event to put a count of the objects in the result
  3294. ' pane into the description bar. The description bar is like
  3295. ' a status bar but it appears on top of the result pane. It is
  3296. ' only displayed if the user makes it visible using the View menu.
  3297. ' Note that a snap-in cannot write to the description bar during
  3298. ' ResultViews_Initialize because MMC has not yet created
  3299. ' the result pane at that point.
  3300. ' =============================================================================
  3301. '
  3302. Private Sub ResultViews_Activate(ByVal ResultView As SnapInLib.IResultView)
  3303. On Error GoTo ErrTrap_ResultViews_Activate
  3304. Dim Drive As Scripting.Drive
  3305. Dim Folder As Scripting.Folder
  3306. Dim Files As Scripting.Files
  3307. Set Folder = Nothing
  3308. ' If this is the IE Browser Node then display the URL in the status bar
  3309. If ResultView.ScopePaneItem.Name = SZ_INTERNETEXPLORER Then
  3310. CurrentView.SetStatusBarText ResultView.DisplayString
  3311. End If
  3312. ' Get the folder for which contents are being displayed in the result pane
  3313. With ResultView.ScopePaneItem.ScopeItem
  3314. If TypeOf .Tag Is Scripting.Folder Then
  3315. Set Folder = .Tag
  3316. ElseIf TypeOf .Tag Is Scripting.Drive Then
  3317. Set Drive = .Tag
  3318. If Drive.IsReady Then
  3319. Set Folder = Drive.RootFolder
  3320. End If
  3321. End If
  3322. End With
  3323. If Folder Is Nothing Then
  3324. Exit Sub
  3325. End If
  3326. ' Put the count of all directories and files on the description bar
  3327. ResultView.SetDescBarText CStr(Folder.SubFolders.Count + Folder.Files.Count) & " object(s)"
  3328. Exit Sub
  3329. ' Error Handler for this method
  3330. ErrTrap_ResultViews_Activate:
  3331. DisplayError "ResultViews_Activate"
  3332. End Sub
  3333. ' =============================================================================
  3334. ' Method: ResultViews_CompareItems
  3335. ' Type: Event
  3336. ' Description: Fired when populating a sorted listview
  3337. ' Parameters: ResultView The ResultView being populated
  3338. ' Object1 First item to compare
  3339. ' Object2 Second item to compare
  3340. ' Column The column on which the sort is occurring
  3341. ' Result Comparison Result returned here
  3342. '
  3343. ' Output: Result 0 if list items are lexically equal
  3344. ' 1 if item1 is lexcially greater than item 2
  3345. ' -1 if item1 is lexcially lesser than item 2
  3346. ' Notes: This event does not need to take into account the sort order as MMC
  3347. ' will reverse the result as needed depending on the sort order.
  3348. ' FileExplorer allows sorting on date and size for files and folders, or
  3349. ' total size and free space for drives.
  3350. ' Note that there is no code in this handler for the name and attribute
  3351. ' columns because we use the default sort which is a alphabetical.
  3352. ' On MMC 1.1, both objects will always be list items. On MMC 1.2
  3353. ' they could be either scope items or list items.
  3354. ' =============================================================================
  3355. '
  3356. Private Sub ResultViews_CompareItems(ByVal ResultView As SnapInLib.ResultView, _
  3357. ByVal Object1 As Object, _
  3358. ByVal Object2 As Object, _
  3359. ByVal Column As Long, _
  3360. Result As Variant)
  3361. On Error GoTo ErrTrap_ResultViews_CompareItems
  3362. Dim ScopeItem1 As ScopeItem
  3363. Dim ScopeItem2 As ScopeItem
  3364. Dim ListItem1 As MMCListItem
  3365. Dim ListItem2 As MMCListItem
  3366. Dim Drive1 As Scripting.Drive
  3367. Dim Drive2 As Scripting.Drive
  3368. Dim Folder1 As Scripting.Folder
  3369. Dim Folder2 As Scripting.Folder
  3370. Dim File1 As Scripting.File
  3371. Dim File2 As Scripting.File
  3372. Dim Size1 As Double
  3373. Dim Size2 As Double
  3374. Dim Date1 As Date
  3375. Dim Date2 As Date
  3376. Dim fSizeCompare As Boolean
  3377. Dim fDateCompare As Boolean
  3378. fSizeCompare = False
  3379. fDateCompare = False
  3380. ' Determine whether we have scope items or list items
  3381. If TypeOf Object1 Is ScopeItem Then
  3382. Set ScopeItem1 = Object1
  3383. Else
  3384. Set ListItem1 = Object1
  3385. End If
  3386. If TypeOf Object2 Is ScopeItem Then
  3387. Set ScopeItem2 = Object2
  3388. Else
  3389. Set ListItem2 = Object2
  3390. End If
  3391. ' If we have scope items then determine whether they represent folders or
  3392. ' drives.
  3393. If Not ScopeItem1 Is Nothing Then
  3394. If TypeOf ScopeItem1.Tag Is Scripting.Drive Then
  3395. Set Drive1 = ScopeItem1.Tag
  3396. ElseIf TypeOf ScopeItem1.Tag Is Scripting.Folder Then
  3397. Set Folder1 = ScopeItem1.Tag
  3398. End If
  3399. End If
  3400. If Not ScopeItem2 Is Nothing Then
  3401. If TypeOf ScopeItem2.Tag Is Scripting.Drive Then
  3402. Set Drive2 = ScopeItem2.Tag
  3403. ElseIf TypeOf ScopeItem2.Tag Is Scripting.Folder Then
  3404. Set Folder2 = ScopeItem2.Tag
  3405. End If
  3406. End If
  3407. ' If we have list items then get the file objects
  3408. If Not ListItem1 Is Nothing Then
  3409. Set File1 = ListItem1.Tag
  3410. End If
  3411. If Not ListItem2 Is Nothing Then
  3412. Set File2 = ListItem2.Tag
  3413. End If
  3414. ' If the request is to compare a folder and a file then return a result indicating that
  3415. ' the folder is lexcially lesser than the file. This ensures that folders always appear
  3416. ' together and files appear together, each group sorted among themselves. This is
  3417. ' similar to the way the Windows Explorer displays folders and files.
  3418. If (Not Folder1 Is Nothing) And (Not File2 Is Nothing) Then
  3419. Result = -1
  3420. Exit Sub
  3421. ElseIf (Not File1 Is Nothing) And (Not Folder2 Is Nothing) Then
  3422. Result = 1
  3423. Exit Sub
  3424. End If
  3425. ' If we have drives then we could be sorting on total size or free space. If it is
  3426. ' anything else then let the designer runtime do an alphabetical sort.
  3427. If Not Drive1 Is Nothing Then
  3428. If (Column <> COLNUM_TOTALSIZE) And (Column <> COLNUM_FREESPACE) Then
  3429. Exit Sub
  3430. End If
  3431. fSizeCompare = True
  3432. If Column = COLNUM_TOTALSIZE Then
  3433. If Drive1.IsReady Then
  3434. Size1 = Drive1.TotalSize
  3435. Else
  3436. Size1 = 0
  3437. End If
  3438. If Drive2.IsReady Then
  3439. Size2 = Drive2.TotalSize
  3440. Else
  3441. Size2 = 0
  3442. End If
  3443. ElseIf Column = COLNUM_FREESPACE Then
  3444. If Drive1.IsReady Then
  3445. Size1 = Drive1.FreeSpace
  3446. Else
  3447. Size1 = 0
  3448. End If
  3449. If Drive2.IsReady Then
  3450. Size2 = Drive2.FreeSpace
  3451. Else
  3452. Size2 = 0
  3453. End If
  3454. End If
  3455. Else
  3456. ' Folders or files. Could be size or date. If it is anything else then let the
  3457. ' runtime handle it.
  3458. If (Column <> COLNUM_SIZE) And (Column <> COLNUM_DATE) Then
  3459. Exit Sub
  3460. End If
  3461. If Column = COLNUM_SIZE Then
  3462. fSizeCompare = True
  3463. If Not Folder1 Is Nothing Then
  3464. Size1 = Folder1.Size
  3465. Else
  3466. Size1 = File1.Size
  3467. End If
  3468. If Not Folder2 Is Nothing Then
  3469. Size2 = Folder2.Size
  3470. Else
  3471. Size2 = File2.Size
  3472. End If
  3473. Else ' COLNUM_DATE
  3474. fDateCompare = True
  3475. If Not Folder1 Is Nothing Then
  3476. Date1 = Folder1.DateLastModified
  3477. Else
  3478. Date1 = File1.DateLastModified
  3479. End If
  3480. If Not Folder2 Is Nothing Then
  3481. Date2 = Folder2.DateLastModified
  3482. Else
  3483. Date2 = File2.DateLastModified
  3484. End If
  3485. End If
  3486. End If
  3487. ' At this point we know whether we are comparing sizes or dates so do the comparison
  3488. ' and return a result. The result is computed in the same way as the function StrComp.
  3489. If fSizeCompare Then
  3490. If Size1 = Size2 Then
  3491. Result = 0
  3492. ElseIf Size1 > Size2 Then
  3493. Result = 1
  3494. Else
  3495. Result = -1
  3496. End If
  3497. Else
  3498. If Date1 = Date2 Then
  3499. Result = 0
  3500. ElseIf Date1 > Date2 Then
  3501. Result = 1
  3502. Else
  3503. Result = -1
  3504. End If
  3505. End If
  3506. Exit Sub
  3507. ' Error Handler for this method
  3508. ErrTrap_ResultViews_CompareItems:
  3509. DisplayError "ResultViews_CompareItems"
  3510. End Sub
  3511. ' =============================================================================
  3512. ' Method: ResultViews_FilterButtonClick
  3513. ' Type: Event
  3514. ' Description: Fired when a the user clicks the filter button
  3515. ' Parameters: ResultView The ResultView in which the click occurred
  3516. ' Column The column on which the click occurred
  3517. ' Left, Top The coordinates of the top left corner of
  3518. ' the column header
  3519. ' Height, Width The width of the column header
  3520. ' Output: None
  3521. ' Notes: The user clicks the filter button in order to change the
  3522. ' filter operator. The filter operator determines how the snap-in
  3523. ' interprets the filter value entered into the header control.
  3524. ' FileExplorer does some very primitive file name filtering as
  3525. ' an example of this feature. The user can choose to filter by
  3526. ' file name or extension. For example, if the user filters by
  3527. ' extension and enters "DLL" for the filter value then FileExplorer
  3528. ' will display only files that match *.dll. Entering a filter
  3529. ' value of "*" will display all files (i.e. *.*).
  3530. ' =============================================================================
  3531. '
  3532. Private Sub ResultViews_FilterButtonClick(ByVal ResultView As SnapInLib.ResultView, _
  3533. ByVal Column As SnapInLib.MMCColumnHeader, _
  3534. ByVal Left As Long, _
  3535. ByVal Top As Long, _
  3536. ByVal Height As Long, _
  3537. ByVal Width As Long)
  3538. On Error GoTo ErrTrap_ResultViews_FilterButtonClick
  3539. ' If this is not the name column then ignore it
  3540. If Column.Key <> KEY_NAME Then
  3541. Exit Sub
  3542. End If
  3543. ' Update the filter value
  3544. m_FilterValue = Column.TextFilter
  3545. ' Display the filter operator popup menu. If the user makes a selection then the
  3546. ' menu event handlers will update m_FilterByName and m_FilterByExt. Set a checkmark
  3547. ' next to the current filter operator before displaying the menu.
  3548. If m_FilterByName Then
  3549. mnuFilterByName.Checked = True
  3550. Else
  3551. mnuFilterByName.Checked = False
  3552. End If
  3553. If m_FilterByExt Then
  3554. mnuFilterByExt.Checked = True
  3555. Else
  3556. mnuFilterByExt.Checked = False
  3557. End If
  3558. CurrentView.PopupMenu mnuFilterOp, Left, Top
  3559. ' MMC will generate a ResultViews_FilterChange event immediately after this
  3560. ' in which we will update the result pane.
  3561. Exit Sub
  3562. ' Error Handler for this method
  3563. ErrTrap_ResultViews_FilterButtonClick:
  3564. DisplayError "ResultViews_FilterButtonClick"
  3565. End Sub
  3566. ' =============================================================================
  3567. ' Method: mnuFilterByName_Click
  3568. ' Type: Event
  3569. ' Description: Fired when a the user selects "Filter by name" on the filter
  3570. ' button popup menu
  3571. ' Parameters: Index Index of the menu item clicked
  3572. ' Selection Not used
  3573. ' Output: None
  3574. ' Notes: Changes the values of module level variables that store the
  3575. ' filter operator
  3576. ' =============================================================================
  3577. '
  3578. Private Sub mnuFilterByName_Click(ByVal Index As Long, ByVal Selection As SnapInLib.MMCClipboard)
  3579. m_FilterByName = True
  3580. m_FilterByExt = False
  3581. End Sub
  3582. ' =============================================================================
  3583. ' Method: mnuFilterByExt_Click
  3584. ' Type: Event
  3585. ' Description: Fired when a the user selects "Filter by extension" on the filter
  3586. ' button popup menu
  3587. ' Parameters: Index Index of the menu item clicked
  3588. ' Selection Not used
  3589. ' Output: None
  3590. ' Notes: Changes the values of module level variables that store the
  3591. ' filter operator
  3592. ' =============================================================================
  3593. '
  3594. Private Sub mnuFilterByExt_Click(ByVal Index As Long, ByVal Selection As SnapInLib.MMCClipboard)
  3595. ' Set the current filter operator
  3596. m_FilterByName = False
  3597. m_FilterByExt = True
  3598. End Sub
  3599. ' =============================================================================
  3600. ' Method: ResultViews_FilterChange
  3601. ' Type: Event
  3602. ' Description: Fired when a the user enters a new filter value or
  3603. ' enables/disables fitlering
  3604. ' Parameters: ResultView The ResultView in which the click occurred
  3605. ' Column The column on which the the click occurred
  3606. ' ChangeType Enable/Disable/New Value
  3607. '
  3608. ' Output: None
  3609. '
  3610. ' Notes: If value has changed then record the filter and refresh the
  3611. ' result pane. If filtering has been disabled then refresh the
  3612. ' result pane so that all files will be displayed.
  3613. ' =============================================================================
  3614. '
  3615. Private Sub ResultViews_FilterChange(ByVal ResultView As SnapInLib.ResultView, _
  3616. ByVal Column As SnapInLib.MMCColumnHeader, _
  3617. ByVal ChangeType As SnapInLib.SnapInFilterChangeTypeConstants)
  3618. On Error GoTo ErrTrap_ResultViews_FilterChange
  3619. ' If enabling, then there's nothing to do yet because the user hasn't entered
  3620. ' any filter value
  3621. If ChangeType = siEnable Then
  3622. Exit Sub
  3623. End If
  3624. ' If disabling then reset the filter value and refresh the result pane
  3625. If ChangeType = siDisable Then
  3626. m_FilterValue = "*"
  3627. FilterResultPane ResultView
  3628. Exit Sub
  3629. End If
  3630. ' It is a filter value change. If this is not the Name column then ignore it
  3631. If Column.Key <> KEY_NAME Then
  3632. Exit Sub
  3633. End If
  3634. ' Record the new filter value
  3635. m_FilterValue = Column.TextFilter
  3636. ' Refresh the result pane and apply the filter
  3637. FilterResultPane ResultView
  3638. Exit Sub
  3639. ' Error Handler for this method
  3640. ErrTrap_ResultViews_FilterChange:
  3641. DisplayError "ResultViews_FilterChange"
  3642. End Sub
  3643. ' =============================================================================
  3644. ' Method: ResultViews_Initialize
  3645. ' Type: Event
  3646. ' Description: Fired when a new ResultView is created.
  3647. ' Parameters: ResultView A reference to the specific ResultView object
  3648. ' being initialized
  3649. ' Output: None
  3650. ' Notes: This is the event used to trigger population of the ResultView.
  3651. ' It only occurs as a ResultView is being created. It is not
  3652. ' fired in response to changing the view mode. In normal
  3653. ' operation, a ResultView's ListItems are destroyed when a new
  3654. ' ResultView is created. ResultViews are not cached by default.
  3655. ' Any ListSubItems attached to ScopeItems appearing in the result
  3656. ' pane will appear automatically. We only need to explicitly add
  3657. ' items that only exist in the ListView (i.e. the files).
  3658. ' =============================================================================
  3659. '
  3660. Private Sub ResultViews_Initialize(ByVal ResultView As SnapInLib.IResultView)
  3661. On Error GoTo ErrTrap_ResultViews_Initialize
  3662. Dim Folder As Scripting.Folder
  3663. ' It is a files listview.
  3664. With ResultView.ScopePaneItem
  3665. ' We are only going to populate the ListView with files for
  3666. ' a node that represents a drive (root directory) or a folder
  3667. If .ScopeItem.ScopeNode.NodeTypeName = SZ_DIRECTORY Then
  3668. ' Let's first make sure that the drive represented by this
  3669. ' ScopeItem is available to be queried (e.g. the A: drive
  3670. ' may not have a floppy disk in it)
  3671. If m_FileSystemObject.GetDrive(m_FileSystemObject.GetDriveName(.ScopeItem.Key)).IsReady Then
  3672. ' Get a reference to the folder object represented
  3673. ' by the current scope node
  3674. Set Folder = m_FileSystemObject.GetFolder(.ScopeItem.Key)
  3675. End If
  3676. ElseIf .ScopeItem.ScopeNode.NodeTypeName = SZ_DESKTOP Then
  3677. ' The Desktop is actually a special folder, that sits under
  3678. ' \<Windows>\Profiles\<Current User>\Desktop, so we can
  3679. ' have files to add to the ListView from here also.
  3680. Dim szPath As String * MAX_PATH ' Variable to receive the pathname into
  3681. Dim hModule As Long
  3682. Dim ProcAddr As Long
  3683. '
  3684. ' Ask the Shell for the real path of the current user's Desktop folder
  3685. ' Note: If IE is installed without the Desktop Update this API is not
  3686. ' available. Therefore, we need to verify the API is available prior
  3687. ' to making the call.
  3688. '
  3689. hModule = LoadLibrary("shell32.dll")
  3690. If hModule <> 0 Then
  3691. ProcAddr = GetProcAddress(hModule, "SHGetSpecialFolderPath")
  3692. If ProcAddr <> 0 Then
  3693. Dim hr As Long ' HRESULT for API call
  3694. hr = SHGetSpecialFolderPath(0, szPath, CSIDL_DESKTOP, False)
  3695. If hr = S_OK Or hr = S_FALSE Then
  3696. ' If we got a valid string, try to open a folder object for it
  3697. Set Folder = m_FileSystemObject.GetFolder(szPath)
  3698. End If
  3699. End If
  3700. End If
  3701. ' If the result view is filtered then switch to report mode as there is
  3702. ' nothing to filter when the desktop is selected.
  3703. If ResultView.ListView.View = siFiltered Then
  3704. ResultView.ListView.View = siReport
  3705. End If
  3706. End If
  3707. ' It is possible that the GetFolder call did not succeed. Check to
  3708. ' see if there is a valid Folder object assigned to Folder.
  3709. If Not Folder Is Nothing Then
  3710. ' Set up column filters.
  3711. If ResultView.ListView.View = siFiltered Then
  3712. SetUpFilter ResultView
  3713. End If
  3714. ' Pass this folder object along with the ResultView object
  3715. ' to the method that is actually responsible for adding the ListItems
  3716. AddFilesToView Folder, ResultView
  3717. End If
  3718. End With ' ResultView.ScopePaneItem
  3719. Exit Sub
  3720. ' Error Handler for this method
  3721. ErrTrap_ResultViews_Initialize:
  3722. DisplayError "ResultViews_Initialize"
  3723. End Sub
  3724. ' =============================================================================
  3725. ' Method: ResultViews_InitializeControl
  3726. ' Type: Event
  3727. ' Description:
  3728. ' Parameters: ResultView A reference to the specific ResultView object
  3729. ' being activated
  3730. ' Output: None
  3731. ' Notes: This event is called when the ActiveX control used in an OCX
  3732. ' result view is created. The snap-in may use it to set properties
  3733. ' on the control. In this sample we set the text for the About
  3734. ' information control.
  3735. ' Note that from this event until the ResultView is destroyed
  3736. ' (ResultViews_Terminate) the property ResultView.Control is
  3737. ' valid.
  3738. ' =============================================================================
  3739. '
  3740. Private Sub ResultViews_InitializeControl(ByVal ResultView As SnapInLib.IResultView)
  3741. On Error GoTo ErrTrap_ResultViews_InitializeControl
  3742. Dim Ctl As AboutCtl
  3743. Set Ctl = ResultView.Control
  3744. Ctl.AboutText = "About File Explorer"
  3745. Ctl.PropertySheetProvider = ResultView.ScopePaneItem.Parent.Parent.PropertySheetProvider
  3746. Ctl.RootScopeItem = ResultView.ScopePaneItem.ScopeItem
  3747. Exit Sub
  3748. ' Error Handler for this method
  3749. ErrTrap_ResultViews_InitializeControl:
  3750. DisplayError "ResultViews_InitializeControl"
  3751. End Sub
  3752. ' =============================================================================
  3753. ' Method: ResultViews_ItemRename
  3754. ' Type: Event
  3755. ' Description:
  3756. ' Parameters: ResultView A reference to the ResultView in which the
  3757. ' rename operation occurred.
  3758. ' ListItem The MMCListItem object representing the item
  3759. ' that was renamed
  3760. ' NewName The new name specified by the user
  3761. ' Output: None
  3762. ' Notes: This event is called when the user renames a list item by either
  3763. ' slow double click on its text or by selecting Rename from the
  3764. ' context menu.
  3765. ' The file is renamed and the list item is reinitialized as the
  3766. ' File object contained in its Tag property and its text are now
  3767. ' out of date.
  3768. ' ListItem.Update is called so that the text will be redrawn in
  3769. ' the result pane.
  3770. ' ListItem.UpdateAllViews is called to notify any other existing
  3771. ' Views to update their display as well. This will result in the
  3772. ' firing of the event ResultViews_ItemViewChange on all other
  3773. ' views (see below).
  3774. ' =============================================================================
  3775. '
  3776. Private Sub ResultViews_ItemRename(ByVal ResultView As SnapInLib.IResultView, _
  3777. ByVal ListItem As SnapInLib.IMMCListItem, _
  3778. ByVal NewName As String)
  3779. On Error GoTo ErrTrap_ResultViews_ItemRename
  3780. Dim File As Scripting.File
  3781. Dim OldPath As String
  3782. Dim NewPath As String
  3783. ' Get the old path.
  3784. ' We can get the File object from ListItem.Tag
  3785. Set File = ListItem.Tag
  3786. OldPath = File.Path
  3787. ' Change the file name in the path
  3788. NewPath = Rename(OldPath, NewName)
  3789. ' Rename the file
  3790. File.Move NewPath
  3791. ' Reinitialize the list item from the altered file object
  3792. UpdateListItem ListItem, File
  3793. ' Notify all other views that we have made the change. If there are other
  3794. ' views then they will receive the ResultViews_ItemViewChange event and make
  3795. ' the change in their corresponding list item.
  3796. '
  3797. ' Send the old path as the hint so that the other views can find their
  3798. ' existing list items. They will be able to get the new path from this
  3799. ' list item as it will be passed as a parameter to
  3800. ' ResultViews_ItemViewChange (see below).
  3801. ListItem.UpdateAllViews OldPath
  3802. Exit Sub
  3803. ' Error Handler for this method
  3804. ErrTrap_ResultViews_ItemRename:
  3805. DisplayError "ResultViews_ItemRename"
  3806. End Sub
  3807. ' =============================================================================
  3808. ' Method: ResultViews_ItemViewChange
  3809. ' Type: Event
  3810. ' Description:
  3811. ' Parameters: ResultView A reference to the ResultView in which the
  3812. ' rename operation occurred.
  3813. ' ListItem The MMCListItem object representing the item
  3814. ' that has changed
  3815. ' Hint Variant optionally passed to the
  3816. ' MMCListItem.UpdateAllViews call that generated
  3817. ' this event.
  3818. ' Output: None
  3819. ' Notes: This event is generated by a call to MMCListItem.UpdateAllViews.
  3820. ' The MMCListItem passed here belongs to the generating view.
  3821. ' In this sample the we find the list item in the specified
  3822. ' result view and update it.
  3823. ' =============================================================================
  3824. '
  3825. Private Sub ResultViews_ItemViewChange(ByVal ResultView As SnapInLib.IResultView, _
  3826. ByVal ListItem As SnapInLib.IMMCListItem, _
  3827. ByVal Hint As Variant)
  3828. On Error GoTo ErrTrap_ResultViews_ItemViewChange
  3829. Dim File As Scripting.File
  3830. Dim NewPath As String
  3831. Dim OurListItem As MMCListItem
  3832. ' Determine whether this view is currently displaying this list item by
  3833. ' searching for it using the old path as the key. The old path is received
  3834. ' in Hint
  3835. On Error Resume Next
  3836. Set OurListItem = ResultView.ListView.ListItems(Hint)
  3837. On Error GoTo ErrTrap_ResultViews_ItemViewChange
  3838. If OurListItem Is Nothing Then
  3839. ' It is not there. This view is displaying a different folder.
  3840. Exit Sub
  3841. End If
  3842. ' We can get the File object from the source's ListItem.Tag
  3843. Set File = ListItem.Tag
  3844. ' Get a new updated File object for the list item in this view.
  3845. Set File = m_FileSystemObject.GetFile(File.Path)
  3846. ' Reinitialize the list item from the new file object
  3847. UpdateListItem OurListItem, File
  3848. Exit Sub
  3849. ' Error Handler for this method
  3850. ErrTrap_ResultViews_ItemViewChange:
  3851. DisplayError "ResultViews_ItemViewChange"
  3852. End Sub
  3853. ' =============================================================================
  3854. ' Method: UpdateListItem
  3855. ' Type: Subroutine
  3856. ' Description: Reinitializes a list item's properties from a File object
  3857. '
  3858. ' Parameters: ListItem The list item to be updated
  3859. ' File A FileSystemObject File object whose properties
  3860. ' are to be used to update the list item
  3861. '
  3862. ' Output: None
  3863. ' Notes: Reinitialize the list item's display strings, exported data,
  3864. ' tag, and key. Tells MMC to update its display.
  3865. ' =============================================================================
  3866. '
  3867. Private Sub UpdateListItem(ListItem As MMCListItem, _
  3868. File As Scripting.File)
  3869. On Error GoTo ErrTrap_UpdateListItem
  3870. ' Update the list item's key to the new path
  3871. ListItem.Key = File.Path
  3872. ' Update the ListItem's text property
  3873. ListItem.Text = File.Name
  3874. ' Reinitialize the display properties,
  3875. InitListItem ListItem, File
  3876. ' Reinitialize the exported data
  3877. InitListItemData ListItem, File
  3878. ' Update the list item's display in the MMC listview
  3879. ListItem.Update
  3880. Exit Sub
  3881. ' Error Handler for this method
  3882. ErrTrap_UpdateListItem:
  3883. DisplayError "UpdateListItem"
  3884. End Sub
  3885. ' =============================================================================
  3886. ' Method: ScopeItems_PropertyChanged
  3887. ' Type: Event
  3888. ' Description: Fired when a proeprty page calls ScopeItem.PropertyChanged
  3889. ' Allows a property page to inform the snap-in that the user has
  3890. ' changed its property values.
  3891. '
  3892. ' Parameters: ScopeItem The ScopeItem for which the property page is
  3893. ' displayed.
  3894. ' Data The Data parameter passed by the property page
  3895. ' when it called ScopeItem.PropertyChanged
  3896. '
  3897. ' Output: None
  3898. ' Notes: FileExplorer uses this event for the Internet Explorer node. The
  3899. ' user enters a new URL to navigate to in the property page.
  3900. ' =============================================================================
  3901. '
  3902. Private Sub ScopeItems_PropertyChanged(ByVal ScopeItem As SnapInLib.ScopeItem, _
  3903. ByVal Data As Variant)
  3904. On Error GoTo ErrTrap_ScopeItems_PropertyChanged
  3905. ' If the ScopeItem is the Internet Explorer node then select it and display
  3906. ' a URL view with URL in the Data parameter. Note that we don't call
  3907. ' ScopePaneItem.DisplayNewResultView because the IE node may not be currently
  3908. ' selected in the scope pane even though its property page is open. The user
  3909. ' may have displayed properties, left the sheet open, and then returned to
  3910. ' the scope pane and selected another node. This is possible because MMC
  3911. ' displays property sheets in a separate thread.
  3912. If ScopeItem.ScopeNode.NodeTypeName = SZ_INTERNETEXPLORER Then
  3913. CurrentView.SelectScopeItem ScopeItem, siURLView, Data
  3914. End If
  3915. Exit Sub
  3916. ' Error Handler for this method
  3917. ErrTrap_ScopeItems_PropertyChanged:
  3918. DisplayError "ScopeItems_PropertyChanged"
  3919. End Sub
  3920. ' =============================================================================
  3921. ' Method: ScopeItems_Rename
  3922. ' Type: Event
  3923. ' Description: Fired when the user performs a rename operation on a scope item.
  3924. '
  3925. ' Parameters: ScopeItem The selected ScopeItem
  3926. ' NewName New name given by the user.
  3927. '
  3928. ' Output: None
  3929. ' Notes: Rename the file and reinitialize the ScopeItem. Note that there
  3930. ' is no equivalent of MMCListItem.UpdateAllViews for ScopeItems
  3931. ' (see ResultViews_ItemRename above). MMC handles the propagation
  3932. ' of the display changes to all existing views.
  3933. ' =============================================================================
  3934. '
  3935. Private Sub ScopeItems_Rename(ByVal ScopeItem As SnapInLib.IScopeItem, _
  3936. ByVal NewName As String)
  3937. On Error GoTo ErrTrap_ScopeItems_Rename
  3938. Dim OldName As String
  3939. Dim Folder As Scripting.Folder
  3940. Dim OldPath As String
  3941. Dim NewPath As String
  3942. Set Folder = ScopeItem.Tag
  3943. OldPath = Folder.Path
  3944. ' Change the folder name in the old path
  3945. NewPath = Rename(OldPath, NewName)
  3946. ' Rename the folder
  3947. Folder.Move NewPath
  3948. ' Change the key and name to the new path.
  3949. ScopeItem.Key = NewPath
  3950. ScopeItem.Name = NewPath
  3951. ' Change the display name and the 1st column text to the new name
  3952. ScopeItem.ScopeNode.DisplayName = NewName
  3953. ScopeItem.ListSubItems(1).Text = NewName
  3954. ' Change the exported data: Format is "Folder", data is folder path
  3955. ScopeItem.Data.SetData NewPath, "Folder"
  3956. Exit Sub
  3957. ' Error Handler for this method
  3958. ErrTrap_ScopeItems_Rename:
  3959. DisplayError "ScopeItems_Rename"
  3960. End Sub
  3961. ' =============================================================================
  3962. ' Method: ResultViews_ListItemDblClick
  3963. ' Type: Event
  3964. ' Description:
  3965. ' Parameters: ResultView The ResultView in which the double click occurred.
  3966. ' ListItem MMCListItem object that was double clicked.
  3967. ' DoDefault A flag to allow the snap-in to signal the
  3968. ' Snap-in runtime whether to allow the default
  3969. ' processing of a ListItem double-click.
  3970. ' This value is initialized to TRUE. To disable
  3971. ' default processing, set this parameter to FALSE.
  3972. ' Output: None
  3973. ' Notes: This event is handled for files. We call LaunchFile to
  3974. ' run the file using the Win32 ShellExecute() API
  3975. ' =============================================================================
  3976. '
  3977. Private Sub ResultViews_ListItemDblClick(ByVal ResultView As SnapInLib.IResultView, _
  3978. ByVal ListItem As SnapInLib.IMMCListItem, _
  3979. DoDefault As Boolean)
  3980. On Error GoTo ErrTrap_ResultViews_ListItemDblClick
  3981. LaunchFile ListItem.Key
  3982. Exit Sub
  3983. ' Error Handler for this method
  3984. ErrTrap_ResultViews_ListItemDblClick:
  3985. DisplayError "ResultViews_ListItemDblClick"
  3986. End Sub
  3987. ' =============================================================================
  3988. ' Method: ResultViews_TaskClick
  3989. ' Type: Event
  3990. ' Description: Fired when the user clicks a task in a default taskpad
  3991. '
  3992. ' Parameters: ResultView The ResultView in which the click occurred
  3993. ' Task The Task clicked
  3994. '
  3995. ' Output: None
  3996. ' Notes: For the "Start File Explorer" task change the static node's
  3997. ' result view to our standard listview lvExplorerTop.
  3998. ' For the "MMC Home Page" task select the Internet Explorer node and
  3999. ' display the MMC home page.
  4000. ' For the "About..." task select the About node
  4001. ' =============================================================================
  4002. '
  4003. Private Sub ResultViews_TaskClick(ByVal ResultView As SnapInLib.IResultView, _
  4004. ByVal Task As SnapInLib.ITask)
  4005. On Error GoTo ErrTrap_ResultViews_TaskClick
  4006. With CurrentScopePaneItem
  4007. If Task.Key = KEY_START Then
  4008. .DisplayNewResultView "lvExplorerTop", siPreDefined
  4009. ElseIf Task.Key = KEY_MMC_HOME_PAGE Then
  4010. EnsureDesktopExpanded
  4011. CurrentView.SelectScopeItem ScopeItems(SZ_INTERNETEXPLORER), siURLView, _
  4012. "http://www.microsoft.com/management/mmc/default.htm"
  4013. ElseIf Task.Key = KEY_ABOUT Then
  4014. EnsureDesktopExpanded
  4015. CurrentView.SelectScopeItem ScopeItems(SZ_ABOUT)
  4016. End If
  4017. End With
  4018. Exit Sub
  4019. ' Error Handler for this method
  4020. ErrTrap_ResultViews_TaskClick:
  4021. DisplayError "ResultViews_TaskClick"
  4022. End Sub
  4023. ' =============================================================================
  4024. ' Method: EnsureDesktopExpanded
  4025. ' Type: Subroutine
  4026. ' Description: Checks if the desktop node has been expanded in the namespace.
  4027. ' If not then expands it.
  4028. '
  4029. ' Parameters: None
  4030. '
  4031. ' Output: None
  4032. ' Notes: None
  4033. ' =============================================================================
  4034. '
  4035. Private Sub EnsureDesktopExpanded()
  4036. On Error GoTo ErrTrap_EnsureDesktopExpanded
  4037. Dim RootScopeItem As ScopeItem
  4038. ' Determine whether the root scope item is the static node or the extension root
  4039. On Error Resume Next
  4040. Set RootScopeItem = ScopeItems(SZ_STATICNODE)
  4041. On Error GoTo ErrTrap_EnsureDesktopExpanded
  4042. If RootScopeItem Is Nothing Then
  4043. Set RootScopeItem = ScopeItems(SZ_EXTENSION_ROOT)
  4044. End If
  4045. ' Check if the root scope item has been expanded. If not then expand it to add the
  4046. ' desktop node.
  4047. If Not RootScopeItem.ScopeNode.ExpandedOnce Then
  4048. RootScopeItem.ScopeNode.ExpandInNameSpace
  4049. End If
  4050. ' Check if the the desktop node has been expanded once. If not then expand it. We can
  4051. ' use the Child property because the root node only has one child.
  4052. If Not RootScopeItem.ScopeNode.Child.ExpandedOnce Then
  4053. RootScopeItem.ScopeNode.Child.ExpandInNameSpace
  4054. End If
  4055. Exit Sub
  4056. ' Error Handler for this method
  4057. ErrTrap_EnsureDesktopExpanded:
  4058. DisplayError "EnsureDesktopExpanded"
  4059. End Sub
  4060. ' =============================================================================
  4061. ' Method: ResultViews_TaskNotify
  4062. ' Type: Event
  4063. ' Description: Fired when a custom taskpad calls MMCCtrl.TaskNotify.
  4064. ' Our User Guide custom taskpad calls this method when
  4065. ' the user clicks the "Return to File Explorer" button.
  4066. ' Parameters: Arg Passed by the taskpad to MMCCtrl.TaskNotify
  4067. ' Param Passed by the taskpad to MMCCtrl.TaskNotify
  4068. '
  4069. ' Output: None
  4070. ' Notes: This method changes the result view for the static node to
  4071. ' StaticNodeTaskpad
  4072. ' =============================================================================
  4073. '
  4074. Private Sub ResultViews_TaskNotify(ByVal ResultView As SnapInLib.IResultView, _
  4075. ByVal Arg As Variant, _
  4076. ByVal Param As Variant)
  4077. On Error GoTo ErrTrap_ResultViews_TaskNotify
  4078. With Views.CurrentView.ScopePaneItems.SelectedItem
  4079. .DisplayNewResultView SZ_STATIC_NODE_TASKPAD, siPreDefined
  4080. End With
  4081. Exit Sub
  4082. ' Error Handler for this method
  4083. ErrTrap_ResultViews_TaskNotify:
  4084. DisplayError "ResultViews_TaskNotify"
  4085. End Sub
  4086. ' =============================================================================
  4087. ' Method: ScopePaneItems_GetResultViewInfo
  4088. ' Type: Event
  4089. ' Description: Fired when a a scope item is selected in the scope pane to
  4090. ' allow the snap-in to choose the result view that will be displayed.
  4091. '
  4092. ' Parameters: ScopePaneItem A reference to the ScopePaneItem that was selected.
  4093. '
  4094. ' ViewType Contains the default view type selected by the
  4095. ' designer runtime. For nodes defined at design time
  4096. ' that have default result views assigned, ViewType will
  4097. ' be siPredefined. If the snap-in called
  4098. ' ScopePaneItem.DisplayNewResultView then ViewType will
  4099. ' contain the value passed to that method.
  4100. '
  4101. ' DisplayString Contains the display string that accompanies
  4102. ' ViewType. For predefined result views this will be the
  4103. ' name of the result view defined at design time. For
  4104. ' result views defined in code the contents vary based on
  4105. ' the type. See the ScopePaneItem topic in the Snap-In
  4106. ' Designer Programmer's Guide for more information.
  4107. '
  4108. ' Output: The snap-in can change ViewType and DisplayString if needed.
  4109. '
  4110. ' Notes: This event is handled by FileExplorer to set the URL to navigate to in
  4111. ' the code-defined URL result view used for the Internet Explorer node.
  4112. ' =============================================================================
  4113. '
  4114. Private Sub ScopePaneItems_GetResultViewInfo(ByVal ScopePaneItem As SnapInLib.ScopePaneItem, _
  4115. ViewType As SnapInLib.SnapInResultViewTypeConstants, _
  4116. DisplayString As String)
  4117. On Error GoTo ErrTrap_ScopePaneItems_GetResultViewInfo
  4118. ' If the Internet Explore node was selected in the scope pane then specify a URL view
  4119. ' and set the display string to the URL to navigate to. If it was selected
  4120. ' programmatically because the user selected the "MMC Home Page" task on the static node
  4121. ' taskpad then the ViewType and display string will already be set. If the
  4122. ' user is returning to the node or using a property page to change the URL
  4123. ' then the view type will already be siURLView an the display string will
  4124. ' already be set to the URL.
  4125. If ScopePaneItem.ScopeItem.ScopeNode.NodeTypeName = SZ_INTERNETEXPLORER Then
  4126. If ViewType <> siURLView Then
  4127. ViewType = siURLView
  4128. DisplayString = "about:blank:"
  4129. End If
  4130. End If
  4131. Exit Sub
  4132. ' Error Handler for this method
  4133. ErrTrap_ScopePaneItems_GetResultViewInfo:
  4134. DisplayError "ScopePaneItems_GetResultViewInfo"
  4135. End Sub
  4136. ' =============================================================================
  4137. ' Method: Views_Print
  4138. ' Type: Event
  4139. ' Description: Fired when a file is selected and the user clicks the
  4140. ' printer toolbar button or selects "Print" on the context menu
  4141. ' (both mechanisms are standard verbs supplied by MMC)
  4142. '
  4143. ' Parameters: View A reference to the specific View object
  4144. ' in which the print request occurred.
  4145. ' Selection An MMCClipboard object that contains
  4146. ' the currently selected items.
  4147. '
  4148. ' Output: None
  4149. '
  4150. ' Notes: Uses VB's Shell function to run the system command processor's
  4151. ' "PRINT" command for all files in the selection.
  4152. ' =============================================================================
  4153. '
  4154. Private Sub Views_Print(ByVal View As SnapInLib.View, _
  4155. ByVal Selection As SnapInLib.MMCClipboard)
  4156. On Error GoTo ErrTrap_Views_Print
  4157. Dim ListItem As MMCListItem
  4158. Dim File As Scripting.File
  4159. For Each ListItem In Selection.ListItems
  4160. Set File = ListItem.Tag
  4161. ' Run the system command processor's print command
  4162. Shell Environ("ComSpec") & " /c PRINT " & File.Path
  4163. Next ListItem
  4164. Exit Sub
  4165. ' Error Handler for this method
  4166. ErrTrap_Views_Print:
  4167. DisplayError "Views_Print"
  4168. End Sub
  4169. ' =============================================================================
  4170. ' Method: ScopeItems_Expand
  4171. ' Type: Event
  4172. ' Description: Fired in response to one of two user events. Either the ScopeItem
  4173. ' is being expanded because the plus sign has been clicked or
  4174. ' because ScopeItem node itself has been selected.
  4175. ' Parameters: ScopeItem The ScopeItem being expanded
  4176. '
  4177. ' Output: None
  4178. ' Notes: Unlike the VB Common Controls TreeView control,
  4179. ' the Expand event for an MMC snap-in is only called the
  4180. ' first time a node is expanded.
  4181. ' For "My Computer" adds the drives.
  4182. ' For the Extension root adds the Desktop.
  4183. ' For drives and folders, adds the subfolders.
  4184. ' =============================================================================
  4185. '
  4186. Private Sub ScopeItems_Expand(ByVal ScopeItem As SnapInLib.IScopeItem)
  4187. On Error GoTo ErrTrap_ScopeItems_Expand
  4188. If ScopeItem.Key = SZ_STATICNODE Then
  4189. ' In this case, we have already defined an auto-create subnode
  4190. ' that represents the Desktop. We could use this opportunity to
  4191. ' add additional nodes if, say, we wanted to display multiple
  4192. ' desktops
  4193. ElseIf ScopeItem.Key = SZ_DESKTOP Or _
  4194. ScopeItem.Key = SZ_INTERNETEXPLORER Or _
  4195. ScopeItem.Key = SZ_NETWORKNEIGHBORHOOD Or _
  4196. ScopeItem.Key = SZ_RECYCLEBIN Or _
  4197. ScopeItem.Key = SZ_MYBRIEFCASE Or _
  4198. ScopeItem.Key = SZ_ABOUT Then
  4199. ' In this current version of the sample, we are not populating any
  4200. ' subnodes under these
  4201. ElseIf ScopeItem.Key = SZ_MYCOMPUTER Then
  4202. ' We have now reached the computer node, and we need to add subnodes
  4203. ' to represent each of the drives on the machine.
  4204. AddDrivesToScope ScopeItem.ScopeNode
  4205. ElseIf ScopeItem.Key = SZ_EXTENSION_ROOT Then
  4206. ' The ScopeItem we added in ExtensionSnapIn_Expand has now been expanded
  4207. ' itself. We manually add the Desktop node. When it is expanded, the
  4208. ' auto-create nodes underneath it will be expanded just as when we are
  4209. ' operating as a stand-alone console.
  4210. ScopeItems.AddPreDefined SZ_DESKTOP, SZ_DESKTOP, ScopeItem.ScopeNode, siParent
  4211. Else
  4212. ' The expanded node is either a drive or a directory, which means that
  4213. ' everything here will be folders. We need to add subnodes to represent
  4214. ' all the subfolders of any given drive or folder. Because we are using
  4215. ' the fully qualified pathname as the key for each folder ScopeItem, we
  4216. ' can use this utility method to nest to any arbitrary depth
  4217. AddFoldersToScope ScopeItem
  4218. End If
  4219. Exit Sub
  4220. ' Error Handler for this method
  4221. ErrTrap_ScopeItems_Expand:
  4222. DisplayError "ScopeItems_Expand"
  4223. End Sub
  4224. ' =============================================================================
  4225. ' Method: ScopeItems_Help
  4226. ' Type: Event
  4227. ' Description: Fired when the user selects a scope item and requests help.
  4228. ' The snap-in should display context specific help for the selected
  4229. ' ScopeItem.
  4230. '
  4231. ' Parameters: ScopeItem The selected ScopeItem
  4232. '
  4233. ' Output: None
  4234. ' Notes: As an example, we display a topic in the MMC's
  4235. ' help file. In general, the FileExplorer's .chm would be merged with MMC's because
  4236. ' at design time because we set the HelpFile property to its file name.
  4237. ' =============================================================================
  4238. '
  4239. Private Sub ScopeItems_Help(ByVal ScopeItem As SnapInLib.IScopeItem)
  4240. On Error GoTo ErrTrap_ScopeItems_Help
  4241. ' Display the topic "File Explorer - Event Handling\ScopeItems"
  4242. ShowHelpTopic "mmc.chm::/sag_MMCconcepts0_0.htm"
  4243. Exit Sub
  4244. ' Error Handler for this method
  4245. ErrTrap_ScopeItems_Help:
  4246. DisplayError "ScopeItems_Help"
  4247. End Sub
  4248. ' =============================================================================
  4249. ' Method: ResultViews_Help
  4250. ' Type: Event
  4251. ' Description: Fired when the user selects a list item and requests help.
  4252. ' The snap-in should display context specific help for the selected
  4253. ' list item.
  4254. '
  4255. ' Parameters: ResultView The ResultView in which the request occurred.
  4256. ' ListItem The selected list item.
  4257. '
  4258. ' Output: None
  4259. ' Notes: As an example, we display a topic in the MMC's
  4260. ' help file. In general, the FileExplorer's .chm would be merged with MMC's because
  4261. ' at design time because we set the HelpFile property to its file name.
  4262. ' =============================================================================
  4263. '
  4264. Private Sub ResultViews_Help(ByVal ResultView As SnapInLib.IResultView, _
  4265. ByVal ListItem As SnapInLib.IMMCListItem)
  4266. On Error GoTo ErrTrap_ResultViews_Help
  4267. ' Display the topic "File Explorer - Event Handling\ResultViews"
  4268. ShowHelpTopic "mmc.chm::/sag_MMCconcepts0_0.htm"
  4269. Exit Sub
  4270. ' Error Handler for this method
  4271. ErrTrap_ResultViews_Help:
  4272. DisplayError "ResultViews_Help"
  4273. End Sub
  4274. ' =============================================================================
  4275. ' Method: ScopeItems_Initialize
  4276. ' Type: Event
  4277. ' Description: Fired when a ScopeItem has just been created
  4278. ' Parameters: ScopeItem The new ScopeItem
  4279. '
  4280. ' Output: None
  4281. ' Notes: This is called once for each ScopeItem as it is being added
  4282. ' to the ScopeItems collection. This event will fire for both
  4283. ' auto-created and pre-defined nodes.
  4284. ' Any pre-defined nodes that are being initialized here
  4285. ' are being created by code elsewhere in this snap-in (see
  4286. ' the ScopeItems_Expand event). For auto-create nodes, however,
  4287. ' this is the only opportunity to trap their creation, and modify
  4288. ' their properties before they are available for use. Note that
  4289. ' pre-defined nodes could be initialized when they are added or
  4290. ' in this event.
  4291. ' =============================================================================
  4292. '
  4293. Private Sub ScopeItems_Initialize(ByVal ScopeItem As SnapInLib.IScopeItem)
  4294. On Error GoTo ErrTrap_ScopeItems_Initialize
  4295. With ScopeItem
  4296. ' In order for the auto-create nodes to display properly in the
  4297. ' ListView, we need to add ColumnHeaders and ListSubItems.
  4298. If .Key = SZ_STATICNODE Or _
  4299. .Key = SZ_EXTENSION_ROOT Then
  4300. .ColumnHeaders.Add 1, KEY_NAME, SZDISPLAY_NAME
  4301. .ListSubItems.Add 1, ScopeItem.Key, ScopeItem.ScopeNode.DisplayName
  4302. Set ScopeItem.Tag = m_ConfigData
  4303. ElseIf .Key = SZ_DESKTOP Or .Key = SZ_MYCOMPUTER Or _
  4304. .Key = SZ_INTERNETEXPLORER Or .Key = SZ_NETWORKNEIGHBORHOOD Or _
  4305. .Key = SZ_RECYCLEBIN Or .Key = SZ_MYBRIEFCASE Or .Key = SZ_ABOUT Then
  4306. With .ColumnHeaders
  4307. .Add 1, KEY_NAME, SZDISPLAY_NAME ' Column "Name"
  4308. .Add 2, KEY_TYPE, SZDISPLAY_TYPE ' Column "Type"
  4309. .Add 3, KEY_TOTALSIZE, SZDISPLAY_TOTALSIZE ' Column "Total Size"
  4310. .Add 4, KEY_FREESPACE, SZDISPLAY_FREESPACE ' Column "Free Space"
  4311. End With
  4312. ' We're only adding one ListSubItem because the only column that
  4313. ' really makes sense for these high level nodes is the "Name" column
  4314. .ListSubItems.Add 1, ScopeItem.Key, ScopeItem.ScopeNode.DisplayName
  4315. End If
  4316. End With ' ScopeItem
  4317. Exit Sub
  4318. ' Error Handler for this method
  4319. ErrTrap_ScopeItems_Initialize:
  4320. DisplayError "ScopeItems_Initialize"
  4321. End Sub
  4322. ' =============================================================================
  4323. ' Method: SnapIn_QueryConfigurationWizard
  4324. ' Type: Event
  4325. ' Description: Fired when the user is adding the snap-in to the console in
  4326. ' in MMC's Add/Remove snap-in dialog. Asks the snap-in whether it
  4327. ' would like to display a configuration wizard before the snap-in
  4328. ' is added.
  4329. '
  4330. ' Parameters: HaveWizard Defaults to False. Set to True if the snap-in
  4331. ' has a configuration wizard.
  4332. '
  4333. ' Output: None
  4334. ' Notes: None
  4335. ' =============================================================================
  4336. '
  4337. Private Sub SnapIn_QueryConfigurationWizard(HaveWizard As Boolean)
  4338. HaveWizard = True
  4339. End Sub
  4340. ' =============================================================================
  4341. ' Method: SnapIn_CreateConfigurationWizard
  4342. ' Type: Event
  4343. ' Description: Fired after returning True from SnapIn_QueryConfigurationWizard
  4344. ' (see above).
  4345. ' Gives the snap-in the opportunity to add its property pages to
  4346. ' the configuration wizard property sheet being displayed
  4347. ' by MMC for the snap-in.
  4348. '
  4349. ' Parameters: PropertySheet PropertySheet object used to add the snap-in's
  4350. ' property pages.
  4351. '
  4352. ' Output: None
  4353. ' Notes: We add our configuration wizard property pages and pass the
  4354. ' ConfigData object so that the pages can directly set its
  4355. ' properties. When the user has completed the wizard the event
  4356. ' SnapIn_ConfigurationComplete will be fired. FileExplorer does
  4357. ' not handle that event.
  4358. ' =============================================================================
  4359. '
  4360. Private Sub SnapIn_CreateConfigurationWizard(ByVal PropertySheet As SnapInLib.MMCPropertySheet)
  4361. On Error GoTo ErrTrap_SnapIn_CreateConfigurationWizard
  4362. ' Clear the the configuration dirty property so we can detect changes when the
  4363. ' wizard is done. (See SnapIn_ConfigurationComplete below).
  4364. m_ConfigData.ClearDirty
  4365. ' Add the property pages to the wizard. Pass UseHelpButton=True so we get
  4366. ' a help button on the property sheet.
  4367. PropertySheet.AddWizardPage "ppgWelcome", m_ConfigData, True
  4368. PropertySheet.AddWizardPage "ppgNetDrives", m_ConfigData, True
  4369. PropertySheet.AddWizardPage "ppgFolderAccess", m_ConfigData, True
  4370. PropertySheet.AddWizardPage "ppgFileAccess", m_ConfigData, True
  4371. PropertySheet.AddWizardPage "ppgFinish", m_ConfigData, True
  4372. Exit Sub
  4373. ' Error Handler for this method
  4374. ErrTrap_SnapIn_CreateConfigurationWizard:
  4375. DisplayError "SnapIn_CreateConfigurationWizard"
  4376. End Sub
  4377. ' =============================================================================
  4378. ' Method: SnapIn_ConfigurationComplete
  4379. ' Type: Event
  4380. ' Description: Fired when the user clicks the Finish button on a wizard.
  4381. '
  4382. ' Parameters: ConfigurationObject The object passed to
  4383. ' MMCPropertySheet.AddWizardPage for the
  4384. ' page displaying the Finish button.
  4385. ' Output: None
  4386. ' Notes: If any of the configuration settings were changed and the scope
  4387. ' pane has already been populated with drives then refresh
  4388. ' MyComputer so that it will repopulate according to the new
  4389. ' settings (e.g. network drives were shown prior to running the
  4390. ' wizard and now they are not to be shown anymore).
  4391. ' =============================================================================
  4392. '
  4393. Private Sub SnapIn_ConfigurationComplete(ByVal ConfigurationObject As Object)
  4394. Dim MyComputer As ScopeItem
  4395. ' Check if any configuration settings were change.
  4396. If Not m_ConfigData.Dirty Then
  4397. Exit Sub
  4398. End If
  4399. ' Clear the the configuration dirty property
  4400. m_ConfigData.ClearDirty
  4401. ' Check for the presence of "My Computer" in ScopeItems
  4402. On Error Resume Next
  4403. Set MyComputer = ScopeItems(SZ_MYCOMPUTER)
  4404. ' Resume normal error processing
  4405. On Error GoTo ErrTrap_SnapIn_ConfigurationComplete
  4406. If MyComputer Is Nothing Then
  4407. Exit Sub
  4408. End If
  4409. ' Check if "My Computer" has been expanded. If not then we don't need to
  4410. ' refresh it.
  4411. If Not MyComputer.ScopeNode.ExpandedOnce Then
  4412. Exit Sub
  4413. End If
  4414. ' "My Computer" is there and it has already been expanded so refresh it.
  4415. RefreshScopeItem MyComputer
  4416. Exit Sub
  4417. ' Error Handler for this method
  4418. ErrTrap_SnapIn_ConfigurationComplete:
  4419. DisplayError "SnapIn_ConfigurationComplete"
  4420. End Sub
  4421. ' =============================================================================
  4422. ' Method: SnapIn_Initialize
  4423. ' Type: Event
  4424. ' Description: Fired whenever the snap-in created. When the user is adding a
  4425. ' the snap-in to the console this event may be fired more than
  4426. ' once because MMC will create the snap-in once to get display
  4427. ' information for the Add/Remove dialog's listbox and then again
  4428. ' if the user requests to add the snap-in. In general, this event
  4429. ' should be used for quick initialization tasks (e.g. global
  4430. ' variable initialization).
  4431. '
  4432. ' Parameters: None
  4433. '
  4434. ' Output: None
  4435. ' Notes:
  4436. ' =============================================================================
  4437. '
  4438. Private Sub SnapIn_Initialize()
  4439. On Error GoTo ErrTrap_SnapIn_Initialize
  4440. ' Set default filter operator and value.
  4441. m_FilterByName = False
  4442. m_FilterByExt = True
  4443. m_FilterValue = "*"
  4444. ' Load all static extensions up front so response time will be quicker
  4445. ' when the user invokes properties, context menus etc.
  4446. ' This should only be done for extensions that will be loaded often e.g. on
  4447. ' every context menu invocation.
  4448. RequiredExtensions.EnableAllStatic True
  4449. Exit Sub
  4450. ' Error Handler for this method
  4451. ErrTrap_SnapIn_Initialize:
  4452. DisplayError "SnapIn_Initialize"
  4453. End Sub
  4454. ' =============================================================================
  4455. ' Method: SnapIn_ReadProperties
  4456. ' Type: Event
  4457. ' Description: Fired when the user saves a console file (.MSC).
  4458. '
  4459. ' Parameters: PropertyBag Used to store properties in the console file.
  4460. '
  4461. ' Output: None
  4462. ' Notes: Writes the values of the ConfigData object's properties that
  4463. ' determine whether the user can see network drives and
  4464. ' rename/delete files and folders.
  4465. ' =============================================================================
  4466. '
  4467. Private Sub SnapIn_WriteProperties(ByVal PropertyBag As SnapInLib.PropertyBag)
  4468. On Error GoTo ErrTrap_SnapIn_WriteProperties
  4469. PropertyBag.WriteProperty "ShowNetDrives", m_ConfigData.ShowNetDrives
  4470. PropertyBag.WriteProperty "AllowFileAccess", m_ConfigData.AllowFileAccess
  4471. PropertyBag.WriteProperty "AllowFileAccess", m_ConfigData.AllowFolderAccess
  4472. Exit Sub
  4473. ' Error Handler for this method
  4474. ErrTrap_SnapIn_WriteProperties:
  4475. DisplayError "SnapIn_WriteProperties"
  4476. End Sub
  4477. ' =============================================================================
  4478. ' Method: SnapIn_ReadProperties
  4479. ' Type: Event
  4480. ' Description: Fired when the user loads a console file (.MSC).
  4481. '
  4482. ' Parameters: PropertyBag Used to read properties stored when saving the
  4483. ' console in SnapIn_WriteProperties
  4484. '
  4485. ' Output: None
  4486. ' Notes: Reads the values of the ConfigData object's properties that
  4487. ' determine whether the user can see network drives and
  4488. ' rename/delete files and folders.
  4489. ' =============================================================================
  4490. '
  4491. Private Sub SnapIn_ReadProperties(ByVal PropertyBag As SnapInLib.PropertyBag)
  4492. On Error GoTo ErrTrap_SnapIn_ReadProperties
  4493. m_ConfigData.ShowNetDrives = PropertyBag.ReadProperty("ShowNetDrives", False)
  4494. m_ConfigData.AllowFileAccess = PropertyBag.ReadProperty("AllowFileAccess", False)
  4495. m_ConfigData.AllowFolderAccess = PropertyBag.ReadProperty("AllowFileAccess", False)
  4496. Exit Sub
  4497. ' Error Handler for this method
  4498. ErrTrap_SnapIn_ReadProperties:
  4499. DisplayError "SnapIn_ReadProperties"
  4500. End Sub
  4501. ' =============================================================================
  4502. ' Method: tbrFileMgr_ButtonClick
  4503. ' Type: Event
  4504. ' Description: Fired when a Toolbar button is clicked
  4505. ' Parameters:
  4506. ' Selection A reference to an MMCClipboard object that is
  4507. ' holding a reference to the currently selected
  4508. ' item(s)
  4509. ' Button A reference to the button object attached to
  4510. ' the toolbar button that was clicked
  4511. ' Output: None
  4512. ' Notes: Calls ProcessUICommand to do the work.
  4513. ' =============================================================================
  4514. '
  4515. Private Sub tbrFileMgr_ButtonClick(ByVal Selection As SnapInLib.IMMCClipboard, _
  4516. ByVal Button As SnapInLib.IMMCButton)
  4517. On Error GoTo ErrTrap_tbrFileMgr_ButtonClick
  4518. ProcessUICommand Selection, Button.Key
  4519. Exit Sub
  4520. ' Error Handler for this method
  4521. ErrTrap_tbrFileMgr_ButtonClick:
  4522. DisplayError "tbrFileMgr_ButtonClick"
  4523. End Sub
  4524. ' =============================================================================
  4525. ' Method: tbrMenuButton_ButtonDropDown
  4526. ' Type: Event
  4527. ' Description: Fired when a menu button is clicked and the dropdown menu is
  4528. ' about to be displayed.
  4529. '
  4530. ' Parameters: Selection A reference to an MMCClipboard object that is
  4531. ' holding a reference to the currently selected
  4532. ' item(s)
  4533. ' Button A reference to the MMCButton object attached to
  4534. ' the menu button.
  4535. ' Output: None
  4536. ' Notes: Examines the selection and enables/disable MMCButtonMenu items
  4537. ' as appropriate.
  4538. ' =============================================================================
  4539. '
  4540. Private Sub tbrMenuButton_ButtonDropDown(ByVal Selection As SnapInLib.IMMCClipboard, _
  4541. ByVal Button As SnapInLib.IMMCButton)
  4542. On Error GoTo ErrTrap_tbrMenuButton_ButtonDropDown
  4543. Dim ButtonMenu As MMCButtonMenu
  4544. Dim SelectionType As SnapInSelectionTypeConstants
  4545. SelectionType = Selection.SelectionType
  4546. ' Disable everything then enable as needed.
  4547. For Each ButtonMenu In Button.ButtonMenus
  4548. ButtonMenu.Grayed = True
  4549. Next ButtonMenu
  4550. Button.ButtonMenus(KEY_CONFIGURATION).Grayed = False
  4551. ' For files enable Run and Run As.
  4552. ' For a single scope item, if it is a folder or a drive, then enable add
  4553. If (SelectionType = siSingleListItem) Or (SelectionType = siMultiListItems) Then
  4554. Button.ButtonMenus(KEY_RUN).Grayed = False
  4555. Button.ButtonMenus(KEY_RUNAS).Grayed = False
  4556. ElseIf SelectionType = siSingleScopeItem Then
  4557. If (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Folder) Or _
  4558. (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Drive) Then
  4559. Button.ButtonMenus(KEY_ADD).Grayed = False
  4560. End If
  4561. End If
  4562. Exit Sub
  4563. ' Error Handler for this method
  4564. ErrTrap_tbrMenuButton_ButtonDropDown:
  4565. DisplayError "tbrMenuButton_ButtonDropDown"
  4566. End Sub
  4567. ' =============================================================================
  4568. ' Method: tbrMenuButton_ButtonMenuClick
  4569. ' Type: Event
  4570. ' Description: Fired when a Toolbar button is clicked
  4571. '
  4572. ' Parameters: Selection A reference to an MMCClipboard object that is
  4573. ' holding a reference to the currently selected
  4574. ' item(s)
  4575. ' ButtonMenu A reference to the MMCButtonMenu object attached to
  4576. ' the menu item selected.
  4577. ' Output: None
  4578. ' Notes: Calls ProcessUICommand to do the work.
  4579. ' =============================================================================
  4580. '
  4581. Private Sub tbrMenuButton_ButtonMenuClick(ByVal Selection As SnapInLib.IMMCClipboard, _
  4582. ByVal ButtonMenu As SnapInLib.IMMCButtonMenu)
  4583. On Error GoTo ErrTrap_tbrMenuButton_ButtonMenuClick
  4584. ProcessUICommand Selection, ButtonMenu.Key
  4585. Exit Sub
  4586. ' Error Handler for this method
  4587. ErrTrap_tbrMenuButton_ButtonMenuClick:
  4588. DisplayError "tbrMenuButton_ButtonMenuClick"
  4589. End Sub
  4590. ' =============================================================================
  4591. ' Method: Views_AddNewMenuItems
  4592. ' Type: Event
  4593. ' Description: Fired when a context menu is about to be displayed to give the
  4594. ' snap-in the opportunity to add items to MMC's "New" sub-menu.
  4595. '
  4596. ' Parameters: View The view in which the context menu
  4597. ' invocation occurred. The context menu may
  4598. ' have been invoked in either the scope pane
  4599. ' or in the result pane.
  4600. ' Selection MMCClipboard object containing the
  4601. ' currently selected item(s).
  4602. ' ContextMenu A ContextMenu object that allows adding the
  4603. ' snap-in's menus.
  4604. ' InsertionAllowed Defaults to True. If the snap-in sets it to
  4605. ' False, then snap-ins that extend context
  4606. ' menus for the selected item(s) will not be
  4607. ' given the opportunity to alter the menu.
  4608. ' Output: None
  4609. ' Notes: For drives and folders adds mnuNew that has the item to create
  4610. ' a new folder. For the Internet Explorer node adds a "URL..." item.
  4611. ' =============================================================================
  4612. '
  4613. Private Sub Views_AddNewMenuItems(ByVal View As SnapInLib.IView, _
  4614. ByVal Selection As SnapInLib.IMMCClipboard, _
  4615. ByVal ContextMenu As SnapInLib.IContextMenu, _
  4616. InsertionAllowed As Boolean)
  4617. On Error GoTo ErrTrap_Views_AddNewMenuItems
  4618. If Selection.SelectionType = siSingleScopeItem Then
  4619. If (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Drive) Or _
  4620. (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Folder) Then
  4621. ContextMenu.AddMenu mnuNew
  4622. ElseIf Selection.ScopeItems(1).Key = SZ_INTERNETEXPLORER Then
  4623. ContextMenu.AddMenu mnuNewURL
  4624. End If
  4625. End If
  4626. Exit Sub
  4627. ' Error Handler for this method
  4628. ErrTrap_Views_AddNewMenuItems:
  4629. DisplayError "Views_AddNewMenuItems"
  4630. End Sub
  4631. ' =============================================================================
  4632. ' Method: Views_AddTopMenuItems
  4633. ' Type: Event
  4634. ' Description: Fired when a context menu is about to be displayed to give the
  4635. ' snap-in the opportunity to add items to the top of MMC's
  4636. ' context menu.
  4637. '
  4638. ' Parameters: View The view in which the context menu
  4639. ' invocation occurred. The context menu may
  4640. ' have been invoked in either the scope pane
  4641. ' or in the result pane.
  4642. ' Selection MMCClipboard object containing the
  4643. ' currently selected item(s).
  4644. ' ContextMenu A ContextMenu object that allows adding the
  4645. ' snap-in's menus.
  4646. ' InsertionAllowed Defaults to True. If the snap-in sets it to
  4647. ' False, then snap-ins that extend context
  4648. ' menus for the selected item(s) will not be
  4649. ' given the opportunity to alter the menu.
  4650. ' Output: None
  4651. ' Notes: Enable items in mnuRun based on the selection and add it to
  4652. ' to the context menu.
  4653. ' =============================================================================
  4654. '
  4655. Private Sub Views_AddTopMenuItems(ByVal View As SnapInLib.IView, _
  4656. ByVal Selection As SnapInLib.IMMCClipboard, _
  4657. ByVal ContextMenu As SnapInLib.IContextMenu, _
  4658. InsertionAllowed As Boolean)
  4659. On Error GoTo ErrTrap_Views_AddTopMenuItems
  4660. ' Gray everything and then we'll enable as needed
  4661. mnuRun.Grayed = True
  4662. mnuRun.Enabled = True
  4663. mnuRunAs.Grayed = True
  4664. mnuRunAs.Enabled = False
  4665. Select Case Selection.SelectionType
  4666. Case siSingleListItem
  4667. mnuRun.Grayed = False
  4668. mnuRun.Enabled = True
  4669. mnuRunAs.Grayed = False
  4670. mnuRunAs.Enabled = True
  4671. Case siMultiListItems
  4672. mnuRun.Grayed = False
  4673. mnuRun.Enabled = True
  4674. mnuRunAs.Grayed = False
  4675. mnuRunAs.Enabled = True
  4676. End Select
  4677. ContextMenu.AddMenu mnuContext
  4678. Exit Sub
  4679. ' Error Handler for this method
  4680. ErrTrap_Views_AddTopMenuItems:
  4681. DisplayError "Views_AddTopMenuItems"
  4682. End Sub
  4683. ' =============================================================================
  4684. ' Method: Views_GetMultiSelectData
  4685. ' Type: Event
  4686. ' Description: Fired when the user selects multiple items in a listview. Allows
  4687. ' the snap-in to export data for the multiple selection.
  4688. '
  4689. ' Parameters: View The View in which the request occurred.
  4690. ' Selection The selected items
  4691. ' Data Empty data object. The snap-in should add any
  4692. ' desired formats to be exported for extensions
  4693. ' or for other instances of itself.
  4694. '
  4695. ' Output: None
  4696. ' Notes: Set "Folders" format as a string array containing the path of
  4697. ' each folder.
  4698. ' Set "Files" format as a string array containing the name of
  4699. ' each file.
  4700. ' Set "Paths" format as a string array containing the path of
  4701. ' each file.
  4702. ' =============================================================================
  4703. '
  4704. Private Sub Views_GetMultiSelectData(ByVal View As SnapInLib.IView, _
  4705. ByVal Selection As SnapInLib.IMMCClipboard, _
  4706. ByVal Data As SnapInLib.IMMCDataObject)
  4707. On Error GoTo ErrTrap_Views_GetMultiSelectData
  4708. Dim Folders() As String
  4709. Dim cFolders As Long
  4710. Dim Folder As Scripting.Folder
  4711. Dim Files() As String
  4712. Dim Paths() As String
  4713. Dim cFiles As Long
  4714. Dim File As Scripting.File
  4715. Dim ScopeItem As ScopeItem
  4716. Dim ListItem As MMCListItem
  4717. Dim i As Long
  4718. cFolders = 0
  4719. ' Count all the folders that are among the selected ScopeItems
  4720. For Each ScopeItem In Selection.ScopeItems
  4721. If TypeOf ScopeItem.Tag Is Scripting.Folder Then
  4722. cFolders = cFolders + 1
  4723. End If
  4724. Next ScopeItem
  4725. ' If there are any folders then ReDim the string array and add each folder's
  4726. ' path to the array. Set data format called "Folders" containing the string array.
  4727. If cFolders > 0 Then
  4728. ReDim Folders(1 To cFolders)
  4729. i = 1
  4730. For Each ScopeItem In Selection.ScopeItems
  4731. If TypeOf ScopeItem.Tag Is Scripting.Folder Then
  4732. Set Folder = ScopeItem.Tag
  4733. Folders(i) = Folder.Path
  4734. i = i + i
  4735. End If
  4736. Next ScopeItem
  4737. Data.SetData Folders, "Folders"
  4738. End If
  4739. ' If there are any files in the selection then ReDim the string arrays and add
  4740. ' each file's name and path to the arrays. Set data formats called "Files" and "Paths'
  4741. ' containing the arrays.
  4742. cFiles = Selection.ListItems.Count
  4743. If cFiles = 0 Then
  4744. Exit Sub
  4745. End If
  4746. ReDim Files(1 To cFiles)
  4747. ReDim Paths(1 To cFiles)
  4748. i = 1
  4749. For Each ListItem In Selection.ListItems
  4750. Set File = ListItem.Tag
  4751. Files(i) = File.Name
  4752. Paths(i) = File.Path
  4753. i = i + 1
  4754. Next ListItem
  4755. Data.SetData Files, "Files"
  4756. Data.SetData Paths, "Paths"
  4757. Exit Sub
  4758. ' Error Handler for this method
  4759. ErrTrap_Views_GetMultiSelectData:
  4760. DisplayError "Views_GetMultiSelectData"
  4761. End Sub
  4762. ' =============================================================================
  4763. ' Method: Views_QueryPagesFor
  4764. ' Type: Event
  4765. ' Description: Fired when the user requests properties for the selected
  4766. ' items.
  4767. '
  4768. ' Parameters: View The View in which the request occurred.
  4769. ' Selection The selected items
  4770. ' HasPropertyPages Defaults to False. Set to True if the snap-in
  4771. ' has property pages for the selected items.
  4772. '
  4773. ' Output: None
  4774. ' Notes: We set HasPropertyPages=True for folders and files.
  4775. ' =============================================================================
  4776. '
  4777. Private Sub Views_QueryPagesFor(ByVal View As SnapInLib.View, _
  4778. ByVal Selection As SnapInLib.MMCClipboard, _
  4779. HasPropertyPages As Boolean)
  4780. On Error GoTo ErrTrap_Views_QueryPagesFor
  4781. Dim ScopeItem As ScopeItem
  4782. ' Assume no property pages.
  4783. HasPropertyPages = False
  4784. ' If the selection is a single scope item and it is the static node or the
  4785. ' extension root then the user has requested to run the configuration wizard.
  4786. ' If it is the Internet Explorer node then the user has requested to display
  4787. ' properties to enter a new URL. If it is the About node then the user has
  4788. ' clicked the configuration button on the About OCX.
  4789. If Selection.SelectionType = siSingleScopeItem Then
  4790. If (Selection.ScopeItems(1).Key = SZ_STATICNODE) Or _
  4791. (Selection.ScopeItems(1).Key = SZ_EXTENSION_ROOT) Or _
  4792. (Selection.ScopeItems(1).Key = SZ_ABOUT) Or _
  4793. (Selection.ScopeItems(1).Key = SZ_INTERNETEXPLORER) Then
  4794. HasPropertyPages = True
  4795. Exit Sub
  4796. End If
  4797. End If
  4798. ' If there are any list items then we do have property pages.
  4799. If Selection.ListItems.Count > 0 Then
  4800. HasPropertyPages = True
  4801. Exit Sub
  4802. End If
  4803. ' Iterate through selected ScopeItems and see if any of them represents a
  4804. ' folder.
  4805. For Each ScopeItem In Selection.ScopeItems
  4806. If TypeOf ScopeItem.Tag Is Scripting.Folder Then
  4807. HasPropertyPages = True
  4808. Exit Sub
  4809. End If
  4810. Next ScopeItem
  4811. Exit Sub
  4812. ' Error Handler for this method
  4813. ErrTrap_Views_QueryPagesFor:
  4814. DisplayError "Views_QueryPagesFor"
  4815. End Sub
  4816. ' =============================================================================
  4817. ' Method: Views_CreatePropertyPages
  4818. ' Type: Event
  4819. ' Description: Fired when the user requests properties for the selected
  4820. ' items and True has been returned from
  4821. ' the Views_QueryPagesFor event. Gives the snap-in the chance
  4822. ' to add its property pages to the property sheet being displayed
  4823. ' by MMC for the selected items.
  4824. '
  4825. ' Parameters: View The View in which the request occurred.
  4826. ' Selection The selected items
  4827. ' PropertySheet PropertySheet object used to add the snap-in's
  4828. ' property pages.
  4829. '
  4830. ' Output: None
  4831. ' Notes: We add an instance of the ppgGeneral page for each folder and
  4832. ' for each file. We pass the zero-based position of each page
  4833. ' for the InitData parameter to PropertySheet.AddPage so that each
  4834. ' page will know which object in PropertyPage.SelectedControls
  4835. ' it needs to display properties for.
  4836. ' =============================================================================
  4837. '
  4838. Private Sub Views_CreatePropertyPages(ByVal View As SnapInLib.View, _
  4839. ByVal Selection As SnapInLib.MMCClipboard, _
  4840. ByVal PropertySheet As SnapInLib.MMCPropertySheet)
  4841. On Error GoTo ErrTrap_Views_CreatePropertyPages
  4842. Dim Position As Long
  4843. Dim ScopeItem As ScopeItem
  4844. Dim ListItem As MMCListItem
  4845. Position = 0
  4846. ' If the selection is a single scope item and it is the static node or the
  4847. ' extension root then the user has requested to run the configuration wizard.
  4848. ' We just invoke the SnapIn_CreateConfigurationWizard event handler as it does
  4849. ' exactly that. If it is the Internet Explorer node then the user has requested
  4850. ' to display properties to enter a new URL. If it is the About node then the
  4851. ' user has clicked the configuration button on the About OCX.
  4852. If Selection.SelectionType = siSingleScopeItem Then
  4853. If (Selection.ScopeItems(1).Key = SZ_STATICNODE) Or _
  4854. (Selection.ScopeItems(1).Key = SZ_EXTENSION_ROOT) Or _
  4855. (Selection.ScopeItems(1).Key = SZ_ABOUT) Then
  4856. SnapIn_CreateConfigurationWizard PropertySheet
  4857. Exit Sub
  4858. ElseIf Selection.ScopeItems(1).Key = SZ_INTERNETEXPLORER Then
  4859. PropertySheet.AddPage "ppgBrowser"
  4860. End If
  4861. End If
  4862. ' Add folder property pages first
  4863. For Each ScopeItem In Selection.ScopeItems
  4864. ' If the ScopeItem represents a folder:
  4865. ' Add an instance of ppgGeneral:
  4866. ' Use the folder name as the caption
  4867. ' True=Use Help Button
  4868. ' False=Text is Left to Right
  4869. ' Pass the page's position in the property sheet for the InitData parameter
  4870. If TypeOf ScopeItem.Tag Is Scripting.Folder Then
  4871. PropertySheet.AddPage "ppgGeneral", ScopeItem.ScopeNode.DisplayName, _
  4872. True, False, Str(Position)
  4873. Position = Position + 1
  4874. End If
  4875. Next ScopeItem
  4876. ' Add file property pages
  4877. For Each ListItem In Selection.ListItems
  4878. ' Use the file name as the caption
  4879. PropertySheet.AddPage "ppgGeneral", ListItem.Text, True, False, Str(Position)
  4880. Position = Position + 1
  4881. Next ListItem
  4882. Exit Sub
  4883. ' Error Handler for this method
  4884. ErrTrap_Views_CreatePropertyPages:
  4885. DisplayError "Views_CreatePropertyPages"
  4886. End Sub
  4887. ' =============================================================================
  4888. ' Method: Views_QueryPaste
  4889. ' Type: Event
  4890. ' Description: Fired when MMC needs to determine whether to display the
  4891. ' paste item on a context menu for a scope item and also when
  4892. ' a drag occurs over a scope item.
  4893. '
  4894. ' Parameters: DestView The destination view in which the paste may
  4895. ' occur.
  4896. ' SourceItems MMCClipboard object containing the item(s)
  4897. ' that may be pasted.
  4898. ' DestScopeItem The ScopeItem on which they may be pasted
  4899. ' OKToPaste Defaults to False. If the snap-in sets it to
  4900. ' True, then MMC will add the Paste item
  4901. ' to the context menu for the ScopeItem or
  4902. ' display the drop cursor over the ScopeItem.
  4903. ' Output: None
  4904. ' Notes: Examines the selection to determine whether a paste would be
  4905. ' accepted.
  4906. ' =============================================================================
  4907. '
  4908. Private Sub Views_QueryPaste(ByVal DestView As SnapInLib.IView, _
  4909. ByVal SourceItems As SnapInLib.IMMCClipboard, _
  4910. ByVal DestScopeItem As SnapInLib.IScopeItem, _
  4911. OKToPaste As Boolean)
  4912. On Error GoTo ErrTrap_Views_QueryPaste
  4913. Dim ScopeItem As ScopeItem
  4914. OKToPaste = False
  4915. ' If the destination scope item is not a drive or a folder then
  4916. ' we can't accept a paste
  4917. If (Not TypeOf DestScopeItem.Tag Is Scripting.Folder) And _
  4918. (Not TypeOf DestScopeItem.Tag Is Scripting.Drive) Then
  4919. Exit Sub
  4920. End If
  4921. ' If the source items contain anything from another snap-in then we can't
  4922. ' accept the paste
  4923. If (SourceItems.SelectionType = siSingleForeign) Or _
  4924. (SourceItems.SelectionType = siMultiForeign) Or _
  4925. (SourceItems.SelectionType = siMultiMixedForeign) Then
  4926. Exit Sub
  4927. End If
  4928. ' If the source items contain any drives then we can't accept the paste
  4929. For Each ScopeItem In SourceItems.ScopeItems
  4930. If TypeOf ScopeItem.Tag Is Scripting.Drive Then
  4931. Exit Sub
  4932. End If
  4933. Next ScopeItem
  4934. ' At this point we know the user is trying to paste either folders and/or files
  4935. ' onto a drive or onto folder. We can accept this.
  4936. OKToPaste = True
  4937. Exit Sub
  4938. ' Error Handler for this method
  4939. ErrTrap_Views_QueryPaste:
  4940. DisplayError "Views_QueryPaste"
  4941. End Sub
  4942. ' =============================================================================
  4943. ' Method: Views_Paste
  4944. ' Type: Event
  4945. ' Description: Fired when MMC needs to determine whether to display the
  4946. ' paste item on a context menu for a scope item and also when
  4947. ' a drag occurs over a scope item.
  4948. '
  4949. ' Parameters: DestView The destination view in which the paste has
  4950. ' occurred.
  4951. ' SourceItems MMCClipboard object containing the item(s)
  4952. ' that are being pasted.
  4953. ' DestScopeItem The ScopeItem on which they may be pasted
  4954. ' RetToSource An empty MMCDataObject that will be returned
  4955. ' to the source of the paste if this is a move
  4956. ' operation (as opposed to a copy). The contents
  4957. ' of the returned data are defined by the source
  4958. ' snap-in. When moving within a single snap-in
  4959. ' it is not used. In that case the destination
  4960. ' sets ScopeItem.Pasted and ListItem.Pasted on
  4961. ' each successfully pasted item.
  4962. ' Move True=a move operation. False=a copy operation.
  4963. '
  4964. ' Output: None
  4965. ' Notes: Pastes are only supported within the same instance of the
  4966. ' FileExplorer (see Views_QueryPaste above). Performs the associated
  4967. ' file operations ands sets Pasted on the processed items. For a
  4968. ' Move operation, the removal of the source items is handled in
  4969. ' the Views_Cut event (see below).
  4970. ' =============================================================================
  4971. '
  4972. Private Sub Views_Paste(ByVal DestView As SnapInLib.IView, _
  4973. ByVal SourceItems As SnapInLib.IMMCClipboard, _
  4974. ByVal DestScopeItem As SnapInLib.IScopeItem, _
  4975. ByVal RetToSource As SnapInLib.IMMCDataObject, _
  4976. ByVal Move As Boolean)
  4977. On Error GoTo ErrTrap_Views_Paste
  4978. Dim Drive As Scripting.Drive
  4979. Dim Folder As Scripting.Folder
  4980. Dim File As Scripting.File
  4981. Dim DestPath As String
  4982. Dim ScopeItem As ScopeItem
  4983. Dim NewScopeItem As ScopeItem
  4984. Dim ListItems As MMCListItems
  4985. Dim ListItem As MMCListItem
  4986. Dim NewPath As String
  4987. Dim OKToPaste As Boolean
  4988. Dim DestScopeItemSelected As Boolean
  4989. Dim NewPathExists As Boolean
  4990. ' In Views_QueryPaste we only allowed pasting of folders and/or files onto
  4991. ' a drive or a folder so the source items must be of those types.
  4992. ' Get the destination path
  4993. If TypeOf DestScopeItem.Tag Is Scripting.Drive Then
  4994. Set Drive = DestScopeItem.Tag
  4995. DestPath = Drive.Path
  4996. ElseIf TypeOf DestScopeItem.Tag Is Scripting.Folder Then
  4997. Set Folder = DestScopeItem.Tag
  4998. DestPath = Folder.Path
  4999. Else
  5000. Debug.Assert False
  5001. Exit Sub ' this should never happen
  5002. End If
  5003. ' Iterate through the source folders and either move or copy them
  5004. ' to the destination as requested. If there is not yet a scope item at the
  5005. ' destination then add one. If there is a potential overwrite then ask the
  5006. ' user to confirm the operation.
  5007. ' Set PasteOK on each one.
  5008. For Each ScopeItem In SourceItems.ScopeItems
  5009. Set Folder = ScopeItem.Tag
  5010. NewPath = DestPath & "\" & Folder.Name
  5011. If m_FileSystemObject.FolderExists(NewPath) Then
  5012. OKToPaste = ConfirmOverwrite(NewPath)
  5013. NewPathExists = True
  5014. Else
  5015. OKToPaste = True
  5016. NewPathExists = False
  5017. End If
  5018. If OKToPaste Then
  5019. If Move Then
  5020. If NewPathExists Then
  5021. ' File.Move won't overwrite an existing folder so we delete it first
  5022. m_FileSystemObject.DeleteFolder NewPath, True
  5023. End If
  5024. Folder.Move NewPath
  5025. Else
  5026. Folder.Copy NewPath, True
  5027. End If
  5028. ' Check whether the new ScopeItem exists. If not then add it.
  5029. Set NewScopeItem = Nothing
  5030. If NewPathExists Then
  5031. On Error Resume Next
  5032. Set NewScopeItem = ScopeItems(NewPath)
  5033. On Error GoTo ErrTrap_Views_Paste
  5034. End If
  5035. If NewScopeItem Is Nothing Then
  5036. ' If the destination ScopeItem has never been expanded, then
  5037. ' expand it in the namespace now, That will cause the enumeration of
  5038. ' subfolders which will see the newly added folder.
  5039. If Not DestScopeItem.ScopeNode.ExpandedOnce Then
  5040. DestScopeItem.ScopeNode.ExpandInNameSpace
  5041. Else
  5042. ' The destination scope item has been expanded. Just add the new folder.
  5043. AddNewFolder DestScopeItem, m_FileSystemObject.GetFolder(NewPath)
  5044. End If
  5045. End If
  5046. ScopeItem.Pasted = True
  5047. End If
  5048. Next ScopeItem
  5049. ' For files do the move or copy but only add the list item if
  5050. ' DestScopeItem is the currently selected node in the scope pane.
  5051. With DestView.ScopePaneItems.SelectedItem
  5052. If .ScopeItem Is DestScopeItem Then
  5053. DestScopeItemSelected = True
  5054. Set ListItems = .ResultView.ListView.ListItems
  5055. Else
  5056. DestScopeItemSelected = False
  5057. End If
  5058. End With
  5059. For Each ListItem In SourceItems.ListItems
  5060. Set File = ListItem.Tag
  5061. NewPath = DestPath & "\" & File.Name
  5062. If m_FileSystemObject.FileExists(NewPath) Then
  5063. OKToPaste = ConfirmOverwrite(NewPath)
  5064. NewPathExists = True
  5065. Else
  5066. OKToPaste = True
  5067. NewPathExists = False
  5068. End If
  5069. If OKToPaste Then
  5070. If Move Then
  5071. If NewPathExists Then
  5072. ' File.Move won't overwrite an existing file so we delete it first
  5073. m_FileSystemObject.DeleteFile NewPath, True
  5074. End If
  5075. File.Move NewPath
  5076. Else
  5077. File.Copy NewPath, True
  5078. End If
  5079. ListItem.Pasted = True
  5080. If DestScopeItemSelected And (Not NewPathExists) Then
  5081. AddNewFile ListItems, m_FileSystemObject.GetFile(NewPath)
  5082. End If
  5083. End If
  5084. Next ListItem
  5085. Exit Sub
  5086. ' Error Handler for this method
  5087. ErrTrap_Views_Paste:
  5088. DisplayError "Views_Paste"
  5089. End Sub
  5090. ' =============================================================================
  5091. ' Method: Views_Cut
  5092. ' Type: Event
  5093. ' Description: Fired on the source snap-in following the Views_Paste event
  5094. ' during a Move operation to allow the source to delete the pasted
  5095. ' items.
  5096. '
  5097. ' Parameters: View The view from which the items were cut
  5098. ' ItemsPasted MMCClipboard object containing the item(s)
  5099. ' that were cut and pasted.
  5100. ' RetFromTarget An MMCDataObject containing data returned
  5101. ' from the target of the paste if the target
  5102. ' is not the same instance of the same snap-in.
  5103. ' When moving within a single snap-in
  5104. ' it is not used. In that case the destination
  5105. ' set ScopeItem.Pasted and ListItem.Pasted on
  5106. ' each successfully pasted item.
  5107. '
  5108. ' Output: None
  5109. ' Notes: Pastes are only supported within the same instance of the
  5110. ' FileExplorer (see Views_QueryPaste above). Checks the Pasted
  5111. ' property on each item and removes the corresponding ScopeItem
  5112. ' or list item.
  5113. ' =============================================================================
  5114. '
  5115. Private Sub Views_Cut(ByVal View As SnapInLib.IView, _
  5116. ByVal ItemsPasted As SnapInLib.IMMCClipboard, _
  5117. ByVal RetFromTarget As SnapInLib.IMMCDataObject)
  5118. On Error GoTo ErrTrap_Views_Cut
  5119. Dim ScopeItem As ScopeItem
  5120. Dim ListItem As MMCListItem
  5121. ' Each pasted scope item must be removed from the scope items collection. The
  5122. ' actual file operation was done in Views_Paste.
  5123. For Each ScopeItem In ItemsPasted.ScopeItems
  5124. If ScopeItem.Pasted Then
  5125. ScopeItems.Remove (ScopeItem.Key)
  5126. End If
  5127. Next ScopeItem
  5128. ' For list items we need to check whether they belong to the currently selected
  5129. ' scope pane item. If so then we need to delete them. We do the check by using the
  5130. ' key of one of the pasted items as an index into the current result view's list items.
  5131. ' As with scope items, the actual file operation was done in Views_Paste so we are
  5132. ' only updating MMC here.
  5133. If ItemsPasted.ListItems.Count = 0 Then
  5134. Exit Sub
  5135. End If
  5136. With View.ScopePaneItems.SelectedItem.ResultView.ListView
  5137. On Error Resume Next
  5138. Set ListItem = .ListItems(ItemsPasted.ListItems(1).Key)
  5139. On Error GoTo ErrTrap_Views_Cut
  5140. If ListItem Is Nothing Then
  5141. Exit Sub
  5142. End If
  5143. ' The list items are from the current result view so delete them.
  5144. For Each ListItem In ItemsPasted.ListItems
  5145. If ListItem.Pasted Then
  5146. .ListItems.Remove ListItem.Key
  5147. End If
  5148. Next ListItem
  5149. End With
  5150. Exit Sub
  5151. ' Error Handler for this method
  5152. ErrTrap_Views_Cut:
  5153. DisplayError "Views_Cut"
  5154. End Sub
  5155. ' =============================================================================
  5156. ' Method: Views_Delete
  5157. ' Type: Event
  5158. ' Description: Fired when the user initiates a delete operation by selecting
  5159. ' items and hitting the delete key, or by selecting "Delete" from
  5160. ' the context menu, or by clicking the delete toolbar button. (All
  5161. ' of these UI elements are supplied by MMC as a result of enabling
  5162. ' the console delete verb.
  5163. '
  5164. ' Parameters: View The view in which the delete request occurred.
  5165. ' Selection MMCClipboard object containing the item(s)
  5166. ' that are to be deleted.
  5167. '
  5168. ' Output: None
  5169. ' Notes: Performs the file operation and deletes the scope items and/or
  5170. ' list items.
  5171. ' =============================================================================
  5172. '
  5173. Private Sub Views_Delete(ByVal View As SnapInLib.IView, _
  5174. ByVal Selection As SnapInLib.IMMCClipboard)
  5175. On Error GoTo ErrTrap_Views_Delete
  5176. Dim ScopeItem As ScopeItem
  5177. Dim ListItem As MMCListItem
  5178. Dim Folder As Scripting.Folder
  5179. Dim File As Scripting.File
  5180. Dim Choice As Integer
  5181. ' Request confirmation from the user before deleting
  5182. Choice = ConsoleMsgBox("Are you sure you want to delete the selected items?", _
  5183. vbYesNo, "FileExplorer")
  5184. If Choice = vbNo Then
  5185. Exit Sub
  5186. End If
  5187. ' Delete the scope items from MMC and the folders from the file system
  5188. For Each ScopeItem In Selection.ScopeItems
  5189. Set Folder = ScopeItem.Tag
  5190. Folder.Delete True ' True=Delete even if read-only
  5191. ScopeItems.Remove (ScopeItem.Key)
  5192. Next ScopeItem
  5193. ' Delete the list items from MMC and the files from the file system
  5194. With View.ScopePaneItems.SelectedItem.ResultView.ListView
  5195. For Each ListItem In Selection.ListItems
  5196. Set File = ListItem.Tag
  5197. File.Delete True ' True=Delete even if read-only
  5198. .ListItems.Remove (ListItem.Key)
  5199. Next ListItem
  5200. End With
  5201. Exit Sub
  5202. ' Error Handler for this method
  5203. ErrTrap_Views_Delete:
  5204. DisplayError "Views_Delete"
  5205. End Sub
  5206. ' =============================================================================
  5207. ' Method: RefreshScopeItem
  5208. ' Type: Event
  5209. ' Description: Fired when the user requests to refresh the view
  5210. ' by hitting F5 or selecting "Refresh"
  5211. ' from the context menu.
  5212. '
  5213. ' Parameters: ScopeItem ScopeItem to be refreshed
  5214. '
  5215. ' Output: None
  5216. ' Notes: Removes all of the child scope items and then iterates through
  5217. ' the sub-folders and adds them back. If the scope item is
  5218. ' currently selected in the scope pane then calls
  5219. ' ScopePaneItem.DisplayNewResultView to refresh the result
  5220. ' view.
  5221. ' =============================================================================
  5222. '
  5223. Private Sub RefreshScopeItem(ByVal ScopeItem As SnapInLib.ScopeItem)
  5224. On Error GoTo ErrTrap_RefreshScopeItem
  5225. Dim Drive As Scripting.Drive
  5226. Dim SubFolders As Scripting.Folders
  5227. Dim Folder As Scripting.Folder
  5228. Dim Child As ScopeNode
  5229. Dim ChildName As String
  5230. ' Remove all of the child scope items of the refreshed scope item. We do this
  5231. ' first so that we can reiterate through the sub-folders of this scope item and
  5232. ' pick up any changes (renames, deletes, additions) done outside of FileExplorer
  5233. Set Child = ScopeItem.ScopeNode.Child
  5234. ' This could also be done by simply calling ScopeItem.RemoveChildren. The
  5235. ' technique used here is to demonstrate iteration of scope nodes.
  5236. While Not Child Is Nothing
  5237. ChildName = ScopeItems(Child).Name
  5238. Set Child = Child.Next
  5239. ScopeItems.Remove ChildName
  5240. Wend
  5241. ' Invoke the ScopeItems_Expand event handler is it knows how to populate the
  5242. ' children of a given ScopeItem
  5243. ScopeItems_Expand ScopeItem
  5244. ' If the refreshed scope item is currently selected in the scope pane then
  5245. ' refresh the result pane contents. This can be done by calling
  5246. ' ScopePaneItem.DisplayNewResultView using the current display string and result
  5247. ' view type.
  5248. If CurrentScopePaneItem Is Nothing Then
  5249. Exit Sub
  5250. End If
  5251. If ScopeItem Is CurrentScopePaneItem.ScopeItem Then
  5252. CurrentScopePaneItem.DisplayNewResultView CurrentScopePaneItem.DisplayString, CurrentScopePaneItem.ResultViewType
  5253. End If
  5254. Exit Sub
  5255. ' Error Handler for this method
  5256. ErrTrap_RefreshScopeItem:
  5257. DisplayError "RefreshScopeItem"
  5258. End Sub
  5259. ' =============================================================================
  5260. ' Method: Views_Refresh
  5261. ' Type: Event
  5262. ' Description: Fired when the user requests to refresh the view
  5263. ' by hitting F5 or selecting "Refresh"
  5264. ' from the context menu.
  5265. '
  5266. ' Parameters: View A reference to the specific View object
  5267. ' in which the refresh request occurred.
  5268. ' Selection An MMCClipboard object that contains
  5269. ' the currently selected items.
  5270. '
  5271. ' Output: None
  5272. ' Notes: We support refresh for scope items only.
  5273. ' Checks selection and calls subroutine RefreshScopeItem to do the work.
  5274. ' =============================================================================
  5275. '
  5276. Private Sub Views_Refresh(ByVal View As SnapInLib.View, _
  5277. ByVal Selection As SnapInLib.MMCClipboard)
  5278. On Error GoTo ErrTrap_Views_Refresh
  5279. ' Double check that the selection is indeed a single scope item and assign it to
  5280. ' a local variable
  5281. If Selection.SelectionType <> siSingleScopeItem Then
  5282. Exit Sub
  5283. End If
  5284. RefreshScopeItem Selection.ScopeItems(1)
  5285. Exit Sub
  5286. ' Error Handler for this method
  5287. ErrTrap_Views_Refresh:
  5288. DisplayError "Views_Refresh"
  5289. End Sub
  5290. ' =============================================================================
  5291. ' Method: Views_Select
  5292. ' Type: Event
  5293. ' Description: Occurs when the user selects item(s) in either the scope
  5294. ' pane or in the result pane of a particular view.
  5295. ' Parameters: View A reference to the specific View object
  5296. ' in which the selection occurred.
  5297. ' Selection An MMCClipboard object that contains
  5298. ' the currently selected items.
  5299. ' Selected A boolean indicating whether the items are
  5300. ' being selected or de-selected
  5301. ' ConsoleVerbs An IMMCConsoleVerbs interface that allows
  5302. ' the snap-in to enable/disable the console verbs
  5303. ' such as rename and delete.
  5304. ' Output: None
  5305. ' Notes: Determine which types of objects are currently selected and
  5306. ' enable the console verbs we support for that combination of
  5307. ' objects. Update the status bar with number of objects selected,
  5308. ' total size of objects selected, and disk free space.
  5309. ' =============================================================================
  5310. '
  5311. Private Sub Views_Select(ByVal View As SnapInLib.IView, _
  5312. ByVal Selection As SnapInLib.IMMCClipboard, _
  5313. ByVal Selected As Boolean, _
  5314. ByVal ConsoleVerbs As SnapInLib.IMMCConsoleVerbs)
  5315. On Error GoTo ErrTrap_Views_Select
  5316. Dim ScopeItem As ScopeItem
  5317. Dim ListItem As MMCListItem
  5318. Dim Drive As Scripting.Drive
  5319. Dim Folder As Scripting.Folder
  5320. Dim File As Scripting.File
  5321. Dim szDisplayText As String
  5322. Dim DiskSpaceAvailable As Double
  5323. Dim TotalSelectedFileSize As Double
  5324. Dim SelectionType As SnapInSelectionTypeConstants
  5325. SelectionType = Selection.SelectionType
  5326. ' Start out by disabling everything.
  5327. ' We will then enable as needed
  5328. ConsoleVerbs(siOpen).Enabled = False
  5329. ConsoleVerbs(siCopy).Enabled = False
  5330. ConsoleVerbs(siPaste).Enabled = False
  5331. ConsoleVerbs(siDelete).Enabled = False
  5332. ConsoleVerbs(siProperties).Enabled = False
  5333. ConsoleVerbs(siRename).Enabled = False
  5334. ConsoleVerbs(siRefresh).Enabled = False
  5335. ConsoleVerbs(siPrint).Enabled = False
  5336. ConsoleVerbs(siCut).Enabled = False
  5337. ' If the selection is a single scope item and it is the static node then there is
  5338. ' nothing to do because there is nothing to enable and MMC does not allow displaying
  5339. ' anything in the status bar in this case. This code also handles the case where
  5340. ' FileExplorer is extending the Computer Management snap-in in Windows 2000 and the
  5341. ' ExtensionRoot node is selected.
  5342. If SelectionType = siSingleScopeItem Then
  5343. If Selection.ScopeItems(1).Key = SZ_STATICNODE Or _
  5344. Selection.ScopeItems(1).Key = SZ_EXTENSION_ROOT Then
  5345. Exit Sub
  5346. End If
  5347. End If
  5348. ' If the static node is currently selected in the scope pane then there is also
  5349. ' nothing to do for the same reason. In this case the selection would be
  5350. ' the desktop node in the result pane.
  5351. If Not View.ScopePaneItems.SelectedItem Is Nothing Then
  5352. With View.ScopePaneItems.SelectedItem.ScopeItem
  5353. If (.Name = SZ_STATICNODE) Or (.Name = SZ_EXTENSION_ROOT) Then
  5354. Exit Sub
  5355. End If
  5356. End With
  5357. End If
  5358. ' If this is a deselection then don't enable anything and clear the status bar.
  5359. If Not Selected Then
  5360. View.SetStatusBarText ""
  5361. Exit Sub
  5362. End If
  5363. ' Examine the selection and determine which verbs to enable
  5364. ' For "My Computer" enable refresh
  5365. ' For "Internet Explorer" enable properties.
  5366. ' For a drive enable refresh if it has already been expanded. Always enable paste.
  5367. ' This doesn't imply that the system clipboard currently contains something that we
  5368. ' can paste. It only tells MMC that we can potentially paste on this selection
  5369. ' and that it should ask us before displaying its context menu or enabling its
  5370. ' paste button. When MMC does ask we will receive a Views_QueryPaste event.
  5371. ' For a single folder enable properties.
  5372. ' If it has already been expanded then enable refresh.
  5373. ' Always enable paste for same reason described above for a drive.
  5374. ' If permissions allow, enable cut, copy, rename, and delete
  5375. ' For multiple folders, if permissions allow, enable cut, copy, and delete.
  5376. ' For a single file enable properties and print.
  5377. ' If permissions allow, then enable cut, copy, rename, and delete.
  5378. ' For multiple files enable print.
  5379. ' If permissions allow, then enable cut, copy, and delete.
  5380. ' For mixed folders and files, if permissions allow enable cut, copy, and delete.
  5381. Select Case SelectionType
  5382. Case siSingleScopeItem
  5383. Set ScopeItem = Selection.ScopeItems(1)
  5384. If ScopeItem.Key = SZ_MYCOMPUTER Then
  5385. If ScopeItem.ScopeNode.ExpandedOnce Then
  5386. ConsoleVerbs(siRefresh).Enabled = True
  5387. End If
  5388. ElseIf ScopeItem.Key = SZ_INTERNETEXPLORER Then
  5389. If ScopeItem.ScopeNode.ExpandedOnce Then
  5390. ConsoleVerbs(siProperties).Enabled = True
  5391. End If
  5392. ElseIf TypeOf ScopeItem.Tag Is Scripting.Drive Then
  5393. If ScopeItem.ScopeNode.ExpandedOnce Then
  5394. ConsoleVerbs(siRefresh).Enabled = True
  5395. End If
  5396. ConsoleVerbs(siPaste).Enabled = True
  5397. ElseIf TypeOf ScopeItem.Tag Is Scripting.Folder Then
  5398. If ScopeItem.ScopeNode.ExpandedOnce Then
  5399. ConsoleVerbs(siRefresh).Enabled = True
  5400. End If
  5401. ConsoleVerbs(siProperties).Enabled = True
  5402. ConsoleVerbs(siPaste).Enabled = True
  5403. ' Check permissions for other verbs
  5404. If m_ConfigData.AllowFolderAccess Then
  5405. ConsoleVerbs(siCut).Enabled = True
  5406. ConsoleVerbs(siCopy).Enabled = True
  5407. ConsoleVerbs(siRename).Enabled = True
  5408. ConsoleVerbs(siDelete).Enabled = True
  5409. End If
  5410. End If
  5411. Case siSingleListItem
  5412. ConsoleVerbs(siProperties).Enabled = True
  5413. ConsoleVerbs(siPrint).Enabled = True
  5414. ' Check permissions for other verbs
  5415. If m_ConfigData.AllowFileAccess Then
  5416. ConsoleVerbs(siCut).Enabled = True
  5417. ConsoleVerbs(siCopy).Enabled = True
  5418. ConsoleVerbs(siRename).Enabled = True
  5419. ConsoleVerbs(siDelete).Enabled = True
  5420. End If
  5421. Case siMultiScopeItems
  5422. ' If there is anything other than a folder then don't enable anything
  5423. For Each ScopeItem In Selection.ScopeItems
  5424. If Not TypeOf ScopeItem.Tag Is Scripting.Folder Then
  5425. Exit Sub
  5426. End If
  5427. Next ScopeItem
  5428. ConsoleVerbs(siProperties).Enabled = True
  5429. ' It is all folders. Check permissions for allowable verbs
  5430. If m_ConfigData.AllowFolderAccess Then
  5431. ConsoleVerbs(siCut).Enabled = True
  5432. ConsoleVerbs(siCopy).Enabled = True
  5433. ConsoleVerbs(siDelete).Enabled = True
  5434. End If
  5435. Case siMultiListItems
  5436. ConsoleVerbs(siPrint).Enabled = True
  5437. ConsoleVerbs(siProperties).Enabled = True
  5438. ' Check permissions for other verbs
  5439. If m_ConfigData.AllowFileAccess Then
  5440. ConsoleVerbs(siCut).Enabled = True
  5441. ConsoleVerbs(siCopy).Enabled = True
  5442. ConsoleVerbs(siDelete).Enabled = True
  5443. End If
  5444. Case siMultiMixed
  5445. ' If the ScopeItems are anything other than folders then don't enable anything
  5446. For Each ScopeItem In Selection.ScopeItems
  5447. If Not TypeOf ScopeItem.Tag Is Scripting.Folder Then
  5448. Exit Sub
  5449. End If
  5450. Next ScopeItem
  5451. ConsoleVerbs(siProperties).Enabled = True
  5452. ' It is all folders and files. Check permissions for allowable verbs
  5453. If m_ConfigData.AllowFolderAccess And m_ConfigData.AllowFileAccess Then
  5454. ConsoleVerbs(siCut).Enabled = True
  5455. ConsoleVerbs(siCopy).Enabled = True
  5456. ConsoleVerbs(siDelete).Enabled = True
  5457. End If
  5458. End Select
  5459. ' Gather data for the status bar string. Count the selected objects, get the disk
  5460. ' free space, and add up the size of any selected files.
  5461. TotalSelectedFileSize = 0
  5462. If Selection.ListItems.Count > 0 Then
  5463. For Each ListItem In Selection.ListItems
  5464. Set File = ListItem.Tag
  5465. TotalSelectedFileSize = TotalSelectedFileSize + File.Size
  5466. Next ListItem
  5467. End If
  5468. ' Determine the drive. One of the selected objects will lead us to it
  5469. Set Drive = Nothing
  5470. If Selection.ListItems.Count > 0 Then
  5471. Set File = Selection.ListItems(1).Tag
  5472. Set Drive = File.Drive
  5473. ElseIf Selection.ScopeItems.Count > 0 Then
  5474. For Each ScopeItem In Selection.ScopeItems
  5475. If Drive Is Nothing Then
  5476. If TypeOf ScopeItem.Tag Is Scripting.Folder Then
  5477. Set Folder = ScopeItem.Tag
  5478. Set Drive = Folder.Drive
  5479. ElseIf TypeOf ScopeItem.Tag Is Scripting.Drive Then
  5480. Set Drive = ScopeItem.Tag
  5481. End If
  5482. Else
  5483. Exit For
  5484. End If
  5485. Next ScopeItem
  5486. End If
  5487. ' Put together the status bar string
  5488. szDisplayText = CStr(Selection.ListItems.Count + Selection.ScopeItems.Count) & " Object(s) selected" & Chr$(9)
  5489. szDisplayText = szDisplayText & FormatByteCount(TotalSelectedFileSize)
  5490. If Not Drive Is Nothing Then
  5491. If Drive.IsReady Then
  5492. szDisplayText = szDisplayText & Chr$(9) & "(Disk free space: " & FormatByteCount(Drive.AvailableSpace) & ")"
  5493. End If
  5494. End If
  5495. ' Disable for now due to MMC bug
  5496. View.SetStatusBarText szDisplayText
  5497. Exit Sub
  5498. ' Error Handler for this method
  5499. ErrTrap_Views_Select:
  5500. DisplayError "Views_Select"
  5501. End Sub
  5502. ' =============================================================================
  5503. ' Method: Views_SetControlbar
  5504. ' Type: Event
  5505. ' Description: Fired before a view is displayed. It allows a snap-in to
  5506. ' add or remove its toolbars and menu buttons.
  5507. ' Parameters: View A reference to the current view object (as
  5508. ' represented by the MDI Child window containing
  5509. ' the snap-in)
  5510. ' Controlbar A reference to the controlling object that
  5511. ' manages the snap-in's toolbars and menu buttons
  5512. ' Output: None
  5513. ' Notes: While toolbars and menu buttons are added or removed through
  5514. ' this event, the application always has access to the Toolbar
  5515. ' object. Enabling/disabling or hiding/showing of individual
  5516. ' buttons or button menus can be done at any time.
  5517. ' =============================================================================
  5518. '
  5519. Private Sub Views_SetControlbar(ByVal View As SnapInLib.IView, _
  5520. ByVal Controlbar As SnapInLib.IMMCControlbar)
  5521. On Error GoTo ErrTrap_Views_SetControlbar
  5522. ' Attach the one toolbar we have in this snap-in
  5523. Controlbar.Attach tbrFileMgr
  5524. ' Attach the one menu button we have in this snap-in
  5525. Controlbar.Attach tbrMenuButton
  5526. Exit Sub
  5527. ' Error Handler for this method
  5528. ErrTrap_Views_SetControlbar:
  5529. DisplayError "Views_SetControlbar"
  5530. End Sub
  5531. ' =============================================================================
  5532. ' Method: Views_UpdateControlbar
  5533. ' Type: Event
  5534. ' Description: Called following a selection change to allow the snap-in to
  5535. ' update its toolbar(s) and menu buttons according to the
  5536. ' selected item(s).
  5537. ' Parameters: View A reference to the specific View object
  5538. ' in which the selection has changed.
  5539. ' Selection An MMCClipboard object that contains
  5540. ' the current selection
  5541. ' Selected A boolean showing whether the items are
  5542. ' being selected or de-selected
  5543. ' Controlbar A reference to the controlling object that
  5544. ' manages the snap-in's toolbars and menu buttons
  5545. ' Output: None
  5546. ' Notes: Examine the selection and determine which toolbar buttons to
  5547. ' enable. Always enable the menu button. If the user clicks
  5548. ' the menu button we will enable/disable the individual menu
  5549. ' items according to the selection. (See
  5550. ' tbrMenuButton_ButtonDropDown above).
  5551. ' =============================================================================
  5552. '
  5553. Private Sub Views_UpdateControlbar(ByVal View As SnapInLib.IView, _
  5554. ByVal Selection As SnapInLib.IMMCClipboard, _
  5555. ByVal Selected As Boolean, _
  5556. ByVal Controlbar As SnapInLib.IMMCControlbar)
  5557. On Error GoTo ErrTrap_Views_UpdateControlbar
  5558. Dim Button As MMCButton
  5559. Dim SelectionType As SnapInSelectionTypeConstants
  5560. SelectionType = Selection.SelectionType
  5561. ' First disable everything. Then enable as needed
  5562. For Each Button In tbrFileMgr.Buttons
  5563. Button.Enabled = False
  5564. Next Button
  5565. ' If we are deselecting then don't enable anything
  5566. If Selected = False Then
  5567. Exit Sub
  5568. End If
  5569. ' For files enable Run and Run As.
  5570. ' For a single scope item, if it is a folder or a drive, then enable Add
  5571. With tbrFileMgr
  5572. If (SelectionType = siSingleListItem) Or _
  5573. (SelectionType = siMultiListItems) Then
  5574. .Buttons(KEY_RUN).Enabled = True
  5575. .Buttons(KEY_RUNAS).Enabled = True
  5576. ElseIf SelectionType = siSingleScopeItem Then
  5577. If (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Folder) Or _
  5578. (TypeOf Selection.ScopeItems(1).Tag Is Scripting.Drive) Then
  5579. .Buttons(KEY_ADD).Enabled = True
  5580. End If
  5581. End If
  5582. End With
  5583. ' Always enable our menu button. If the user clicks it then in the
  5584. ' tbrMenuButton_ButtonDropDown event we will enable/disable individual items
  5585. tbrMenuButton.Buttons(1).Enabled = True
  5586. Exit Sub
  5587. ' Error Handler for this method
  5588. ErrTrap_Views_UpdateControlbar:
  5589. DisplayError "Views_UpdateControlbar"
  5590. End Sub