c# - Change of folder Icon takes longer time to show the updated icon -
i on windows 8 , have c# code changes folder icon.
this works fine takes long time refresh. i've been trying methods such as:
intptr path = marshal.stringtohglobalauto(@"[folderpath]"); shchangenotify(hchangenotifyeventid.shcne_attributes, hchangenotifyflags.shcnf_patha, path, intptr.zero); shchangenotify(hchangenotifyeventid.shcne_updateimage, hchangenotifyflags.shcnf_dword, intptr.zero, intptr.zero); shchangenotify(hchangenotifyeventid.shcne_assocchanged, hchangenotifyflags.shcnf_idlist, intptr.zero, intptr.zero);
this doesn't seem have affect on folder icon. refresh screen icon still same icon. several minutes later can press f5 , change folder icon specified.
i've seen ugly ways around know tell windows 'refresh' folder icon programmatically. i've seen dropbox seems instant , i'm thinking there solution.
to change folder icon needs 2 steps achieve this:
step 1. create desktop.ini file inside folder create icon (the "target folder"). step 2. set target folder's attribute "system".
to accomplish these steps, create 2 classes i.e. foldericon, orchestrates steps , iniwriter, has 1 static method called writevalue() wraps writeprivateprofilestring() win32 api function.
to getting these things done in right way, follow code project tutorial:
http://www.codeproject.com/articles/9331/create-icons-for-folders-in-windows-explorer-using
Comments
Post a Comment