OWL NExt - Knowledge Base

[ Home | Contents | Search | Next | Previous | Up ]

How do I change the Windows wallpaper in code?

Date: 12/1/99
Time: 10:04:20 PM

Question:

How do I change the Windows wallpaper in code?

Answer:

Call the Windows API function SystemParametersInfo() passing the SPI_SETDESKWALLPAPER parameter along with the filename of the new bitmap to use.

Example:

SystemParametersInfo(SPI_SETDESKWALLPAPER,
                                0,
                                "C:\\SOMEPATH\\SOME.BMP",
                                SPIF_SENDWININICHANGE);

Last changed: July 14, 2001