Home > Store

Creating Vista Gadgets: Using HTML, CSS and JavaScript with Examples in RSS, Ajax, ActiveX (COM) and Silverlight

Register your product to gain access to bonus material or receive a coupon.

Creating Vista Gadgets: Using HTML, CSS and JavaScript with Examples in RSS, Ajax, ActiveX (COM) and Silverlight


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2008
  • Dimensions: 7" x 9-1/8"
  • Pages: 360
  • Edition: 1st
  • Book
  • ISBN-10: 0-672-32968-9
  • ISBN-13: 978-0-672-32968-5

A one-stop resource for each aspect of designing and developing Sidebar gadgets, perfect for anyone who wants to create killer gadgets

  • Explores one of the super cool features new to Windows Vista -- the Sidebar
  • It is a one-stop resource for each aspect of designing and developing Sidebar gadgets, perfect for anyone who wants to create killer gadgets
  • Includes complete design instructions for four never-before-seen gadgets

Windows Vista Sidebar is a panel located on the desktop of a PC where gadgets can be placed for easy access and reference. These gadgets are small, single-purpose applications, such as clocks, calendars, games, RSS notifiers, search tools, stock tickers, etc, that reside on the Windows desktop and on the Windows Sidebar. The book will be a tutorial to design and develop a gadget. It will provide ready-to-use samples using .NET, XML, CSS and AJAX. After reading the book, a web developer/designer will be confident enough to start developing gadgets for Windows Vista Sidebar. The beginner portion of the book shows an overview of the subject with the design pattern, the architecture and implementation details. The later sections will have solid examples for instant results. In short, the book will tell how to do everything with Sidebar Gadgets using solid, unique examples. Brief outline: " Brief background on Gadgets " Define architecture, design consideration and implementation to give a clear view to the developer " Step by step, create a useful Gadget sample "My Blogs" " Elaborate the architecture design constraint and implementation details for the sample " Detail the standard practices " Recheck the gadget created for standard practices " Improvise and Improve with compare and contrast " Add advanced samples with .NET, AJAX and XHTML.

Sample Content

Online Sample Chapter

An Approach to Windows Vista Gadget Design

Sample Pages

Download the sample pages

Table of Contents

Introduction 1

What’s in the Book    1

Section 1: The Foundation    1

Section 2: Developing a Gadget     2

Section 3: Advanced Samples    2

Special Features and Notations     2

Supporting Website    3

Part I The Foundation

1 Innovate with Windows Vista Sidebar Gadgets     7

Introducing Gadgets and the Vista Sidebar    7

Windows Sidebar     8

Technology Behind Gadgets     8

Brief History of Gadgets     9

Innovate with Gadgets    10

Types of Gadgets     12

Information Gadgets     12

Application Gadgets    13

Utility Gadgets    14

Fun Gadgets      14

Gadgets in Depth     15

What Gadgets Are Not    15

Different Views–The Three Hats of the Gadget    16

Opacity Level and Always on Top Property     17

Using Flyout for More Information    18

Customization     18

Multiple Platforms for Gadgets    19

Meeting Points for Different Gadgets     20

The Development Platform     21

Gadget Ecosystem     21

Other Desktop Gadget/Widget Platforms    22

Gadget Comparison Chart     26

2 The Architecture     29

Gadgets Overview     29

The Manifest File gadget.xml     31

User Interface and Presentation     32

Cascading Style Sheets     32

Core Functionality of the Gadget: JavaScript      34

Resources, PNG, and Other Files    34

Technology Behind Gadget Development     35

MSHTML Component, the Core of the Gadget    36

Standard Web Technologies     36

Sidebar Gadget as an HTML Application      37

Gadget Object Model    38

ActiveX Technology    38

Gadget Object Model      39

User Interaction and Sidebar Events    40

APIs to Access the File System     42

Core Features to Interact with the System    44

Communication and Other APIs    44

Sidebar Gadgets: The Road Ahead     46

3 An Approach to Design 49

Design Considerations     49

Putting Information First     50

Constructing the Right User Interface     53

Usage Patterns      57

Gadget Behavior     60

Challenges for the User Interface     63

Standard Dimensions     64

Gadget Page When Docked    64

Undocked Gadget     65

Settings Page     65

Flyout Page     65

Other Interface Guidelines     66

Visual Themes      67

Title     67

Icon     67

Drag Image     68

Background Image      68

Controls     69

Text and Style     70

Transparent Images in the Gadget     71

Alpha Transparency      71

Portable Network Graphics File      71

GIF File Limitations    71

About Accessibility    72

Keyboard Access     72

General HTML accessibility     73

Theme Colors and Contrast     73

4 Selling Your Gadget 75

Gadget Revenue Model     75

Pull Model    76

Push Model    78

How Gadgets Give You Business    80

The Ad Gadget.    81

Gadget as a Side Product    82

Utility Gadget    84

Free Information Gadget      85

Supporting Your Gadget      87

Part II Developing a Gadget

5 Creating a Simple Gadget with RSS/Atom Feed     91

Feed Gadgets    91

Brief Background on Feeds    91

About the MyBlog Gadget    92

Basic Framework of the MyBlog Gadget     94

Required Files     94

Directory Structure     95

How the MyBlog Gadget Works     97

The Manifest File     98

Gadget Settings      100

Parts of the MyBlog Gadget    102

The Data    103

Core Functionality of the Gadget     104

Presenting with CSS and DOM    107

Putting It All Together   112

6 Design Patterns and Standard Practices     115

Design Patterns    115

Maintainable      116

Customizable     116

Extensible    117

Elements of Design Patterns    117

Standard Layout for Files and Folders     118

Reusable Functionality     120

Display and Presentation    127

Common Assumptions     130

The Gadget Will Always Work     130

Internet Connection    131

Regular Feed Updates    132

Caching of the Feed Data    133

Memory and Session Management     133

Adding Accessibility     134

Putting the Focus on the Gadget when It Is Loaded     135

Adding Tab Controls     135

The Enter Key Acting Like a Mouse Click     135

Using the onfocus and onfocusout Events for Mouse Hover Effect     137

Making the Gadget’s Flyout and Settings Page Keyboard Accessible    137

7 The MyBlog Gadget Revisited     139

Recapping the MyBlog Gadget    139

Taking the MyBlog Gadget to the Next Level    141

Adding Multiple Feeds    142

Managing Multiple Pages in the Gadget Window    150

Unobtrusive Traversing     152

Docked, Undocked, and Mini Me Version     154

Settings Page Configuration for the Mini Me Version    155

Gadget Window Configuration    156

8 Debugging and Deploying a Gadget     159

Debugging a Gadget    160

Debugging Using WScript and VBScript     161

Debugging Using JavaScript and DOM    166

Debugging Tools    168

Deploying a Gadget     170

Gadget Installation Target    171

Gadget Installation Process     172

Gadget Packaging     172

Deployment Using a Cabinet File      174

CAB File Approach     175

A Windows Installer (.msi File) or setup.exe    180

Comparison of Deployment Methodologies    180

Part III Advanced Samples

9 Site Statistics Gadget with Ajax–An Information Gadget     183

The Goal     183

Background–www.sitemeter.com      184

Site Summary Page     185

Features and Technology    186

Application Programming Interface   187

Loading a Portion of a Web Page with Ajax and DOM    190

Design Considerations    195

Theme and Images of the Gadget     195

Layout of the Gadget    196

Usability of the Gadget     197

Developing the Gadget     198

Integrating the Existing Framework     199

Retrieving Data for Site Summary Using API and Online Web Page     200

Graphs and Pie Charts Based on the API     204

10 Most Recent Used .NET Projects–An Application Gadget     211

Recent .NET Project Gadget    211

Target of the Gadget.      212

Background    212

Features and Technology    213

ActiveX COM Technology     214

Windows Power Shell and Windows Management Instrumentation    216

Design Considerations     219

Theme of the Gadget     219

Layout of the Gadget     220

Usability of the Gadget     221

Developing the Gadget      222

Integrating the Existing Framework     222

Listing MRU Items from the Registry     225

Reading the Registry      234

11 Radio Gadget and YouTube Video Gadget–Fun Gadgets     237

Media Gadgets    237

The Radio Gadget     238

Background–Internet Radio     238

Features and Technology    239

Design Considerations     240

Developing the Gadget.     243

The YouTube Video Gadget     249

Background–YouTube Video Feeds     249

Features and Technology     250

Design Considerations     251

Developing the Gadget    255

12 Silverlight World Clock–Utility Gadget     261

The Silverlight Gadget     261

Background–Microsoft Silverlight    262

Features and Technology    264

JavaScript for Creating the Silverlight Object     265

Microsoft Silverlight    266

Extensible Application Markup Language      267

Design Considerations     268

Theme and Images     268

Layout of the Gadget      269

Usability of the Gadget    270

Developing the Gadget     271

Integrating the Existing Framework    271

The XAML File   272

Silverlight Clock Logic     275

Creating a Sidebar Gadget Using Microsoft Popfly    280

Website Comparison Gadget     280

Creating a Mashup Using Microsoft Popfly    281

Porting a Mashup to Vista Sidebar as a Gadget    283

Where to Go from Here    284

Part IV Appendixes

A Tips and Tricks     289

Automatic Update and User Tracking    289

Checking for a New Version of the Gadget     290

Tracking Your Users    294

Reading XML, XHTML, RSS/Atom, Html, Text and JSON Data     295

The XMLHTTPRequest object    295

Microsoft XML DOM      297

Windows RSS Platform & Microsoft Feed Manager     298

Globalization and Localization     299

Localized Gadget Example    300

Locales with Country Codes     302

Graphic Design   302

Gadget Protocols for Image and Text    302

Sample Gadget g:Demo    304

Creating a Transparent PNG File in Photoshop     307

Creating Outer Edges/Shadow Effects in Photoshop    309

Security and Other Resources    311

Protecting Your Code     312

Gadgets in an Enterprise (Accessing SQL Server)    313

Resources and References    314

B Extras     315

Reusable Framework for Creating Gadgets    315

Sample Gadgets Based on the Framework    317

The Widget-Box Gadget    317

The Comic-Strip Gadget    319

The Trick-of-Mind Gadget    319

Share Your Gadgets    320

Index     321


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020