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.

101 lines
3.1 KiB

  1. <HTML>
  2. <OBJECT ID="MMCCtrl" CLASSID="CLSID:545AE700-50BF-11D1-9FE9-00600832DB4A">
  3. </OBJECT>
  4. <SCRIPT LANGUAGE="JavaScript">
  5. function myClick(szClsid, arg, param)
  6. {
  7. MMCCtrl.TaskNotify (szClsid, arg, param);
  8. }
  9. function myLoad()
  10. {// enumerate through all the tasks who want to add to the default taskpad
  11. var hash = location.hash;
  12. if (hash != "")
  13. hash = hash.substr(1);
  14. // get banner and use it
  15. var banner = MMCCtrl.GetBanner (hash);
  16. if(banner == "")
  17. banner = "img\\ntbanner.gif";
  18. document.body.insertAdjacentHTML ("BeforeEnd", "<IMG SRC=" + banner + ">");
  19. // new cic method
  20. var button = MMCCtrl.GetListPadInfo ("ListPad");
  21. if (button) {
  22. var strButton = "<P>" + button.Title +" "; // + "<P>";
  23. if (button.HasButton == true) {
  24. strButton += "<input type=button style=\"background-color:lightBlue;font-family:arial\"";
  25. strButton += " value=\"" + button.Text + "\"";
  26. strButton += " onclick=\"myClick('" + button.Clsid + "', " + button.NotifyID +", '" + "0" + "')\"";
  27. strButton += ">";
  28. }
  29. alert (strButton);
  30. document.body.insertAdjacentHTML ("BeforeEnd", strButton);
  31. var strLV = "<OBJECT ID=\"ListView\" CLASSID=\"clsid:289228DE-A31E-11D1-A19C-0000F875B132\"></OBJECT>";
  32. document.body.insertAdjacentHTML ("BeforeEnd", strLV);
  33. ListView.width = 200;
  34. ListView.height = 100;
  35. }
  36. // get title and ignore it for now
  37. var title = MMCCtrl.GetTitle (hash);
  38. var task = MMCCtrl.GetFirstTask (hash);
  39. while (task != null) {
  40. var image = task.Image;
  41. var text = task.Text;
  42. var help = task.Help;
  43. var type = task.ActionType;
  44. var clsid = task.Clsid;
  45. var str = "";
  46. // 3 possibilities for action: "ID:", "LINK:" and "SCRIPT:"
  47. // default is "ID:", I guess
  48. switch (type) {
  49. case 0: //task.MMC_TASK_ACTION_ID:
  50. str += "<P ALIGN=center>";
  51. str += "<IMG SRC=" + image;
  52. str += " onclick=\"myClick('" + clsid + "', " + task.CommandID +", '" + "0" + "')\">";
  53. str += text + "</P>";
  54. break;
  55. case 1: //task.MMC_TASK_ACTION_LINK:
  56. str = "<P ALIGN=center>";
  57. str += "<A HREF=" + task.ActionURL + ">";
  58. str += "<IMG SRC=" + image + ">";
  59. str += text + "</A>";
  60. break;
  61. case 2: //task.MMC_TASK_ACTION_SCRIPT:
  62. str += "<P ALIGN=center>";
  63. str += "<IMG SRC=" + image;
  64. str += " LANGUAGE=" + task.ScriptLanguage;
  65. str += " onclick=\"" + task.Script;
  66. str += "\">";
  67. str += text + "</P>";
  68. break;
  69. default:
  70. alert ("unrecognized task");
  71. break;
  72. }
  73. document.body.insertAdjacentHTML ("BeforeEnd", str);
  74. task = MMCCtrl.GetNextTask();
  75. }
  76. }
  77. window.onload = myLoad;
  78. </SCRIPT>
  79. <HEAD>
  80. <TITLE>TaskPad ListView Test</TITLE>
  81. </HEAD>
  82. <BODY BGCOLOR="white" TOPMARGIN=0 LEFTMARGIN=0>
  83. </BODY>
  84. </HTML>