
Changing wallpaper on desktop
From the FAQ document
Quote
I'm surprised this isn't in the FAQ yet. [ED: now it is!] You need the
SystemParametersInfo API function and the SPI_SETDESKWALLPAPER constant.
For this you will need the following constants and function declaration...
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_SENDWININICHANGE = &H2
Const SPIF_UPDATEINIFILE = &H1
Declare Function SystemParametersInfo Lib "User" (ByVal uAction As Integer,
ByVal uParam As Integer, lpvParam As Any, ByVal fuWinIni As Integer) As
Integer
'You then call the function as follows...
Result% = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal BMPFile$,
SPIFlags%)
'... where SPIFlags% is 0 if the change is not to be made permanent, or
'(SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE) if it is to be carried
across into future Windows sessions.
NOTE: Please be certain to include the ByVal keyword before the bitmap
filename, as this argument is declared as Any, NOT as ByVal String.
Unquote
--
Henri
remove "MyName"
: How do I change the desktop's wallpaper from within a VB app? Could
: someone supply me with the proper API call?
:
: Thanks!
: Mike Anderson
: Mb. Education & Training
: 307- 1181 Portage Ave
: Winnipeg, Manitoba
: (204) 945-1848
:
:
: