The Countdown gadget on the Vista deskop counts down to events
R E L A T E D   C O N T E N T
ADVERTISEMENT

Grappling with gadgets

Discover how to create a Windows gadget and some new uses for C++ on the web

Tim Anderson, Personal Computer World 09 Jun 2009
ADVERTISEMENT

Windows Vista supports gadgets; mini-applications you can display on the sidebar or drag to the desktop. Gadgets will also work in Windows 7, now in beta.

They are somewhat improved because they live directly on the desktop and can be displayed at any time using a new desktop peek feature: hover the mouse over the ‘show desktop’ icon at the right end of the Taskbar and application windows become temporarily transparent, letting you inspect any desktop gadgets.

Create a Windows gadget
Gadgets are easy to code and make a fun project. Here is an example called Countdown.The Countdown gadget is great if you have an important event or celebration to look forward to. It counts down the remaining days and alerts you when the moment arrives.

Windows gadgets are HTML applications that consist of two or more files in a folder. In order to be recognised, the folder has to be in a special location. There is a per-machine location and a per-user location, with the latter being the most convenient for development.

Create a folder called countdown.gadget in: ‘%USERPROFILE%\AppData\Local\Microsoft\Windows Sidebar\Gadgets’ where ‘%USERPROFILE%’ is usually ‘c:\users\username’.

You can create a desktop shortcut to this folder.

The most basic gadget is just two files: a manifest and an HTML page. The manifest is a short snippet of XML, which includes the name of the HTML page; the HTML page is the user interface of the gadget itself.

This is rendered by Internet Explorer 7, so there are few limitations on what you can include, though you need a small page size. One interesting possibility is to host Silverlight, though early adopters have found that some workarounds are needed.

A gadget does have access to the local file system and is similar in many respects to a Windows HTML Application (HTA).

The body of the Countdown gadget looks like this:
<body onload=”init()”>
<g:background id=”background” src=”transparent.png” style=”position: absolute;
top: 0; left: 0; z-index: -999; no=repeat;” />
<div id=”frame”>
<div id=”countdown”>
123 days</div>
<div id=”towhat”>
until what</div>
</div>
</body>


All Software Applications
Tags: Windows-gadgets

Like this story? Spread the news by clicking below:

Post this to Delicious del.icio.us    Post this to Digg Digg this    Post this to reddit reddit!

Permalink for this story
R E A D E R   C O M M E N T S
M A R K E T P L A C E
Get your free demo of Numara Track-It! 8 - the leading help desk solution for IT related issues.
Make presentations, review documents & share your entire desktop. 30-day free trial! (cc required).
Discover how remote support can fuel your IT business in ways you've never thought of before.
Apply ITIL best practices at your service desk while eliminating integration cost. Learn more here.
WAN based, automated, daily vulnerability assessments. Click here to try and request our whitepapers.
Have your product or service listed here >   
Sponsored links
F E A T U R E D   J O B S
| Randstad Technologies
Project Manager required to join fast-growing IT software house in the Bristol area. We are looking for candidates with strong Project Management skills looking to better their skills with a market-leader offering long-term progression. The ... more >
| Computer People
My client is looking for an ETL Developer to identify, prioritise and develop new ETL packages and maintaining existing packages. Delivering, maintaining and testing ETL solutions. Investigating new technology platforms and technologies. Documentation of ETL ... more >
| Computer People
Computer People are currently recruiting for a large and rapidly expanding IT Services company that are looking to add to it’s talented ITIL Change Management function within their Central Service Center based in Milton Keynes. ... more >
| Computer People
Web amp; SQL, Crystal Reports, .NET (C# amp; reputation in the Market. They seek a creative Developer with PHP experience to join their team. We are looking for someone who has a strong understanding of ... more >
More job opportunities