Getting Started with Windows Desktop sidebar gadget development

Source: Internet
Author: User

Prepared for the site to do a desktop notification function tool, now online is generally html5+js more. Although Html5+js is now the mainstream of web development, our application is generally a Windows system. And should be in use, need to open Google or other browser, this is very troublesome.

In Baidu found a Windows Desktoptools to look very useful, used to analyze a bit. Download http://www.uzzf.com/soft/53006.html a gadget on the web. Follow http://blog.csdn.net/mrxyz098/article/details/27982991 's instructions.

Extracted A. gadget file with WinRAR. The inner surface is stored in HTML, XML,JS files. Now refer to the link above for an analysis.

. xml file for storing the basic settings of the gadget, including the name, version, and so on. Here is an example of a typical Gadget.xml file:

<?xml version= "1.0" encoding= "Utf-8"?> <gadget> <!--gadget name--<name>test</name> <!--gadget namespace-<namespace><!--_loccomment_text= "{Locked}"-->yourname.test</namespace> &L t;!    --Gadget version number--<version><!--_loccomment_text= "{Locked}"-->1.0.0.0</version> <!--author name-- <author name= "" > <!--author more information, linking and displaying content-<info url= "http://www.msphome.cn" target= "_blank" >ht    tp://www.msphome.cn </info> <!--gadgets logo--> <logo src= "logo.png"/> </author> <!--gadget Copyright--<copyright><!--_loccomment_text= "{Locked}"--&GT;? 2009</copyright> <!--gadgets--about <description> introduction.      </description> <icons> <!--gadget icons--<icon height= "width=" src= "Icon.png"/>        </icons> 

After the above setup, the system will be able to identify our own gadgets. The next step is to write this gadget. First, let's get to the next Yourname.gadget file in this folder. In addition to the above Gadget.xml file, we also need to store the above defined logo.png,icon.png,drag.png, these picture files. If you need multi-lingual support, please create a language folder, which can be used to refer to Microsoft's gadget in the Tools directory.
Next, we need to know the programming interface of Gadget. In the MSDN reference, we learned that in the widget HTML file contained in JS, we can use the System.gadget object, this object includes the event, method, properties, please refer to
In addition, there are some objects in gadget that are also available, which may be very useful to us. For more information, please see the above blog post (content is in English)
In the actual operation also found an interesting thing, is gadget inside the JS script has higher permissions, you can use some in the browser is disabled COM components, such as ADODB, FSO and so on, and the inside of the XMLHTTP component read can cross-domain, hehe. In this way we can easily make our program stronger.
Want to add a settings page to your gadget? Yes, as long as the public execution of JS inside add a sentence

System.Gadget.settingsUI = "settings.html";  

You can do it.
When we're done with the development, we need to package the gadget for release. The Standard gadget installation package is a ZIP or cab compressed package with the extension gadget. So we just need to pack all the files in the development folder and compress them. We can use WinRAR to make a zip package, and then change the extension to gadget, so the gadget package is complete.

Getting Started with Windows Desktop sidebar gadget development

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.