Issue with Wallpaper Turning Black After Logout/Login Using SystemParametersInfo in Remote Control
Hi, I am remotely controlling a Windows device through an agent. I set the desktop wallpaper using the following APIs:
SystemParametersInfo(SPI_GETDESKWALLPAPER, MAX_PATH, m_strWallPaperName, 0);
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, m_strWallPaperName, SPIF_SENDCHANGE);
When I first log into the device, the wallpaper is applied correctly. Also, when switching users, the wallpaper updates properly for the next user.
However, if I log out and then log back in (as same or different user), the wallpaper turns black. Interestingly, even when the wallpaper turns black, the registry key that stores the wallpaper path remains correct.
My questions are:
From where does Windows fetch the wallpaper after a user logs back in?
Is there a method (other than directly modifying the registry) to correctly apply the wallpaper even after a full logout/login?
Any insights or suggestions would be highly appreciated. Thank you!