
August 14th, 2009, 12:45 AM
|
 |
|
|
Join Date: Jun 2006
Location: Salem, OH
|
|
|
Default Icons for Registered File Types
I think you may be hinting at overkill here. It seems to me that you would just like to change the system-wide default icon for .wsc files. Yes?
If that's so, then there's no need to create an icon handler. Icon Handlers are used to display dynamic icons based on some environmental status. The best example I can think of is the Recycle Bin. It displays one icon when it's empty and another when it is not. This icon is dynamically changed by means of an Icon Handler (which involves some fairly in-depth programming ability).
If you simply want to change the default icon for a registered file type, there's no need to go through all of that. It's much simpler.
The first way to change the icon is through the Windows UI. Method 1: Change the Default Icon for a Registered File Type:- Open My Computer and choose Folder Options... from the Tools menu.
- Select the File Types tab in the Folder Options dialog.
- Locate and select the file type you wish to change the default icon for in the Registered File Types: box and then press the Advanced button.
- In the Edit File Type dialog, press the Change Icon... button.
- Press the Browse... button and locate the resource that contains the icon you wish to use.
- Select the icon in the box below and press the OK button.
- Press OK to close all remaining dialogs.
The second method of changing the default icon for a registered file type involves editing the Windows Registry. Method 1: Change the Default Icon for a Registered File Type:- Press Start and then Run... to open the Run dialog box.
- Enter regedit and press OK to launch the Microsoft Registry Editor.
- In the left pane, navigate to the key that matches the file extension for the file type you wish to change the icon for under the HKEY_CLASSES_ROOT branch. e.g.
HKEY_CLASSES_ROOT\.wsc - In the right pane, note the Data component for the (Default) string value. e.g. For .wsc files, the Data component will say scriptletfile.
- Navigate to the key matching the value you just found under the HKEY_CLASSES_ROOT branch. e.g.
HKEY_CLASSES_ROOT\scriptletfile - Expand this key and select the DefaultIcon key.
- Edit the (Default) string value with the location of the new icon resource you wish to use. e.g.
C:\WINDOWS\system32\scrobj.dll,0 - Close the Microsoft Registry Editor. You may need to rebuild the Icon Cache or restart Windows for changes to take effect.
Alternatively, you can use a .reg file similar to the one below.
REG Code:
Original
- REG Code |
|
|
|
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\scriptletfile\DefaultIcon]
@="C:\\WINDOWS\\system32\\scrobj.dll,0"
Last edited by Nilpo : August 14th, 2009 at 12:47 AM.
|