(view source code of wallpapr.rex as plain text)
/* Check command line arguments (none required) */
Parse Arg cmdLineArgs
If cmdLineArgs <> "" Then Call Syntax
/* Initialize RexxUtil */
Call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
Call SysLoadFuncs
/* Initialize W32Funcs */
Call RxFuncAdd 'W32LoadFuncs', 'W32Util', 'W32LoadFuncs'
Call W32LoadFuncs
/* * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Current bitmap directory; %SystemRoot%\*.bmp. */
/* Modify if you want to use a different directory. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * */
dirBmp = Qualify( SysSystemDirectory( )||"\..\." )||"\*.bmp"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The lines calling SysFileTree were adapted so that only bitmaps marked */
/* read-only will be used; this allows you to make a selection of bitmaps */
/* without the need to move them into or out of your bitmap directories. */
/* You may remove the last parameter "*-*+*" to change this and use all */
/* bitmaps if you like, or replace "FO" with "FOS" to use bitmaps in */
/* subdirectories as well. Furthermore you could add more bitmap directories */
/* or more bitmap types, if your version of Windows will support them. */
/* Well, you get the idea . . . */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Call SysFileTree dirBmp, "arrBmp.", "FO", "*-*+*"
If arrBmp.0 > 0 Then Do
/* Randomly choose a bitmap from the array */
rnd = Random( 1, arrBmp.0 )
bitmap = arrBmp.rnd
/* Display the new wallpaper file name */
Say "New wallpaper: "||bitmap
/* Change the Desktop wallpaper */
Call W32SysSetParameter "DeskWallPaper", "NP", bitmap
End
Else Do
Call Syntax
End
/* Normal program termination */
Exit 0
Syntax:
Say
Say "WallPapr.rex, Version 1.01 for Windows NT 4 / 2000 / XP"
Say "Randomly change the Desktop background bitmap (wallpaper)"
Say
Say "Usage: REGINA.EXE WALLPAPR.REX"
Say
Say "Requires Regina Rexx with RexxUtil and W32Funcs installed."
Say "The current version of this script will only choose from bitmap files"
Say "that are marked read-only and are located in the WINNT directory."
Say "Read the comments in this script to find out how to change this behaviour."
Say
Say "Written by Rob van der Woude"
Say "http://www.robvanderwoude.com"
Exit 1
Return
page last modified: 2024-04-16; loaded in 0.0050 seconds