Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program an animated background application in C#

I would like to start a Summer Project just for the sake of improving my programming skills. For this I thought it would be nice if I can program an application that will run an animated image or something similar on a windows machine as wallpaper.

For instance I would like to replace the entire screen resolution with some random colored squares that will individually change color at specific intervals. However I just realized that I have no clue on how or were to start from and all the programming I have done in my first two years of study are useless for this particular task.

Could someone put me on the right direction on how to go about. I would like to do some reading but I have now clue what would help me achieve this.

To keep it clearer WHAT DO I NEED TO KNOW before I embark on this this project?

Regards.

like image 502
user9349193413 Avatar asked Feb 24 '23 06:02

user9349193413


2 Answers

You want to create an image and save it as some sort of image file. Then use SystemParametersInfo() to set the background passing in SPI_SETDESKWALLPAPER as a flag and also as one of the other parameters your saved file.

Some example code is here: http://social.msdn.microsoft.com/Forums/en-US/windowssdk/thread/8a07f1f9-30ba-40ea-9eef-5f405d666849/

To change it at intervals, you can set a timer which forces regeneration of a new image at set delays, then again call the SystemParametersInfo() as earlier.

Note that your saved image must be .bmp format.

like image 161
Mike Kwan Avatar answered Feb 26 '23 18:02

Mike Kwan


Wouldn't this be simpler as a screen saver? If you're interested, you can read up on how to develop a screensaver at http://www.codeproject.com/KB/cs/scrframework.aspx (albeit an old article)

like image 40
Daniel Frear Avatar answered Feb 26 '23 19:02

Daniel Frear