Julien-Manici.com Follow me on Twitter: @jmaniciLanguage : French | English

Windows 7 Logon Background Changer Source Code (.net WPF Open Source)

Source Code - For developers

This is the source code of Windows 7 Logon background changer (built with Visual Studio 2008, in C# with .net framework 3.5).

To download the executable application, use the download link above.

You can download the source code, modify it, and use it to build your own applications as long as there is an about box or readme file in your application that contains the URL of this page (http://www.julien-manici.com/windows_7_logon_background_changer/). You would also be nice to tell me if this source code has been useful to you in a way or another :)
If you think something is badly implemented in my application, don't hesitate to tell me how you think I could improve it, especially if it is about performance, which I think (and hope) can be improved.

23 comments - Add a comment

Download

New

Posted by David Alejandro on 2012/01/03 04:47
Thank you, I love how it looks, lets make some coding!!
Reply
Posted by Raaghav on 2011/12/17 08:50
Here is the sample to change Wallpaper written for Windows form based application. Here use a Timer-Control and 'ShowInTaskbar' option of Form to 'False' and 'WindowState' to 'Minimized'.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
//using System.Timers;

namespace Screen
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, string pvParam, UInt32 fWinIni);
static FileInfo[] images;
static int currentImage;

private void timer1_Tick(object sender, EventArgs e)
{
const uint SPI_SETDESKWALLPAPER = 20;
const int SPIF_UPDATEINIFILE = 0x01;
const int SPIF_SENDWININICHANGE = 0x02;
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, images[currentImage++].FullName, SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
currentImage = (currentImage >= images.Length) ? 0 : currentImage;
}

private void Form1_Load(object sender, EventArgs e)
{
DirectoryInfo dirInfo = new DirectoryInfo(@"C:\TEMP");
images = dirInfo.GetFiles("*.jpg", SearchOption.TopDirectoryOnly);
currentImage = 0;
}
}
}
Reply
Posted by Lucky Bhumkar on 2011/07/29 07:38
Thanks friend for sharing this valuable source..
Reply
Posted by Teddy on 2011/07/07 17:52
you teach me a lot ,although there is no reply for me ,thanks all the same!
Reply
Posted by Sean T on 2011/01/01 08:23
Ever since I ran this it takes like twice as long to get to the login screen and I don\'t know anything about C# so could you tell me what it does so I can try and fix whatever is slowing my computer down.
Reply
Posted by Jase on 2011/04/16 06:31
Found the same slow down as Sean T.
couldnt find anything in the code that slows it down

unless its just loading the picture (file isnt optimised in location, and drive frag wont help this) and the chewing of resources during peak load time.

still looking thou.
Reply
Posted by Julien MANICI on 2011/01/01 17:28
Hi,
as anyone can see by looking at the source code, my app doesn't load anything on the computer startup.
It just uses the documented way to set a logon wallpaper on windows 7: it creates the appropriate picture sizes in C:\Windows\System32\oobe\Info\backgrounds.
To revert the changes, just delete the content of this folder.

But I can tell you that your startup slowness issue will probably still be here because it doesn't come from my app (you should look at the other apps/drivers you installed recently)
Reply
New

Show all other comments ...