Marked as: Normal
Hello,
Below you'll see code on how to create a folder, open it and change the background image between the images available in the bitmap folder of the system.
The code ',S,1' below cause the images to appear scaled with factor/ratio of 1x1 for the folder.
/* Change folder (and desktop) background image */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
obj_id = 'BG_FLDR'
If SysCreateObject( 'WPFolder', 'Test Folder Backgrounds', '<WP_DESKTOP>', 'OBJECTID=<'obj_id'>', 'U' ) then
do
call SysSetObjectData '<'obj_id'>', 'OPEN=DEFAULT;'
say 'One moment please...searching for images'
call SysFileTree 'C:\OS2\BITMAP\*.*', 'file', 'FO'
do i = 1 to file.0
say 'Changing background to 'file.i
call SysSetObjectData '<'obj_id'>', 'BACKGROUND='file.i',S,1;'
call SysSleep 3
end
end
call SysDropFuncs