Advertisement
Najeebsk

FOLDER-MAKERS.ahk

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