Create your Own Gadget………..on VISTA

Hey guys Have you ever tried to create your own gadget in your Vista…………..Try this it will be fun and really nice………..You can show your friend as “This is my own gadget”……It’s too simple.

Gadget are nothing moreover than a little but powerful handy tool. you might get surprised when you know how easy they are to create. In fact, if you know HTML, CSS, and JavaScript, you’re well on your way.

 

In short if I have to say what is Gadget, then  simply I say it is made of nothing more than of a HTML and XML defination files. There may be some gadgets which include other files like PNG and JPEG for image and also STYLE SHEETS (CSS), and too some scripting languages.All of these are collected in file and that is just ends with name as *.gadget (ie weather.gadget).

 Now to create the gadget you need two things specially they are

1. A “manifest” file named Gadget.xml. This manifest contains all the settings for your gadget, including the gadget name, author and copyright information, and information about the HTML page that makes up the actual gadget.

2. An HTML file (for example, Test.htm). Although they might not look like it, gadgets are really nothing more than HTML files: you simply create an HTML file, add the appropriate tags and script code, and you’ve got yourself a gadget.

 

You may have a Question how can I have these files but don’t worry abt this coz I have got a example of  Manifest file you can just copy and save it in Gadget.XML.Here below is a “manifest” file

– – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – - 

<?xml version=”1.0″ encoding=”utf-8″ ?>

<gadget>

 <name>My First Gadget</name>

    <author>The Microsoft Scripting Guys</author>

    <copyright>2006 Microsoft Corporation</copyright>

    <description>Sample gadget that returns the name of the installed operating system.</description>

    <icons>

        <icon>icon.png</icon>

    </icons>

    <version value=”1.0.0.0″ MinPlatformVersion=”0.1″></version>

    <sidebar>

        <type>html</type>

        <permissions>full</permissions>

        <code>test.htm</code>

        <website>www.microsoft.com/technet/scriptcenter</website>

     </sidebar>

</gadget>

– – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – - 

Before you ask, yes, you can simply copy this file and use it pretty much as-is, just making changes (as needed) to a few of the tag values. (And don’t forget, you must name the file Gadget.xml.) The tags you might want to/need to modify are specified in the following table:

Tag Description
<name> Name of the gadget as it appears in the gadget picker dialog box.
<author> Name of the person who wrote the gadget. The author, copyright, and description tags all appear in the gadget picker when you click on a particular gadget. For details, see the illustration shown below.
<copyright> Copyright information, including name of the copyright holder and copyright date.
<description> Brief description of the gadget and what it does.
<icon> Name of the icon file (the icon is the graphic displayed in the gadget picker). For more on icons, see Creating an Icon in the following subsection of this document.
<code> Probably not the most intuitive tag name in the world, but this is the name of the HTML file that makes up your gadget.
<website> Web site associated with the gadget.

And also I have got a example of one HTML file…… You can just copy and use this one

– – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – - 

<html>

<head>

    <title>My Gadget</title>

    <style>

        body{width:120;height:160;font:8 pt Arial;color:white;

        filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=”#000000″,

            EndColorStr=”#0000FF”)}

    </style>

</head>

 

Sub Window_OnLoad

    RunSub

End Sub

     Sub RunSub

        strComputer = “.”

        Set objLocator = CreateObject(“WbemScripting.SwbemLocator”)

        Set objWMIService = objLocator.ConnectServer(“.”, “rootcimv2”)

        Set colItems = objWMIService.ExecQuery(“Select * From Win32_OperatingSystem”)

        For Each objItem in colItems

            DataArea.InnerHTML = objItem.Caption

        Next

    End Sub

<body>

    <input value=”Run”><P>

    <span></span>

</body>

 </html>

– – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – — – – – – – – – – -  

 

Now you need to save this file in name as you type the code file name in manifest file…. Then complie it in a folder and give it a name end with .gadget

And the final part copy your folder of gadget and past it in to a location

%userprofile%appdatalocalmicrosoftwindows sidebargadgets

 

Here the link i tooked the help:-

http://www.microsoft.com/technet/scriptcenter/topics/vista/gadgets-pt1.mspx

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.