1

So I want to make a GUI app where a person can choose between 2 background options: IDR_BACKGROUND1, and IDR_BACKGROUND2(that's how they are defined in Resource.h). How can I load the resources in code? I believe that syntax for changing the background is :

    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (here comes the path for 
    image), SPIF_UPDATEINIFILE);

but as I said, I don't know how to do it. Pls help :))

Th3R4nd0m
  • 11
  • 1
  • Possible duplicate of [SystemParametersInfo sets wallpaper completly black (using SPI\_SETDESKWALLPAPER)](https://stackoverflow.com/questions/34710677/systemparametersinfo-sets-wallpaper-completly-black-using-spi-setdeskwallpaper) It shows you how to correctly use `SystemParametersInfo(SPI_SETDESKWALLPAPER,...)`. – Ken White Apr 19 '19 at 20:36
  • The thing is that I don't know how to use a embedded resource, like IDR_BACKGROUND1. – Th3R4nd0m Apr 20 '19 at 06:20
  • The documentation tells you that the file is from disk, not an embedded resource. Extract the resource to a disk file, and then set that file as the wallpaper. – Ken White Apr 20 '19 at 13:06
  • oh, right. Thanks =) – Th3R4nd0m Apr 20 '19 at 17:54

0 Answers0