Enes
Enes

Reputation: 283

Changing Background-Image on Windows

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

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

Upvotes: 1

Views: 3386

Answers (1)

Software_Designer
Software_Designer

Reputation: 8587

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;
}

Upvotes: 3

Related Questions