From acc7a5f9ffef197f3dfb75ba4c499d6eb2d4e521 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 12 Feb 2016 15:21:46 -0700 Subject: [PATCH] Add broadcast_change function from 2016.3 from #30800 --- salt/modules/reg.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/salt/modules/reg.py b/salt/modules/reg.py index 1e0fe643fb..557e0d2ce6 100644 --- a/salt/modules/reg.py +++ b/salt/modules/reg.py @@ -131,6 +131,15 @@ def _key_exists(hive, key, use_32bit_registry=False): return False +def broadcast_change(): + ''' + Refresh the windows environment. + ''' + # https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952(v=vs.85).aspx + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, + SMTO_ABORTIFHUNG, 5000) + + def read_value(hive, key, vname=None, use_32bit_registry=False): r''' Reads a registry value entry or the default value for a key.