wrote:
> Anyone know a way to get the location of the current background image
> (for deletion) to load it into a variable?
Hi David,
maybe you can find something useful in these scriptlets, basically they
let you save/change/restore wallpapers - mind that they haven't been
thoroughly tested, though I've had them in use for several months.
start reading from @_wallpaper_test
and mind folded long lines.
--sgp
; apply wallpaper stile arg(1) with file arg(2)
; use "" to clear wallpaper - writes to registry
@_apply_wallpaper
do("wallpaper style "++arg(1))
if( "" != arg(2) )do
do("wallpaper show "++arg(2))
else
;win.debug(scriptname,"writing to registry",registry.set_string
(?"HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper",""))
endif
quit
; save current wallpaper style and file
; reads style from the registry
@wallpaper_save
static prevpaper=paper
registry.error_dialog_off() ;; neutralize error dialog on non-existent
keys
registry.returns_values() ;; want data not status
static prevstyle
local reg=registry.get_string(?"HKEY_CURRENT_USER\Control Panel\Desktop
\WallpaperStyle")
;win.debug(scriptname,"reg="++reg)
if ("2" == reg )do
prevstyle = "stretch"
else
reg=registry.get_string(?"HKEY_CURRENT_USER\Control Panel\Desktop
\TileWallpaper")
;win.debug(scriptname,"reg="++reg)
prevstyle=ifelse("0" == reg, "center", "tile")
endif
;win.debug(scriptname,"wallpaper: <"++prevpaper++"> styled
<"++prevstyle++">")
quit
; restores previous wallpaper style and file
; call [EMAIL PROTECTED] before calling this label
@wallpaper_restore
; guard against improper usage by checking if prevstyle is non-null, as
it's
; always the case after a call to [EMAIL PROTECTED]
if( "" != prevstyle )do
[EMAIL PROTECTED](prevstyle,prevpaper)
endif
quit
@_wallpaper_test
local w=pprofolder++?"media\test.bmp"
[EMAIL PROTECTED]
[EMAIL PROTECTED]("","")
messagebox("ok","should be no wallpaper")
[EMAIL PROTECTED]("tile",w)
messagebox("ok","should be tiled "++w)
[EMAIL PROTECTED]("center",w)
messagebox("ok","should be centered "++w)
[EMAIL PROTECTED]("stretch",w)
messagebox("ok","should be stretched "++w)
;test save/restore
local bakstyle=prevstyle
local bakpaper=prevpaper
[EMAIL PROTECTED]("","")
messagebox("ok","should be no wallpaper")
[EMAIL PROTECTED]("stretch",w)
[EMAIL PROTECTED]
messagebox("ok","")
[EMAIL PROTECTED]("tile",w)
[EMAIL PROTECTED]
messagebox("ok","should be stretched TODO: FIX BUG "++w)
;clean up
[EMAIL PROTECTED](bakstyle,backpaper)
[EMAIL PROTECTED]
quit
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/