简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM