Search code examples
c#windowsbackgroundanimated

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.


Solution

  • 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.