c++ change desktop wallpaper
right- currently I have this code:
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
SystemParametersInfo( SPI_SETDESKWALLPAPER, 0, "c:/kovtunets2.jpg", SPIF_UPDATEINIFILE );
cin.get();
return 0;
}
the problem is that my wallpaper doesn't change :(
Re: c++ change desktop wallpaper
you must convert it to .bmp first and then pass bmp in SystemParametersInfo
Re: c++ change desktop wallpaper
yeah I tried with bmp also (converted it)
SystemParametersInfo( SPI_SETDESKWALLPAPER, 0, "C:/kovtunets2.bmp", SPIF_UPDATEINIFILE );
cin.get();
return 0;
still nothing...
Re: c++ change desktop wallpaper
just tested it , its not working with jpg, bmp works fine
even your code is working correctly with bmp
Re: c++ change desktop wallpaper
what is "C:/kovtunets2.bmp" ??
It should be.. "C:\\kovtunets2.bmp"
Re: c++ change desktop wallpaper
actually both are correct