Internals on Windows Sidebar and Gadgets

This information is available on different sites on the the internet and I have summarized them here for my reference.

In Windows Vista, Gadgets are HTML based application hosted by the Windows Sidebar,a window application(%ProgramFiles%\Windows Sidebar\sidebar.exe). There are two instances of this process  launched for the purpose of isolating hosting of the preinstalled gadgets (clock, weather, calendar, stocks, and so on) on one and hosting  all user-created gadgets on the other.  To host a gadget, the sidebar makes use of the ActiveX Component MSHTML.DLL. MSHTML.DLL control allows you to host an Internet Explorer instance and have a very fine control on various aspects of the browser behavior and appearance. Effectively the Sidebar creates one instance of the ActiveX control for each gadget

Note that embedded ActiveX controls are restricted by the Vista User Access Control (UAC) and  the Sidebar never displays the UAC elevation prompt. Gadgets could access data from multiple domains and multiple servers without restriction. To add more functionality to a gadget, you can write your own custom ActiveX objects/components and use ActiveX from gadget application, you need to register custom objects and it would be better to have  MSI installer that installs ActiveX and the gadget( you need elevated permissions). You can call restricted set of system functions from the gadget and you can invoke web services using java script

  • all Gadget settings are stored in a unique INI file named %USERPROFILE%\AppData\Local\Micros oft\Windows Sidebar\Settings.ini. Each Gadget instance had its own section in this file
  • Location of user specific gadgets %LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets.
  • Standard gadgets are stored at %ProgramFiles%\Windows Sidebar\Gadgets
  • Gadgets that are available to all users of the machine are stored at %ProgramFiles%\Windows Sidebar\Shared Gadgets

In Windows 7,gadgets are now hosted and displayed on the Windows 7 desktop. Please note that all gadgets are still owned by the sidebar.exe process. In Windows 7, only one instance of the sidebar.exe process starts. This single instance does not start until a gadget is added to the desktop, the Gadget Picker starts, or a new user session starts with existing gadgets on the desktop. You might choose to support docking methods for backward compatibility.

Some links that helped us in our gadget development are as follows. Thanks to the authors and the community.