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
101 lines
3.1 KiB
<HTML>
|
|
|
|
<OBJECT ID="MMCCtrl" CLASSID="CLSID:545AE700-50BF-11D1-9FE9-00600832DB4A">
|
|
</OBJECT>
|
|
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
function myClick(szClsid, arg, param)
|
|
{
|
|
MMCCtrl.TaskNotify (szClsid, arg, param);
|
|
}
|
|
function myLoad()
|
|
{// enumerate through all the tasks who want to add to the default taskpad
|
|
|
|
var hash = location.hash;
|
|
if (hash != "")
|
|
hash = hash.substr(1);
|
|
|
|
// get banner and use it
|
|
var banner = MMCCtrl.GetBanner (hash);
|
|
if(banner == "")
|
|
banner = "img\\ntbanner.gif";
|
|
document.body.insertAdjacentHTML ("BeforeEnd", "<IMG SRC=" + banner + ">");
|
|
|
|
// new cic method
|
|
var button = MMCCtrl.GetListPadInfo ("ListPad");
|
|
if (button) {
|
|
|
|
var strButton = "<P>" + button.Title +" "; // + "<P>";
|
|
if (button.HasButton == true) {
|
|
strButton += "<input type=button style=\"background-color:lightBlue;font-family:arial\"";
|
|
strButton += " value=\"" + button.Text + "\"";
|
|
strButton += " onclick=\"myClick('" + button.Clsid + "', " + button.NotifyID +", '" + "0" + "')\"";
|
|
strButton += ">";
|
|
}
|
|
alert (strButton);
|
|
document.body.insertAdjacentHTML ("BeforeEnd", strButton);
|
|
|
|
var strLV = "<OBJECT ID=\"ListView\" CLASSID=\"clsid:289228DE-A31E-11D1-A19C-0000F875B132\"></OBJECT>";
|
|
document.body.insertAdjacentHTML ("BeforeEnd", strLV);
|
|
ListView.width = 200;
|
|
ListView.height = 100;
|
|
}
|
|
|
|
// get title and ignore it for now
|
|
var title = MMCCtrl.GetTitle (hash);
|
|
|
|
var task = MMCCtrl.GetFirstTask (hash);
|
|
while (task != null) {
|
|
|
|
var image = task.Image;
|
|
var text = task.Text;
|
|
var help = task.Help;
|
|
var type = task.ActionType;
|
|
var clsid = task.Clsid;
|
|
|
|
var str = "";
|
|
|
|
// 3 possibilities for action: "ID:", "LINK:" and "SCRIPT:"
|
|
// default is "ID:", I guess
|
|
switch (type) {
|
|
case 0: //task.MMC_TASK_ACTION_ID:
|
|
str += "<P ALIGN=center>";
|
|
str += "<IMG SRC=" + image;
|
|
str += " onclick=\"myClick('" + clsid + "', " + task.CommandID +", '" + "0" + "')\">";
|
|
str += text + "</P>";
|
|
break;
|
|
|
|
case 1: //task.MMC_TASK_ACTION_LINK:
|
|
str = "<P ALIGN=center>";
|
|
str += "<A HREF=" + task.ActionURL + ">";
|
|
str += "<IMG SRC=" + image + ">";
|
|
str += text + "</A>";
|
|
break;
|
|
|
|
case 2: //task.MMC_TASK_ACTION_SCRIPT:
|
|
str += "<P ALIGN=center>";
|
|
str += "<IMG SRC=" + image;
|
|
str += " LANGUAGE=" + task.ScriptLanguage;
|
|
str += " onclick=\"" + task.Script;
|
|
str += "\">";
|
|
str += text + "</P>";
|
|
break;
|
|
|
|
default:
|
|
alert ("unrecognized task");
|
|
break;
|
|
}
|
|
document.body.insertAdjacentHTML ("BeforeEnd", str);
|
|
|
|
task = MMCCtrl.GetNextTask();
|
|
}
|
|
}
|
|
window.onload = myLoad;
|
|
</SCRIPT>
|
|
|
|
<HEAD>
|
|
<TITLE>TaskPad ListView Test</TITLE>
|
|
</HEAD>
|
|
<BODY BGCOLOR="white" TOPMARGIN=0 LEFTMARGIN=0>
|
|
</BODY>
|
|
</HTML>
|