954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Program to change desktop background

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

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

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

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 

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?

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

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

cosi
Junior Poster
153 posts since Aug 2004
Reputation Points: 17
Solved Threads: 1
 

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

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

New Project?

cosi
Junior Poster
153 posts since Aug 2004
Reputation Points: 17
Solved Threads: 1
 

...what kind of project?

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 
...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....

missionpilot
Newbie Poster
5 posts since Oct 2006
Reputation Points: 9
Solved Threads: 0
 
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?

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
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.

missionpilot
Newbie Poster
5 posts since Oct 2006
Reputation Points: 9
Solved Threads: 0
 

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!

Vais
Newbie Poster
1 post since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

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?

kangarooblood
Light Poster
42 posts since Jun 2009
Reputation Points: 6
Solved Threads: 2
 

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

armin651987
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

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

marco93
Junior Poster
132 posts since Apr 2008
Reputation Points: -76
Solved Threads: 14
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You