Hi everyone. I heard that it is possible to code up a small program to randomly change windows desktop bg pic. I havent got any code (as i dont know how to do it) so could some plz tell me, or direct me to a site or something. Btw this isnt homework, just something im curious about!

many thx in advance

Hello,

I would guess that this is handled by the Windows Registry. You can make what is called a .reg file that inserts information into the registry. You could write a C++ code to prompt the user the desktop options, and then have the C++ program make the registry edit. You would also need to specify if you want the current user to only receive the edit, or the whole bunch.

Do a search on Windows Desktop Registry. See what you find.

Christian

i did a search of the registry, although i used fairly clear keyterms, i coudlnt find anything. Thanks for the help though Christian. Does anyone know how to do it?

Actually you can do this programatically fairly easily...
Using Windows API's SystemParametersInfo with SPI_SETDESKWALLPAPER.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp

I don't program in Win32 anymore, so the if you get stuck try looking here:
http://www.c-sharpcorner.com/Code/2002/Sept/ChangeWallpaper.asp
You should be able to figure out which constants correspond to the given values in the example.

Have fun!


Ed

thx a lot, massive help. just 1 question. What thing in "File->New" do i click on in Microsoft Visual C++?. thnx again :)

New Project?

...what kind of project?

...what kind of project?

Hmmm...well it appears that you're in Visual C++ so what kind of project do you think that a person might make in a C++ IDE? This isn't rocket science my friend....

commented: This isn't rocket science my friend - but reading thread dates is - LMAO -1

Hmmm...well it appears that you're in Visual C++ so what kind of project do you think that a person might make in a C++ IDE? This isn't rocket science my friend....

After nearly 3 YEARS, do you really think that the OP cares?

After nearly 3 YEARS, do you really think that the OP cares?

Haha, I found this while looking for something else on Google. I never even checked the date. I'm sorry.

Actually you can do this programatically fairly easily...
Using Windows API's SystemParametersInfo with SPI_SETDESKWALLPAPER.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp

I don't program in Win32 anymore, so the if you get stuck try looking here:
http://www.c-sharpcorner.com/Code/2002/Sept/ChangeWallpaper.asp
You should be able to figure out which constants correspond to the given values in the example.

Have fun!


Ed

Hi,

Today i visited this page and found this usefull information. Great!
Using this function, i have created my own autimatic wallpaper changer.

Have fun!

Actually you can do this programatically fairly easily...
Using Windows API's SystemParametersInfo with SPI_SETDESKWALLPAPER.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp

I don't program in Win32 anymore, so the if you get stuck try looking here:
http://www.c-sharpcorner.com/Code/2002/Sept/ChangeWallpaper.asp
You should be able to figure out which constants correspond to the given values in the example.

Have fun!


Ed

could you give me an example of how a program that changes the wallpaper to flower.jpg, would look like?

and after 2 years these information are helpful for me ;) :p

You should read Microsoft SDK samples, where the Wallpaper changer exists for more than 15 years...

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.