Procedure CustomizeFolder(FolderName.s, IconName.s) ; Customize the icon of the specified folder.
If Right(FolderName, 1) <> "\"
FolderName + "\"
EndIf
Protected FileID = CreateFile(#PB_Any, FolderName + "Desktop.ini")
If FileID
WriteStringN(FileID, "[.ShellClassInfo]")
WriteStringN(FileID, "IconFile=" + IconName)
WriteStringN(FileID, "IconIndex=0")
CloseFile(FileID)
EndIf
If FileSize(FolderName + "Desktop.ini")
ProcedureReturn PathMakeSystemFolder_(FolderName)
EndIf
EndProcedure
; Specify here the folder to customize with the desired icon.
If CustomizeFolder(#PB_Compiler_Home, #PB_Compiler_Home + "Examples\Sources - Advanced\MoviePlayer\Icons\MoviePlayer.ico")
MessageRequester("Information", "OK")
EndIf
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Is this really needed? Seems to work fine without it, and I also have another
app installed (Adobe Premiere v6.5) which has its folder as a custom icon and
that folder isn't set to System type; so it makes me think it's not necessary?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
@PB
Readonly flags works also. Without any flag, it doesn't work
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Well, my own tests reveals that PathMakeSystemFolder is mandatory on my system (XP SP2).
It doesn't work without this API function but maybe that depends of the windows version - i don't know.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer