Home > Windows API > Applying registry changes without restarting explorer!

Applying registry changes without restarting explorer!

You make some changes to windows registry but can’t see the effect on explorer? Well you’ve got to do some more housekeeping to get going, broadcast a setting changed message to all windows to let them know and to get explorer refreshed…

DWORD dwResult = 0;
SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_ABORTIFHUNG, 100, &dwResult );

Lookup SystemParametersInfo to see if it’s already being done what you were trying to do!

  1. Bobby
    March 6, 2009 at 11:02 am

    You don’t have to.
    You could just post the other part of the code, if you don’t mind.
    Correct me if I’m wrong, that the above code is a part of the other codes (API maybe),
    since I couldn’t figure out what the parameters stands for, or the value they represents.

    (please ignore this post if it’s double post, suddenly I was disconnected !!)

  2. Bobby
    March 6, 2009 at 6:28 am

    Thanks for your fast response, even I’m gonna have to wait :).
    Right now I can only manage to restarting the explorer through code to apply the registry change, and it’s not what I’m really expected in my application, cause it had other effects. And in some computer with a slow processor speed it cost more than 3 seconds until the explorer is running again.

    • March 6, 2009 at 7:28 am

      I’ve got to find a VB expert who knows some C++ to translate this code. 🙂

  3. Bobby
    March 5, 2009 at 4:27 am

    I’m interested with this part of code.\
    Currently I’m building an application with VB 2005, and I guess your code is written in C.
    Can you please pot a full code, and it will be better if it’s converted to VB.
    Thanks in advance.

    • March 5, 2009 at 4:30 am

      Thanks Bobby,

      I’ll try to get this in VB for you, but will take some time. 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: