Posts Tagged ‘ritesh how to’
Before starting let us know some basics.
What Is a Sidebar Gadget?

- HTML file and
- an XML definition file.
Apart from that, most gadgets include other files, such as
- image files (PNG and JPG),
- style sheets (CSS), and
- scripting (JavaScript and VBScript source files)
which give them good look and feel. All of the content is stored in a ZIP file that is renamed with a .gadget extension. If you have read my tutorial on how to create window media player skin, then I may assure you, that this is also as simple as that one. If you want, you can grab a gadget online, rename it with a .zip extension, and easily explore its contents.
XML Definition File

Typical XML Definition File
<?xml version=”1.0” encoding=”utf-8” ?><gadget> <name>Gadget Name Here</name> <namespace>YourCompanyNameHere</namespace> <version>1.0.0.0</version> <author name=”Company Name Here”> <info url=”http://contoso.com” text=”Vist our Web site” /> <logo src=”logo.png” /> </author> <copyright>© 2007</copyright> <description>your gadget description</description> <icons> <icon width=”64” height=”64” src=”icon.png” /> </icons> <hosts> <host name=”sidebar”> <base type=”HTML” apiVersion=”1.0.0” src=”gadget.html” /> <permissions>full</permissions> <platform minPlatformVersion=”0.3” /> </host> </hosts> </gadget>
Here is a list of the elements you should be most concerned with:
- name: Title of your gadget.
- version: Version number of your gadget.
- author: Your name or your company’s name.
- info url: Web site address.
- info text: Friendly name for your Web site.
- logo src: Name of company’s logo image file.
- copyright: Copyright notice.
- description: Description of the gadget.
- icon src: Name of icon image file for the gadget.
- base src: Name of gadget’s main HTML file.
The Main HTML File
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <title></title> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8” /> <link href=”style.css” rel=”stylesheet” type=”text/css” /> <script src=”local.js” type=”text/javascript”></script> <script src=”gadget.js” type=”text/javascript”></script> </head> <body> <div id=”gadget” class=”gadget”></div> </body> </html>
JavaScript
function pageLoad() { window.detachEvent(“onload”, pageLoad); window.attachEvent(“onunload”, pageUnload); //page initalization here } function pageUnload() { window.detachEvent(“onload”, pageUnload); //gadget is closing, clean up } window.attachEvent(“onload”, pageLoad);
Docked and Floating
.gif)
.gif)
// called when the docked state changes function dockStateChanged() { if (System.Gadget.docked) { System.Gadget.background = “images/background.png”; document.body.style.width = “130px”; } else { System.Gadget.background = “images/background-undocked.png”; document.body.style.width = “230px”; } }
Flyouts
.gif)
.gif)
Options Dialog
.gif)
Options Dialog
System.Gadget.settingsUI = “settings.html”; System.Gadget.onSettingsClosed = settingsClosed; function settingsClosed(p_event) { //OK clicked? if (p_event.closeAction == p_event.Action.commit) { //yes, read settings here } }
Reading and Writing Settings
Settings are written using System.Gadget.Settings.write or System.Gadget.Settings.writeString. Both are passed a key/value pair. Conversely, settings are read with System.Gadget.Settings.read or System.Gadget.Settings.readString. Both of these functions take a key and return a value. If the key does not exist (for instance if it has never been written) both will return a value of undefined.
Localization
- Full locale (en-us, es-us, ja-jp)
- Language portion of the locale (en, es, ja)
- Gadget root folder
var L_Hello = “Hello”; var L_Degrees = 0;
var L_Hello = “Hola”; var L_Degrees = 1;
element.innerHTML = L_Hello; if (L_Degrees === 0) { //load the Fahrenheit feed } else { //load the Celsius feed }
What Happened to Alert and Confirm?
<script src=”alert.vbs” type=”text/vbscript”></script>

Emulating Alert and Confirm
‘simulate JavaScript alert() function sub alert(prompt) MsgBox prompt, 48 , “Sidebar Gadget” end sub ‘simulate JavaScript confirm() function function confirm(prompt) dim res res = MsgBox (prompt, 33, “Sidebar Gadget”) if res=1 then confirm = true else confirm = false end if end function
Debugging
.gif)
Figure 9 shows a section of debugged code where the value of the variable refreshRate is 24. This form of debugging is very powerful. Once you try it, you’ll never go back to spattering your code with alert statements. Note that JavaScript debugging is vastly improved in the next version of Visual Studio code-named “Orcas.” You can read more about these new features at JScript Debugging in Visual Web Developer Orcas, and you can download “Orcas” Beta 1 at msdn2.microsoft.com/aa700831.
.gif)
Packaging Your Gadget
@echo off rem ** remove/create a test gadget folder rd “%LOCALAPPDATA%\Microsoft\Windows Sidebar\ Gadgets\MSDNSample.gadget\” /s /q md “%LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets\MSDNSample.gadget\” rem ** copy all of the files into test area xcopy . “%LOCALAPPDATA%\Microsoft\Windows Sidebar\ Gadgets\MSDNSample.gadget\” /y /s /q /EXCLUDE:exclude.txt cd “%LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets\MSDNSample\” cabarc -r -p n “%HOMEPATH%\Documents\MSDNSample.gadget” *
The MSDN Magazine Ticker
Download our free tools bar to get latest update without even visiting our website.
All Hacks And Cracks part-3
Posted by: riksgonemad on: February 15, 2009
C. My Computer
1. Remove Shared Documents and My Documents Folder
both
2. Prevent access to certain drive
3. Remove Shared Folder
4. Add Recycle Bin in My computer
5. Hide drives in my Computer
6. Remove properties option from my computer
7. Invisible Folder and Drive
8. Remove Compression Option In Disk Cleanup
Answers
1. Remove Shared Documents and My Documents Folder
both
Want to remove Shared Documents and My Documents folder from My Computer here is the way how you can get rid of it.
1. Open Regedit. (type Regedit in RUN dialog box)
2. Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVe
rsion\Explorer\MyComputer\NameSpace\DelegateFolders
3. And delete the subkey
{59031a47-3f72-44a7-89c5-5595fe6b30ee}
Hate editing Registry so here’s a simple and clean way
1. Open Group Policy Editor. (Type gpedit.msc in RUN dialog box)
2. Navigate to User Configuration>Administrative Templates>Windows
Components> Windows Explorer.
3. On the right pane double click on option Remove Shared Documents folder
from My Computer and Enable it.
2. Prevent access to certain drive
This is an ultimate restriction if you want that no one access you’re hard drives accept you than it is what you are looking for. This tweak will disable access to your drives even their contents are not visible by using dir command or by using search.
Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Polici es\Explorer
And to
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies \Explorer
Here create a new DWORD named NoViewOnDrive and set its value to 4(in dec) if you want to restrict your C drive.
For restricting other drives set the value accordingly
A 1
B 2
C 4
D 8
E 16
F 32
G 64
H 128
I 256
J 512
K 1024
L 2048
M 4096
N 8192
0 16384
P 32768
Q 65536
R 131072
S 262144
T 524288
U 1048576
V 2097152
W 4194304
X 8388608
Y 16777216
Z 33554432
ALL DRIVES 67108863
FOR EG: To hide drive C and D, you would add 4(for C) and 8(for D) which would be 12 and then set the value of NoViewOnDrive to 12 in order to restrict drives C and D.
Or
Go to
User Configuration> Administrative Template> Windows Component> WindowsExplorer
And double click on Prevent access to drives from My Computer and Enable it and select the drives you want to prevent
3. Remove Shared Folder
To remove the Shared Documents folder follow the given steps
1. Open Regedit. (Type Regedit in RUN dialog box)
2. Navigate to
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\E
xplorer
3. On right pane create a Binary value named NoSharedDocuments and set its
value to 1, to revert back just delete the key
4. Add Recycle Bin in My computer
To add recycle bin in My Computer go to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\MyComputer\NameSpace
Create a subkey named {645FF040-5081-101B-9F08-00AA002F954E} under NameSpace
Complete path would like this
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\MyComputer\NameSpace\ {645FF040-5081-101B-9F08-
00AA002F954E}
And you will have Recycle Bin in you’re my Computer
5. Hide drives in my Computer
To hide drives in My Computer navigate through
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
And create a DWORD and name it NoDrives and give it value 03ffffff (in hex)
To revert back, just delete the following DWORD created.
6. Remove properties option from my
computer
This tweak hides the system properties screen and remove the properties option from my computer.
Navigate to
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
And to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Create a new DWORD value in both locations called NoPropertiesMyComputer.
Set its value to 1 to hide the properties option.
7. Invisible Folder and Drive
Yes, it is possible to create invisible drives that remain there only but nobody can see it.
The idea of creating this invisible drive struck my mind when I came to knew how to create an invisible folder. So I must first tell you how to create an invisible folder. To create invisible folders first create a folder say “Ritesh”. Now right click on the folder and select Rename.
Now while pressing ALT click 0160 (ALT+0+1+6+0) and hit enter. You will get a folder with no name. So our half process is done now you need to hide the folder to hide it right click the folder and click on
Properties > customize > change icon
Now look for an empty space in the change icon dialog box and click on it and then click ok.
Now you are done!
You will have an invisible folder.
So you have created an invisible folder. Now, after creating invisible folder the idea of making
invisible hard drive is quite simple
The only 2 problem are that
1. How to change drive icons.
2. How to remove drive letters.
First, rename the drive that you want to hide by the method given above for folders. Then follow
these steps
1. To change drive icons navigate to
HKLM > Software > Microsoft > Windows > CurrentVersion > Explorer
Create a new key DriveIcons
In this key again create a key named C (Drive letter of the drive which you want to hide)
In this key again create a key name it DefaultIcon
Now the path will be
HKLM > Software > Microsoft > Windows > CurrentVersion > Explorer> DriveIcons > C> DefaultIcon
On the right pane you will find a string named Default double click the string and enter the full path of the blank icon in it which is
%SystemRoot%\system32\SHELL32.dll,50
This is the path of blank icon.
2. Now we have hided the drive icon now to hide drive letter from appearing navigate to
HKLM > Software > Microsoft > Windows > CurrentVersion > Explorer
Now on the right pane create a DWORD name it ShowDriveLettersFirst and give it the value 2
in DECIMAL
Now Logoff/Logon your system to see the changes you have made.
8. Remove Compression Option In Disk Cleanup
Go to-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Compress old files
Delete the Default Value Key and the next time you start Disk Cleanup, it will skip
the compression analysis
NOTE:
Download our free tools bar to get latest update without even visiting our website.
Understand regedit
Posted by: riksgonemad on: June 22, 2008
- In: Regedit
- 4 Comments
Understanding Regedit
The Microsoft Registry Editor enables you to view, search for, and change settings in your system registry, which contains information about how your computer runs. Windows stores its configuration information in a database called the registry which can be accessed using Regedit.exe(Registry Editor). The registry contains profiles for each user of the computer and information about system hardware, installed programs, and property settings. Windows continually references this information during its operation. Although you can use Registry Editor to inspect and modify the registry, doing so is not recommended, as making incorrect changes can damage your system.
Registry Editor overview
Registry Editor is an advanced tool for viewing and changing settings in your system registry which contains information about how your computer runs. Windows stores its configuration information in a database (the registry) that is organized in a tree format.When you view the registry in the Microsoft Registry Editor its hierarchical nature becomes obvious. The editor presents an Explorer-like view of the registry, with a tree in the left pane and data in the right
The registry tree is divided into six broad sections (five in NT). HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HKEY_CURRENT_CONFIG HKEY_DYN_DATA Folders represent keys in the registry and are shown in the navigation area on the left side of the Registry Editor window. On the left side below My Computer their are five keys HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CURRENT_CONFIG, HKEY_DYN_DATA. On expanding these Keys we’ll get the sub keys. In the right side area, the entries in a particular sub key are displayed, which are Name(Contains name of the value), Type(contains type of the value), and Data(Contains associated data of the value.)When you double-click a entry, it opens an editing dialog box. At the status bar of regedit path is shown.
You should not edit your registry unless it is absolutely necessary. If there is an error in your registry, your computer may not function properly. If this happens, you can restore the registry to the same version you were using when you last successfully started your computer Regedit.exe is automatically installed during setup and is stored in same folder as is Windows. To start Regedit.exe
- Click Start, and then click Run.
- Type Regedit, and then click OK.
Navigation
The navigation area of the Registry Editor displays folders, each of which represents a predefined key (a key that represents one of the main division of the registry for eg: HKEY_LOCAL_MACHINE ) on the local computer. When accessing the registry of a remote computer, only two predefined keys, HKEY_USERS and HKEY_LOCAL_MACHINE, appear.
Folder/predefined key | Description |
---|---|
HKEY_CURRENT_USER | Contains the root of the configuration information for the user who is currently logged on. The user’s folders, screen colors, and Control Panel settings are stored here. This information is referred to as a user’s profile. |
HKEY_USERS | Contains the root of all user profiles on the computer. HKEY_CURRENT_USER is a subkey of HKEY_USERS. |
HKEY_LOCAL_MACHINE | Contains configuration information particular to the computer (for any user). |
HKEY_CLASSES_ROOT | Is a subkey of HKEY_LOCAL_MACHINE\Software. The information stored here ensures that the correct program opens when you open a file by using Windows Explorer. |
HKEY_CURRENT_CONFIG | Contains information about the hardware profile used by the local computer at system startup. |
The following table lists the data types currently defined and used by the system.
Data type | Description |
---|---|
REG_BINARY | Raw binary data. Most hardware component information is stored as binary data and is displayed in Registry Editor in hexadecimal format. |
REG_DWORD | Data represented by a number that is 4 bytes long. Many parameters for device drivers and services are this type and are displayed in Registry Editor in binary, hexadecimal, or decimal format. |
REG_EXPAND_SZ | A variable-length data string. This data type includes variables that are resolved when a program or service uses the data. |
REG_MULTI_SZ | A multiple string. Values that contain lists or multiple values in a form that people can read are usually this type. Entries are separated by spaces, commas, or other marks. |
REG_SZ | A fixed-length text string. |
REG_FULL_RESOURCE_DESCRIPTOR | A series of nested arrays designed to store a resource list for a hardware component or driver. |
Add a key
Caution
- Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on your computer.
- You must back up your registry before tweaking into it or it may lead you to reinstall your operating system.
- You can search for lot of registry backup tool an use any one of them, like ERUNT or click here for alternate methods of backing up registry.
Referrences
- Microsoft Help and Support center.
- PC SUPPORT ADVISOR
- picture – http://www.nogeekleftbehind.com/images/regedit_dell_wallpaper.jpg
- piture -http://www.photocamel.com/gallery/data/540/regedit.JPG
Recent Comments