Search code examples
windows-7windows-desktop-gadgets

How to get started with Windows 7 gadgets


I have never programmed a gadget for Vista or Seven, but I would like to try to make one. But where do I start? I have tried to search around on google and msdn, but I haven't managed to find anything useful. Either very, very old stuff (Vista beta stuff), already made gadgets or differences between gadgets in Vista and Seven. But that doesn't help me, since I don't have a clue how to make a gadget in the first place... I haven't even managed to find out what they are written in...

So, could anyone help me out with a kick start?

  • Where do I start?
  • What do I need to know?
  • What are they written in?
  • How are they "packaged"?

In other words, how do I get from a clean install of Windows 7 with Visual Studio to a working Gadget that I can install and put on my Windows 7 desktop.


Solution

  • Here's an MSDN article on Vista Gadgets. Some preliminary documentation on 7 gadgets, and changes. I think the only major changes are that Gadgets don't reside in the Sidebar anymore, and as such "dock/undock events" are now backwards-compatibility cludges that really shouldn't be used.

    Best way to get started is probably to just tweak an existing gadget. There's an example gadget in the above link, or you could pick a different one out on your own.

    Gadgets are written in HTML, CSS, and some IE scripting language (generally Javascript, but I believe VBScript also works). For really fancy things you might need to create an ActiveX object, so C#/C++ for COM could be useful to know.

    Gadgets are packaged as ".gadget" files, which are just renamed Zip archives that contain a gadget manifest (gadget.xml) in their top level.