The SystemParametersInfo function queries or sets systemwide parameters. This function can also update the user profile while setting a parameter.
BOOL SystemParametersInfo(
UINT uiAction, // system parameter to query or set
UINT uiParam, // depends on action to be taken
PVOID pvParam, // depends on action to be taken
UINT fWinIni // user profile update flag
);
SPI_SETDESKWALLPAPER Sets the desktop wallpaper. The pvParam parameter must point to a null-terminated string containing the name of a bitmap file.