I've created a file type called *.pc3
When I activate it the windows icon appearse.
How can I change it's icon?
Printable View
I've created a file type called *.pc3
When I activate it the windows icon appearse.
How can I change it's icon?
Code:'in declarations
Declare Function SHChangeNotify Lib "shell32.dll" (ByVal wEventID As Long, ByVal uFlags As Long, ByVal dwItem1 As String, ByVal dwItem2 As String) As Long
Const SHCNE_ASSOCCHANGED = &H8000000
Const SHCNF_IDLIST = &H0
'to use:
SHChangeNotify SHCNE_ASSOCCHANGED, SHCNF_IDLIST, vbNullString, vbNullString
To what Icon does it changes the file type to?
Oh, i've thought you wanted to update the icons, btw, you just want to do this manually or with code?
With code to put in my setup program.
To do this you need to download my registry module from my homepage. You need to add it to your project for the regval property to work.
1. Open Regedit, search up the extension in classes root and check out the default value of the key.
2. That value is the name of a key in classes root, search for it and open it
3. open the subkey DefaultIcon, for instance for a winamp file it would be
HKEY_CLASSES_ROOT\Winamp.File\DefaultIcon
check out it's default value, it's
D:\SECURED\MUSIC\WINAMP\WINAMP.EXE,1
which is the file that contains the icon, the number that comes after the file is the index you need to specify for files with multiple icons.
4. Copy the Key path, (not the default value), in vb paste this into your regval function:
Regval("HKEY_CLASSES_ROOT\Winamp.File\DefaultIcon\") = yourfilename & "," & youriconindex
Notice you would have to add that "\" in the end of the string. replace yourfilename and youriconindex to suite your needs.
5. Use SHChangeNotify as above to update the icons.
Good luck