views:

140

answers:

2

Is is possible to install gadget to user's desktop somehow?

I believe its needed to copy files to folder: C:\Users\curusername\AppData\Local\Microsoft\Windows Sidebar\Gadgets\test.gadget

but how to register/activate my test.gadget?

Is it enough to shell execute test.gadget?

+1  A: 

The following MSDN Article covers this:

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

Robert Love
+1  A: 

Late answer, I know, but the other answer is talking about Windows Sideshow Gadgets, and your question is related to Windows Desktop Gadgets. Rather than Shell Executing the .gadget package, which would prompt the user, on Windows 7 you can use the IDesktopGadget interface in the Windows APIs.

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.

Andy E