Hack 69 Hacking Away at the Registry

figs/expert.gif figs/hack69.gif

Nine great hacks that use the Registry to do their magic .

You'll find many dozens of Registry hacks sprinkled throughout this book, but to give you a sense of the breadth of the kinds of hacks that you can accomplish using the Registry, I've put a wide- ranging sample of Registry hacks here as well.

7.3.1 Automatically Close Programs at Shutdown

When you shut down Windows, if you have any programs running you'll get a message box warning you that a program is still running. You then have to close the program and tell XP again to shut down. It's a fairly pointless warningbetter yet would be if XP automatically killed the programs without issuing the warning. That way, you wouldn't get error messages and wouldn't have to close each individual application before shutting down your computer.

To have XP automatically close programs at shutdown, run the Registry Editor and go to HKEY_CURRENT_USER\Control Panel\Desktop . Edit the AutoEndTasks key so that is has a value of 1 . If the key doesn't exist, create it as a DWORD value and give it the value of 1 . To disable it, either delete the key, or set the value to .

7.3.2 Disable XP Shutdown

There may be times when you want to make sure that XP can't be inadvertently shut down. You can use a Registry hack to disable the normal Shut Down. Run the Registry Editor and go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer . Create a new DWORD value named NoClose with a data value of 1 . Exit the Registry and reboot in order for the change to take effect. You won't be able to shut down Windows in the normal manner from now on; you'll have to run Task Manager by pressing Ctrl-Alt-Delete or right-clicking on the Toolbar, choosing Task Manager, and then using the Task Manager's Shut Down menu to close Windows. If you want to reenable normal shutdowns, delete the NoClose value.

7.3.3 Change the Names of the Registered User and Company

When you install XP or when it comes factory-fresh on a PC, a username and company name are entered as the owner of the system. And that's the way it stays, like it or not. But a Registry hack will let you change both. Run the Registry Editor, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion , and look for the values RegisteredOwner and RegisteredOrganization . Edit their value data to whatever username and company name you want.

7.3.4 Change the Amount of Time Before Programs Time Out

When an application hangs and no longer responds, XP displays a dialog box that prompts you to kill the application or wait a while longer. By default, the dialog box appears after the application hasn't responded for five seconds.

This can cause problems. For example, if a program is doing heavy-duty calculations in the background, it won't respond until the calculation is done, so the operating system will report that the application is hung, even though it isn't. You can use a Registry hack to increase or decrease the amount of time it takes before XP reports that the program has hung.

Run the Registry Editor and go to HKEY_CURRENT_USER\Control Panel\Desktop . Select the HungAppTimeout entry and edit it to input a new value, in milliseconds . The default is 5000 . Exit the Registry. You may need to reboot for the new setting to take effect. Try increasing the number in increments of 1,000 until you find a number that works.

7.3.5 Disable the Disk Cleanup Warning

If your hard disk has what XP decides is too little space left on it, the operating system will pop up a warning and recommend that you run Disk Cleanup. But you may be like me and not want a virtual nanny nagging you to clean up your mess. You can turn off the warning with a Registry hack. Run the Registry Editor and go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer . Create a DWORD value called NoLowDiskSpaceChecks and give it a value of 1 . Exit the Registry and reboot. You can also do this by using TweakUI [Hack #8].

7.3.6 Change the Default Location for Installing Programs

XP uses the C:\Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/or directory by using a Registry hack. Run the Registry Editor and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion . Look for the value named ProgramFilesDir . By default, the value will be C:\Program Files . Edit the value to any valid drive or folder; XP will use that new location as the default installation directory for new programs.

7.3.7 Allow Laptops to Enter Power-Saving State (Increase the USB Polling Interval)

Some laptops' processors may not be able to enter their power-saving state, even when they're idle, because USB polling fools the processor into thinking that the laptop is active. Your system polls your USB ports once every millisecond to see whether a device is present. So, even if a device isn't present, it continues that polling. The problem is that some laptop processors won't go into their power-saving state because the constant polling makes it think that the laptop is active.

With a Registry hack, you can increase the polling interval from the default of one millisecond, letting the processor enter its power-saving state. Run the Registry Editor and go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0000 . Create the new DWORD value IdleEnable and set the data value to a number between 2 and 5 . This will set the polling interval, in milliseconds. If there are additional subkeys for HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} (such as 0001 , 0002 , etc.), repeat the procedure and create the IdleEnable DWORD in each of them. Exit the Registry. You may need to reboot for the new setting to go into effect. You also may need to try several different values until you find one that works.

7.3.8 Change the Size of Your Mouse and Keyboard Buffer

You sometimes may get an error message telling you that you have an overflow in your mouse buffer or keyboard buffer. When that happens, it means the buffer isn't large enough and you need to increase its size. To increase your mouse buffer, run the Registry Editor, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Mouclass\Parameters , and find the MouseDataQueueSize subkey . The default setting is 100 (64 hex). Increase the decimal number to increase the size of the buffer; then exit the Registry and reboot. You may need to try several different settings until you find the right one.

To increase the keyboard buffer, look for the KeyboardDataQueueSize subkey in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters . The default setting is 100 (64 hex). Increase the number to increase the size of the buffer; then exit the Registry and reboot. Again, you may need to try several different settings until you find the right one.



Windows XP Hacks
Windows XP Hacks, Second Edition
ISBN: 0596009186
EAN: 2147483647
Year: 2005
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net