Yes it is true. You can build your own gadgets for Windows Vista and can have them displayed in the Sidebar, all you need is a little knowledge of HTML and XML and that would be all.

In simple terms a gadget is a HTML or XML file is displayed in the sidebar and is intended to display you some information from your computer or from the internet. In this article we will let you know how to create your own gadget.

A gadget consists of a main XML file which has all the important information about the gadget and has link to the HTML file which works on it. The XML file contains information like the gadget name, author name, Website URL, Description, Icon Source information, Link to the HTML file etc. To have a look to any existing gadget’s XML file just rename the extension of the gadget to .zip and unzip its contents. You will then be able to see the XML files and the main HTML file. This can be used as the base for your Gadget.

The main HTML file is nothing, but a webpage not wider than 130 pixels. You can create this web page using any editor or by self coding the HTML. As we know that HTML provides a static web page and there is not much which you can do into it. but if you use JavaScript in your HTML file you can create smart and dynamic gadgets. Using JavaScript is done in the same old fashion by using the Script tag of HTML. Gadgets have a predefined width of 130 pixels when displayed in the sidebar but this can go upto 400 pixels if we drag the gadget out of the sidebar and put it on the desktop. Once the gadget is undocked from the Sidebar its size can be increased and this space can be used for displaying extra contents on it. The current state of gadget if docked or undocked can be queried by System.Gadget.docked property. If it returns false then gadget is undocked else it is docked and your code can thus run basis this value.

You would have noticed that almost all the gadgets come with an options box. We can set and save various settings provided in the options box. These settings are used or changed by the System.Gadget.Settings.write and .read properties. We can use Visual Studio for writing and debugging our JavaScript as it makes it really easy to understand. Once you are done with the creation and testing of your gadget you can create a distribution package for it so that you can send it to others. Creating a gadgets distribution file is very simple and can be done from Windows Explorer itself. put all the necessary files of your gadget in one single folder and zip it using WinZip or any other Zipping tool. If you do not have a zipping tool then you can compress the entire folder as a cabinet file (.cab) which is Windows compression type. Once you have the zip or cab file you just have to rename the extension to .gadget and that would create a single file which can be used or sent to others. Windows Vista will recognise the .gadget file as a gadget and will open it in the sidebar when selected.