Sidebar gadget development tutorial (1)

Source: Internet
Author: User

Reprinted from: http://blog.joycode.com/joy/archive/2006/10/24/85611.aspx

After translating two sidebar gadget articles, I decided to write a tutorial myself and share my experience with the masses who are preparing to devote themselves to sidebar gadget development. It also serves as a summary of your own learning about the development of gadget, so that you can learn more deeply. You are welcome to criticize this series of articles. This section describes some basic knowledge.

About sidebar

Sidebar is a display subsystem exclusive to Windows Vista (sidebar was also developed for Windows XP and Windows Server 2003, but this project has been canceled). It is called a "sidebar" in a Chinese system ". For the program running, we can find [systeminstalleddriver:]/program files/Windows Sidebar in the following directory. The structure of this folder is shown in the right figure. The specific functions of each folder and file are as follows:

  • Sidebar.exe: this file is the main execution file of sidebar.exe. If you do not open the sidebar in Windows Vista, you can directly execute this file to open it.
  • Sbdrop. dll: Support files for sidebar drag and drop;
  • Settings. ini: sidebar setting file, which can be set to enable features such as gadget by default.
  • Wlstrvc. dll: activexcontrol on which Weather Gadget (a weather-display tool) depends. The ActiveX Control on which the gadget that displays RSS information depends is in the msfeeds. dll file under the System32 directory;
  • En-US: resource files related to English;
  • En-CN: resource files related to simplified Chinese;
  • Gadgets Folder: this folder contains multiple sub-folders. Each sub-folder is decompressed by the default built-in gadgets in Windows Vista.
  • Shared gadget: the gadget stored in this folder can be used by multiple users on the same machine.

You can find the self-installed gadget in [systeminstalleddriver:]/users/[user name]/appdata/local/Microsoft/Windows Sidebar/gadgets.

About gadget

In Chinese systems, gadget is translated as "gadgets". Microsoft's gadget is basically divided into three types: Live gadget, sidebar gadget, and slideshow gadget:

  • Live gadget: If you visit the http://www.live.com, you will find that its page can be customized, And the custom small page module, we call it live gadget;
  • Slideshow gadget: Windows Vista supports the future of notebook computers in addition to the main display, there can also be an external small display, similar to the dual-screen mobile phone external display, without the computer power, obtain the desired information from the extended display, and the module implementing this function is called slideshow gadget;
  • Sidebar gadget: the gadget mentioned in this tutorial depends on the gadget executed by Windows Sidebar.

In addition, the current development environment, execution environment, and development methods of these three types of gadget are not uniform and cannot be used uniformly. As for future planning, we are not very happy. If you have any knowledge, you can disclose it here.

In fact, the gadget itself is very simple, if interested, can access the http://go.microsoft.com/fwlink? Linkid = 55696, and a sidebar gadget is downloaded at will. Save it to the desktop, such as the calculator gadget (calculator ). Its suffix is. Gadget. Now we change the suffix to .zip. on Windows XP, you can double-click it to view its directory structure.

That is to say, the gadget itself contains a bunch of HTML, JavaScript, CSS, and image files. The compression format can be ZIP or cab. You can use the cab format for digital signature. For more information, see my previous translation. Use the gadget. xml file in this gadget to describe the general information of this gadget, such as name, author, version, whether there is a set file, icon, and so on. This file can be stored in the root directory or in different language folders, such as en-US or ZH-CN.

Most of the system's built-in gadget uses some specially developed ActiveX controls. We develop our own Gadget if you want to use Microsoft Gadget Gallery (that is, http://go.microsoft.com/fwlink? Linkid = 55696) method or the extension named. Gadget Method for distribution, you can only call the existing ActiveX control in the system, instead of creating your own ActiveX control. If you want to create an executable installation package, you can do whatever you want (rogue software ??? Haha ).

Javascript can call many ActiveX controls, such as using scripting. FileSystemObject to access the file system, using Microsoft. xmldom to analyze XML files, and using Microsoft. XMLHTTP to call Web Services. Therefore, Gadget can do many things.

So what can we do? This depends on the spark of our mind.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.