WM_SETTINGCHANGE and WM_WININICHANGE are the same messages.
However although if i use SendMessageTimeout as u wrote, it does not work,
the registry is not updated.
(by the way if i send for example a WM_CLOSE all programs are cloesd, so
SendMessageTimeout works but it does not effect the registry)
"Carl Daniel [VC++ MVP]" <(E-Mail Removed)>
wrote in message news:(E-Mail Removed)...
> Anil Bakirci wrote:
>> Here is the example :
>> public static class Refresher
>> {
>> public static void ReloadSettings()
>> {
>> SafeNativeMethods.PostMessage(SafeNativeMethods.HWND_BROADCAST,
>> SafeNativeMethods.WM_WININICHANGE, 0, 5000);
>> }
>> }
>
> The message you need to post is WM_SETTINGCHANGE
>
> In C++:
>
> SendMessageTimeout(
> HWND_BROADCAST,
> WM_SETTINGCHANGE,
> 0,
> (LPARAM) "Environment",
> SMTO_ABORTIFHUNG,
> 5000,
> &dwReturnValue
> );
>
> See
> http://msdn.microsoft.com/library/en...asp?frame=true
>
> -cd
>
>
>
>