|
-
October 17th, 2009, 10:08 AM
#1
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
-
October 18th, 2009, 06:55 AM
#2
Re: c++ change desktop wallpaper
you must convert it to .bmp first and then pass bmp in SystemParametersInfo
-
October 18th, 2009, 09:35 AM
#3
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...
-
October 18th, 2009, 09:47 AM
#4
Re: c++ change desktop wallpaper
just tested it , its not working with jpg, bmp works fine
even your code is working correctly with bmp
-
October 20th, 2009, 02:32 AM
#5
Re: c++ change desktop wallpaper
what is "C:/kovtunets2.bmp" ??
It should be.. "C:\\kovtunets2.bmp"
-
October 20th, 2009, 06:44 AM
#6
Re: c++ change desktop wallpaper
actually both are correct
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|