Posts: 28
Threads: 12
Joined: Apr 2008
I am making a folder creation macro, is there a way to change the icon from the default to another icon during the creation process?
I noticed there is a music icon, was wanting to change to that upon creation! thx donald
mkdir "my music" "$desktop$"
Posts: 12,042
Threads: 140
Joined: Dec 2002
Function
ChangeFolderIcon
;/
function $folder $iconfile [iconindex]
;Changes folder icon.
;Works on Windows XP and later. On older OS does nothing.
;EXAMPLE
;str folder="$desktop$\my music"
;mkdir folder
;ChangeFolderIcon folder "shell32.dll" 128
#if _winver>=0x501 ;;XP
dll shell32 [709]#SHGetSetFolderCustomSettings SHFOLDERCUSTOMSETTINGS*pfcs @*pszPath dwReadWrite
str sf.expandpath(folder) si.searchpath(iconfile)
if(!si.len) ret
SHFOLDERCUSTOMSETTINGS f.dwSize=sizeof(f)
f.dwMask=FCSM_ICONFILE
f.pszIconFile=@si
f.iIconIndex=iconindex
SHGetSetFolderCustomSettings &f @sf FCS_FORCEWRITE
You need QM 2.3.0 or later.
Posts: 28
Threads: 12
Joined: Apr 2008
thanks gin, worked fine , I love that icon!