|
|
|
Generic behavior to change System Desktop Icons
Added on 1/21/2002
|
Allows to customize System Desktop Icons
-- Generic behavior to change System Desktop Icons
-- Desktop Xtra 1.0 or later required
-- Compatibilities: Director 6.x, 7.x, 8.x, Windows
property Icons, OldIcons
property MyComputer, NetworkNeighborhood, RecycleBinFull, RecycleBinEmpty, Inbox, Internet, MyDocuments
on getPropertyDescriptionList
set description = [:]
set path = the moviePath
addProp description, #MyComputer, [#default: path & "MyComputer.ico", #format:#string, #comment:"My Computer Icon:"]
addProp description, #NetworkNeighborhood, [#default: path & "NetworkNeighborhood.ico", #format:#string, #comment:"Network Neighborhood Icon:"]
addProp description, #RecycleBinFull, [#default: path & "RecycleBinFull.ico", #format:#string, #comment:"Recycle Bin Full Icon:"]
addProp description, #RecycleBinEmpty, [#default: path & "RecycleBinEmpty.ico", #format:#string, #comment:"Recycle Bin Empty Icon:"]
addProp description, #Inbox, [#default: path & "Inbox.ico", #format:#string, #comment:"Inbox Icon:"]
addProp description, #Internet, [#default: path & "Internet.ico", #format:#string, #comment:"Internet Icon:"]
addProp description, #MyDocuments, [#default: path & "MyDocuments.ico", #format:#string, #comment:"My Documents Icon:"]
return description
end
on getBehaviorDescription
return " " & ¬
"- - System Desktop Icons Behavior - -" & RETURN & ¬
"Changes all system desktop icons:"& RETURN & ¬
"MyComputer, NetworkNeighborhood, RecycleBinFull, RecycleBinEmpty, Inbox, Internet, MyDocuments."
end
on mouseDown
-- List of all system desktop icons
set Icons = []
add Icons, "MyComputer"
add Icons, "NetworkNeighborhood"
add Icons, "RecycleBinFull"
add Icons, "RecycleBinEmpty"
add Icons, "Inbox"
add Icons, "Internet"
add Icons, "MyDocuments"
changeIcons
end
on changeIcons
set icon = ""
set OldIcons = [:]
repeat with i = 1 to count(Icons)
do "set icon="&getAt(Icons,i)
set Ok = changeDesktopIcon (getAt(Icons,i), icon)
if getAt(Ok,1) = 0 then
-- Ok, we save all previous icons as the OldIcons property list
addProp OldIcons, getAt(Icons,i), getAt(Ok,3)
else
-- Error
alert("Error: " & getAt(Ok,1) & " - base error code")
end if
end repeat
-- Now apply the changes
set Result = ApplyDesktopIconChanges()
if getAt(Result,1) <> 0 then
alert("Error: " & getAt(Result,1) & " - base error code")
end if
end
|
|