Refresh explorer after associating with icon

Share your advanced PureBasic knowledge/code with the community.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Refresh explorer after associating with icon

Post by Inf0Byt3 »

I know this is a lousy trick hehe but it has been asked before. After you use AssociateFile(ex) from the registry lib, you need to restart the pc in order to the files to carry the associated icon. I just found how to do that without restarting.

Code: Select all

#SHCNE_ASSOCCHANGED = $08000000
#SHCNF_IDLIST = $0

SHChangeNotify_(#SHCNE_ASSOCCHANGED, #SHCNF_IDLIST, 0, 0)
This will refresh your associations instantly.

Thanks for viewing :).
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)