Post Reply
Ted 2008-09-28 05:51
I just installed Ultramon 3.0.2 on a new machine with Vista 64-bit after using 2.7.1 on my old XP Pro machine. I had to modify (simplify, really) the script I used for changing wallpaper, so I thought I'd pass it along. I previously used a modified script based on scripts I'd seen here. Here it is modified again for Vista. Save it as NextWallpaper.vbs. You can also add the line "WallpaperList.Reverse()" after the line "WallpaperList.Sort" and save it as PreviousWallpaper.vbs. I didn't find a Vista wallpaper changer here, excuse me if this is redundant.
Option Explicit
Const UMDESKTOP_EXE = "C:\Program Files\UltraMon\UltraMonDesktop.exe"
Dim sh, fso
Set sh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set WallpaperList = CreateObject("System.Collections.ArrayList")
Dim dirWps
dirWps = sh.ExpandEnvironmentStrings("%APPDATA%") & "\Realtime Soft\UltraMon\3.0.2\Wallpapers\"
Dim i, chkFile, objFile
chkFile = "ScriptActive.txt"
For i = 1 To 100
If fso.FileExists(dirWps & chkFile) Then
On Error Resume Next
WScript.Sleep(2000)
Else Set objFile = fso.CreateTextFile(dirWps & chkFile)
Exit For
Wscript.Quit
End If
Next
On Error GoTo 0
set objFile = nothing
Dim fldWp, strItem, fileWpFullName, WallpaperList
Set fldWp = fso.GetFolder(dirWps)
For Each strItem In fldWp.Files
If Right(strItem, 10) = ".wallpaper" Then
fileWpFullName = strItem
WallpaperList.Add fileWpFullName
End If
Next
WallpaperList.Sort
Dim curWp, firstWp, nextOne, nextWp
curWp = dirWps & sh.RegRead("HKCU\Software\Realtime Soft\UltraMon\3.0.2\Wallpaper\CurrentWallpaper") & ".wallpaper"
For Each strItem in WallpaperList
If firstWp = "" Then firstWp = strItem
If nextOne = True Then
nextWp = strItem
Exit For
ElseIf strItem = curWp Then
nextOne = True
End If
Next
If nextWp = "" Then nextWp = firstWp
If nextWp <> "" Then
Dim cmd : cmd = """" & UMDESKTOP_EXE & """ /load " & nextWp
sh.Run cmd
End If
fso.DeleteFile(dirWps & chkFile)
Wscript.Quit
|
Edwin 2008-09-29 22:53
just a question. Does anyone know if there are plans to build a wallpaper changer into UltraMon?
Cheers
|
Christian Studer 2008-09-30 00:26
Will be considered for a future release, certainly not before 3.0 final though.
Christian Studer - www.realtimesoft.com
|
Post Reply
|