views:

90

answers:

1
+1  Q: 

Vista Gadgets

I have created a sample gadget (of course using google :D). It shows "Hello World!".
I have created a .gadget file for installation of this gadget.
I have written an application that does ShellExecute to install this gadget.
I can see my hello world gadget.
Fair enough. And good lessons learnt.

Now I would like to write another application that closes this gadget and removes it from the sidebar.
Is there any programmatic way to do this?

+2  A: 

I found a way to do this. It is to emulate user action for closing the gadget. Following is the script.

function StopGadget(GadgetName)
{
var WshShell = new ActiveXObject(\"WScript.Shell\");
WshShell.AppActivate(GadgetName);
WshShell.SendKeys(\"+{F10}C\");
WshShell = null;
}

vrrathod