I was asked to create a quick POC (proof of concept) for a MS Windows Vista sidebar gadget. I did the usual Live.com search and discovered a few posts.
An interesting post was by a guy called Daniel Moth. It had lots of useful information, but unfortunately it just didn’t work for me. There seems to be something missing in the xml file accompanying the gadget, as well as some rubbish text in the file, so your gadget won’t work but you won’t get an error.
I found a more uptodate sample on MSDN. This was also on Daniel Moth’s blog, so many thanks to him.
Now here is my version of the hello world sidebar gadget.
Step 1:
Create the following HTML file:
<html>
<head>
<title>Hello, World!</title>
<style>
body {
width:130;
height:50;
}
</style>
</head>
<body>
<span id=”gadgetContent” style=”font-family: Tahoma; font-size: 10pt;”>Hello, World!</span>
</body>
</html>
Call it HelloWorld.html
Step 2:
Create the following XML file:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<gadget>
<name>Hello World!</name>
<namespace>Example.You</namespace>
<version>1.0</version>
<author name=”Your Name”>
<info url=”www.example.com” />
</author>
<copyright>2006</copyright>
<description>My first gadget</description>
<hosts>
<host name=”sidebar”>
<base type=”HTML” apiVersion=”1.0.0″ src=”HelloWorld.html” mce_src=”HelloWorld.html” />
<permissions>full</permissions>
<platform minPlatformVersion=”0.3″ />
</host>
</hosts>
</gadget>
Call this file Gadget.xml
Step 3:
Create a folder called Helloworld.Gadget
Step 4:
1.Simply copy”%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets” and paste in Windows explorer address bar.
2. When you get to that folder Copy and Paste the “HelloWorld.Gadget” folder there.
Step 5:
Add the gadget to your Sidebar and your done !
That’s how easy it was to create a sidebar gadget. Obviously, you want your gadget to do more than just display “HelloWorld”. You have infinite possibilities. Anything that con be done with DHTML or .NET can be done on a sidebar, you just have to make sure you have the right permissions.
How do I create a gadget with .NET?
If you check out the MSDN link you should find it there, and if I get something done soon, I’ll surely post it.
Also check out the Gadget team blog.
Anyway, that’s it for now, Happy developing!