1

How can I change background-image of desktop with C++ on Windows?

Or Is there any command for this process to using at cmd?

Enes
  • 301
  • 2
  • 7
  • 15

1 Answers1

3

You can change the background image of the desktop with SystemParametersInfo().

#include "stdafx.h"
#include <windows.h>

int main() {

    int return_value = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, L"d:/flower1.jpg", SPIF_UPDATEINIFILE);

    return 0;
}
Software_Designer
  • 8,490
  • 3
  • 24
  • 28