Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
folder icon
#1
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$"
#2
Function ChangeFolderIcon
Code:
Copy      Help
;/
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.
#3
thanks gin, worked fine , I love that icon!


Forum Jump:


Users browsing this thread: 1 Guest(s)