Fun with the Registry Using VC++

Environment: VC6

This tiny tool offers a comfortable GUI to change hidden system settings that you normally can change only by editing the Registry.

By using this tool, we can do the following things:

  • Change the title name of Internet Explorer.
  • Change the title name of Outlook Express.
  • Remove typed URL addresses from Internet Explorer.
  • Remove recently opened files from Windows Media Player.
  • Turn off the shortcut arrow for desktop icons, like this:

Note: I tested this application on Windows 98; it works perfectly. The tips may or may not work on Windows NT or other Windows operating systems.

Basics of the Registry

The Windows Registry is a set of data files used to help Windows control hardware, software, the user's environment, and the "look and feel" of the Windows interface. Without the Registry, the operating system would not have the necessary information to run, control attached devices, launch and control applications, and to respond correctly to user input.

The Registry is a complex database of information that was built in a hierarchical fashion by the writers and programmers of Windows. The Registry has a hierarchal structure, like the directories on your hard disk. Each branch (denoted by a folder icon in the Registry Editor; see below) is called a Key. Each key can contain other keys, as well as values. Each value contains the actual information stored in the Registry. There are three types of values: String, Binary, and DWORD—the use of these depends upon the context.

Note: If you're not familiar with editing the Registry manually, don't try it unless you feel comfortable with it. For safety's sake, first make a backup of your Registry.

The application created here uses a dialog-based MFC AppWizard (EXE). The application has a List Box that contains the tips. You have to select one of tips from the List Box and then click on the "Add" button to change the selected tip on your computer. You click the "Remove" button so that the selected tip does not affect your computer. The application also has two buttons: "ReBoot" and "ShutDown" for restarting Windows and shutting down Windows, respectively. A static control of the application displays a message about what to do after selecting the tip from List Box.

The application uses the following functions to open, create, close keys, write, and delete Registry data.

Function What It Does
RegOpenKeyEx Opens the specified Registry key.
RegCreateKeyEx Creates the specified Registry key. If the key already exists, the function opens it.
RegCloseKey Releases a handle to the specified Registry key.
RegSetValueEx Sets the data and type of a specified value under a Registry key.
RegDeleteValue Removes a named value from the specified Registry key.
RegDeleteKey Deletes a subkey.
Note: To restart Explorer.exe, do this:

  • Press CRTL + ALT + DEL (once!).
  • Click on Explorer in the "running processes" list and then on the "End Task" button.
  • When the shutdown window opens, click on "Cancel."
  • Eventually (just wait!!), another window will open, asking whether you want to end the task; click on "Yes." Because Windows needs Explorer to function, it will restart the program by itself.

Downloads

Download demo project - 26.2 Kb
Download source - 13.8 Kb


Comments

  • Windows Registry &VC++

    Posted by Legacy on 01/10/2004 12:00am

    Originally posted by: priyanka

    Im an engineeering gratuate &im doing a project in VC++. my project conatins a module wherein i need to deploy my component(project created) in task bar( near start button-desktop). the component should work the same way as Addresses link is found when u click toolbars(right click on taskbar). the component provides employee deatils of a company as floating popup. in the same way as "addresses"(rightclick on taskbar->toolbar->Address) provide us with the link to the url when we type in the combo box.

    i need to know the mechanism how we can deploy a component into desktop using windows registry &vc++.

    thks for ur help

    pl. reply me soon

    bye

    priyanka

    Reply
  • A better way to restart Explorer

    Posted by Legacy on 09/24/2003 12:00am

    Originally posted by: Brian Friesen

    Killing explorer.exe is not the best way to restart the shell. Microsoft has a secret built-in way in all versions of Windows to close Explorer. This works on all versions of Windows, from Win95 to Win2003 Server.

    1) If you're running Win95/98/ME, first start a Command Prompt and leave it running (this step will become obvious later on.
    2) Next, from the Start Menu go Start | Shutdown. This displays the system shutdown confirmation dialog.
    3) Press and hold Shift + Ctrl + Alt at the same time.
    4) While holding these three keys use the mouse to click No or Cancel. Note: older OSes have Yes/No buttons at the bottom, newer OSes have OK/Cancel. Click either the No or Cancel depending on your OS.

    Explorer will now gracefully close. If you want to restart Explorer, do the following:

    For Win95/98/ME machines, switch to that Command Prompt window you started back in step 1. Type explorer.exe to restart Explorer.

    For WinNT/2K/XP/2K3 machines, start Task Manager by pressing Ctrl + Shift + Esc. From the menu go File | New Task. Run explorer.exe to restart Explorer.

    Reply
  • www.microsoft.com/ntworkstation/downloads/ PowerToys/Networking/NTTweakUI.asp

    Posted by Legacy on 09/23/2003 12:00am

    Originally posted by: Papa

    www.microsoft.com/ntworkstation/downloads/ PowerToys/Networking/NTTweakUI.asp

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Protecting business operations means shifting the priorities around availability from disaster recovery to business continuity. Enterprises are shifting their focus from recovery from a disaster to preventing the disaster in the first place. With this change in mindset, disaster recovery is no longer the first line of defense; the organizations with a smarter business continuity practice are less impacted when disasters strike. This SmartSelect will provide insight to help guide your enterprise toward better …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds