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.

68 lines
2.2 KiB

  1. <PUBLIC:COMPONENT tagName="devcls" XMLNS:devcls>
  2. <?IMPORT namespace="devcls" implementation="dev.htc">
  3. <PUBLIC:PROPERTY NAME="Expand" />
  4. <PUBLIC:PROPERTY NAME="Guid" />
  5. <PUBLIC:DEFAULTS viewLinkContent />
  6. <PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="Init()" />
  7. <SCRIPT LANGUAGE="VBScript">
  8. Dim normalColor
  9. Dim devcon
  10. Dim cls
  11. Sub Hilite()
  12. normalColor = devcls_title.runtimeStyle.color
  13. devcls_title.runtimeStyle.color = "blue"
  14. End Sub
  15. Sub Restore()
  16. devcls_title.runtimeStyle.color = normalColor
  17. End Sub
  18. Sub Init()
  19. Expand = false
  20. set fpClick = getRef("Click")
  21. set fpHilite = getRef("Hilite")
  22. set fpRestore = getRef("Restore")
  23. set DevCon = CreateObject("DevCon.DeviceConsole")
  24. set Cls = DevCon.SetupClasses(Guid)(1)
  25. devcls_bound.attachEvent "onclick", fpClick
  26. devcls_bound.attachEvent "onmouseover", fpHilite
  27. devcls_bound.attachEvent "onmouseout", fpRestore
  28. devcls_title.innerHtml=element.innerHtml
  29. devcls_icon.ObtainIcon Cls
  30. End Sub
  31. Function GenDevList
  32. Set devs = Cls.Devices
  33. If devs.Count Then
  34. lst = "<br>"
  35. For Each dev In devs
  36. lst = lst & "<devcls:dev Instance=""" & dev.InstanceId & """>" & dev.Description & "</devcls:dev><br>"
  37. Next
  38. lst = lst & ""
  39. Else
  40. lst = "<br><img align = ""absmiddle"" src=""arrow_none.gif""><img align = ""absmiddle"" src=""arrow_none.gif""><i>No devices</i><br>"
  41. End If
  42. GenDevList = lst
  43. End Function
  44. Sub Click()
  45. Expand = Not Expand
  46. If Expand Then
  47. devcls_info.innerHtml = GenDevList
  48. devcls_info.style.display = ""
  49. devcls_arrow.src = "arrow_down.gif"
  50. Else
  51. devcls_info.style.display = "none"
  52. devcls_arrow.src = "arrow_right.gif"
  53. End If
  54. End Sub
  55. </SCRIPT>
  56. <BODY>
  57. <SPAN id="devcls_bound">
  58. <IMG id="devcls_arrow" align = "absmiddle" src="arrow_right.gif" width="25" height="15" />
  59. <object classid="clsid:514C3095-47E8-4B24-B831-FB1C22C1B1B6" id="devcls_icon" width="16" height="16">
  60. </object>&nbsp;
  61. <SPAN id="devcls_title"></SPAN>
  62. </SPAN>
  63. <SPAN id="devcls_info"></SPAN>
  64. </BODY></PUBLIC:COMPONENT>