Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InputBox, Fol, ICON Number, Please enter a Icon Number., , 200, 100
- FileCreateDir, NSK
- sleep 200
- ;SetFolderIcon(A_ScriptDir . "\NSK", A_WinDir . "\FOL.dll", Fol)
- SetFolderIcon(A_ScriptDir . "\NSK", A_ScriptDir . "\FOL.icl", Fol)
- ;SetFolderIcon(A_ScriptDir . "\NSK", A_ScriptDir . "\FOL.dll", Fol)
- SetFolderIcon(folderPath, iconPath, iconIndex) {
- static FCSM_ICONFILE := 0x10, FCS_FORCEWRITE := 0x2
- if !A_IsUnicode {
- VarSetCapacity(WiconPath, StrPut(iconPath, "UTF-16")*2, 0)
- StrPut(iconPath, &WiconPath, "UTF-16")
- }
- VarSetCapacity(SHFOLDERCUSTOMSETTINGS, size := 4*5 + A_PtrSize*10, 0)
- NumPut(size, SHFOLDERCUSTOMSETTINGS)
- NumPut(FCSM_ICONFILE, SHFOLDERCUSTOMSETTINGS, 4)
- NumPut(A_IsUnicode ? &iconPath : &WiconPath, SHFOLDERCUSTOMSETTINGS, 4*2 + A_PtrSize*8)
- NumPut(iconIndex, SHFOLDERCUSTOMSETTINGS, 4*2 + A_PtrSize*9 + 4)
- DllCall("Shell32\SHGetSetFolderCustomSettings", Ptr, &SHFOLDERCUSTOMSETTINGS, WStr, folderPath, UInt, FCS_FORCEWRITE)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement