realbasic-nug
[Top] [All Lists]

Re: Setting Wallpaper on Windows

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Setting Wallpaper on Windows
From: Aaron Ballman <aaron at realsoftware dot com>
Date: Fri, 30 Aug 2002 09:33:31 -0500
on 8/30/02 8:37 AM, Carnivore devoured Herbert van Staveren at
hmvs at xs4all dot nl's message:

>>> Yes, but you would need to use declares to be able to do it.  If
>> you'd like
>>> to know the APIs to be watching for, just let me know and I'll dig
>> them up
>>> again.
>> 
> I would be very pleased,
> 

SetSystemParametersInfo(action as integer, param1 as integer, param2 as Ptr,
updateUserProfile as integer) as boolean

This would be the declare.  You can always check on a VB site to see if I'm
wrong somewhere in the syntax.

The function is exported from user32.lib, and available in every MS OS since
Win95.

To set the wallpaper, you will put in SPI_SETDESKWALLPAPER as action (it's
integer value 20).  Param1 is unused, so you can pass in 0.  param2 is going
to be a null-terminated string with the path and name of the bitmap you wish
to show on the desktop.  Passing in an empty string will remove the current
desktop wallpaper.  If you put in nil, it should revert the wallpaper back
to the default.  updateUserProfile can be 0 as well.  The function returns
true if it worked, and false if it failed.

HTH!  :-)

~Aaron

-- 
To me, boxing is like a ballet, except there's no music, no choreography,
and the dancers hit each other.



<Prev in Thread] Current Thread [Next in Thread>