Question

Is is possible to install a gadget to a user's desktop somehow? I believe I need to copy all the files to a the user's gadget folder, e.g.

C:\Users\curusername\AppData\Local\Microsoft\Windows Sidebar\Gadgets\test.gadget

But copying the files here doesn't run the gadget. How can I register/activate it?

Is it enough to shell execute test.gadget?

Was it helpful?

Solution

The following MSDN Article covers this:

http://msdn.microsoft.com/en-us/library/cc982277(VS.85).aspx

OTHER TIPS

Late answer, I know, but the other answer is talking about Windows Sideshow Gadgets, and your question is related to Windows Desktop Gadgets.

It's possible to run the gadget on Windows 7 without shell executing the archive, you need to use the IDesktopGadget interface method RunGadget. Call RunGadget on a folder containing your gadget's files and it will appear on the user's desktop.

A description of the RunGadget method and sample code for C++ is offered here:

http://msdn.microsoft.com/en-us/library/dd378390(VS.85).aspx

If you're using .NET, refer to a previous question I asked for how to implement the IDesktopGadget interface:

Stack Overflow - C#: Referencing a windows shell interface

For backwards compatibility (Vista), I would recommend you fall back to the shell execute method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top