This simple button changes the wallpaper randomly selecting from a list of image files (stored in a text file). You can change the wallpaper manually by clicking on this button, and you can add the path to Change Wallpaper.dcf into the program scheduler to automatically change the pictures.
Instead /myarchive\Programs\Wallpapers\List.txt
, specify the path to your file list.
File list format: each full path to the picture, together with the extension on a separate line.
Example:
D:\Walllpapers\Landscapes\0586.jpg
D:\Walllpapers\Flowers\128.jpg
D:\Walllpapers\Space\285.jpg
Button download:
Script Code:
This is contained in the download above, and reproduced here for reference.
Option Explicit
Function OnClick(ByRef ClickData)
Dim File, FSO, ImageFile, ImageList
File = DOpus.FSUtil.Resolve("/myarchive\Programs\Wallpapers\List.txt")
If DOpus.FSUtil.Exists(File) Then
Set FSO = CreateObject("Scripting.FileSystemObject")
ImageList = Split(FSO.OpenTextFile(File, 1).ReadAll, vbCrLf)
Randomize()
ImageFile = ImageList(CInt(Int((UBound(ImageList) + 1) * Rnd())))
If DOpus.FSUtil.Exists(ImageFile) Then
ClickData.Func.Command.RunCommand("Properties SETWALLPAPER=stretch """ & ImageFile & """")
Else
DOpus.output("File is not found: " & ImageFile)
End If
End If
End Function