Results 1 to 6 of 6

Thread: New Icon

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I've created a file type called *.pc3
    When I activate it the windows icon appearse.
    How can I change it's icon?
    Dekel C.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    To what Icon does it changes the file type to?
    Dekel C.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Oh, i've thought you wanted to update the icons, btw, you just want to do this manually or with code?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    With code to put in my setup program.
    Dekel C.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width