Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I manually change the background image in the registry, how can I force it to refresh without logging off?

I know that bginfo does it, but I would like to keep things simple and not use any software.

share|improve this question

3 Answers 3

up vote 4 down vote accepted
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters, 1, True
share|improve this answer
    
This doesn't seem to work in win7 x64... anyone have something that works for that? –  Jon Kloske Apr 29 at 1:50
  • Open Task manager
  • Kill explorer.exe
  • If the shell doesn't immediately restart
  • From the menu select File > New Task
  • Type "explorer.exe" and hit enter.
share|improve this answer

I was trying to do something similar - update a registry setting for the start menu and then immediately have the start menu reflect the changes.

The solution from this MSDN question worked for me perfectly.

You could try broadcasting a WM_SETTINGCHANGE message. For example:

class Program
{
    [DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr SendMessageTimeout(IntPtr hWnd, int Msg, IntPtr wParam, string lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);

    private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff);
    private const int WM_SETTINGCHANGE = 0x1a;
    private const int SMTO_ABORTIFHUNG = 0x0002;

    static void Main(string[] args)
    {
        SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, null, SMTO_ABORTIFHUNG, 100, IntPtr.Zero);
    }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.