
Changing Desktop Wallpaper from code using JPG files
I have sucessfully use SystemParametersInfo API calls for several years to
change the Wallpaper from code. I recently upgraded to Win98 and found out
that you can use JPF files as well as BMP files as Wallpaper. Neat! I
thought I'd quickly modify my code to include JPG file names and send them
using SystemParametersInfo as follows:
iRc = SystemParametersInfo(SPIF_SETDESKWALLPAPER, 0&, "(None)",
SPIF_SENDWININICHANGE)
DoEvents
iRc = SystemParametersInfo(SPIF_SETDESKWALLPAPER, 0&, sFileName,
SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
To my chagrin, this method only works with BMP files, although I can
manually choose a JPG file from the Desktop Properties applet.
Does anyone know how to use VB code to change the Wallpaper to a JPG
file????
Alfons