Hi guys

First post on this website, so go easy on me.

I'm a fairly inexperienced programmer, mostly using snippets of other people's code and adapting it for my own uses, but I have found a problem. I want to change my desktop programatically, but to a picture on the internet, not on my hard drive. I have included my current code. Is there anything I have to change to make it work, like an addition to the url of the picture?

The code compiles fine, but it just changes my desktop to grey instead of the image. Also, it works with any .bmp images on my hard drive.

#include <windows.h>

int main()
{
    SystemParametersInfo( SPI_SETDESKWALLPAPER, 0, (PVOID) "http://www.deh.enr.state.nc.us/pws/rules/bitmap%20enr%20logo.bmp" , SPIF_UPDATEINIFILE ); // Just an example url
}
Member Avatar for iamthwee

maybe you'd have to use Curl or something to save the picture from the website onto your harddrive then call that function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.