/* ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป บ Wallpaper.Cmd บ บ Version 1.10, 22/01/1998 บ บ (C) 1997, 1998, Rob van der Woude บ บ บ บ Changes OS/2 background randomly at execution. This file - or a program บ บ object of it - should be placed in OS/2's startup folder. บ บ บ บ Most recent update 22/01/1998: บ บ Added GIF/JPG support and OS/2 version check for Lockup setting. บ ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ */ userini = value( "USER_INI", , "OS2ENVIRONMENT" ) path = value( "PATH", , "OS2ENVIRONMENT" ) parse upper value path with "\OS2\SYSTEM" -2 bootdrive +2 bitmapdir = bootdrive||"\OS2\BITMAP\*.BMP" gifdir = bootdrive||"\OS2\BITMAP\*.GIF" jpgdir = bootdrive||"\OS2\BITMAP\*.JPG" parse source os type program /* Load RexxUtil */ call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs" call SysLoadFuncs /* ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป บ 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 change the starting บ บ directories for each individual bitmap type. You could also add more บ บ bitmap directories or more bitmap types, if your version of OS/2 will บ บ support them. You get the idea . . . บ ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ */ call SysFileTree bitmapdir, "bitmap.", "FO", "*-*+*" call SysFileTree gifdir, "gif.", "FO", "*-*+*" call SysFileTree jpgdir, "jpg.", "FO", "*-*+*" pict. = "" /* List all BMP files */ if bitmap.0 > 0 then do i = 1 to bitmap.0 pict.i = bitmap.i end pict.0 = bitmap.0 /* Add all GIF files to the list */ if gif.0 > 0 then do i = 1 to gif.0 j = pict.0 + i pict.j = gif.i end pict.0 = pict.0 + gif.0 /* Add all JPG files to the list */ if jpg.0 > 0 then do i = 1 to jpg.0 j = pict.0 + i pict.j = jpg.i end pict.0 = pict.0 + gif.0 /* Quit if no bitmaps were found */ if pict.0 = 0 then exit /* Randomly pick two bitmaps, one as the Desktop */ /* background and another one as a Lockup bitmap */ pictnum = random( 1, pict.0 ) pict1 = translate( pict.pictnum ) pictnum = random( 1, pict.0 ) pict2 = translate( pict.pictnum ) say say " Background bitmap : "||pict1 say " Lockup bitmap : "||pict2 call SysSetObjectData "", "BACKGROUND="||pict1||",S,1,I,0 0 0;" /* ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป บ If IBM might still release OS/2 Warp 5 or later, you should change the บ บ line checking for Warp 4 (2.40) to Warp 4 or later. บ ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ */ setupstring = "LOCKUPBACKGROUND="||pict2||",S,1,I,0 0 0;" if SysOS2Ver( ) = 2.40 then call SysSetObjectData "", setupstring exit