aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/ca/BroadcastSettingChange.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-05-11 07:47:12 -0700
committerRob Mensching <rob@firegiant.com>2021-05-11 07:47:12 -0700
commit0923aba915ca2450cc87e3e2c6c0e4e3d2b28294 (patch)
tree994f53dc35c927d219f4b8cae3f522a5f163473b /src/ext/Util/ca/BroadcastSettingChange.cpp
parent68cc62fc46efac3375aef5694e9f645ac09b622f (diff)
parentff659159e041bf6c083e6b7fcb9b726065a9dd73 (diff)
downloadwix-0923aba915ca2450cc87e3e2c6c0e4e3d2b28294.tar.gz
wix-0923aba915ca2450cc87e3e2c6c0e4e3d2b28294.tar.bz2
wix-0923aba915ca2450cc87e3e2c6c0e4e3d2b28294.zip
Merge Util.wixext
Diffstat (limited to 'src/ext/Util/ca/BroadcastSettingChange.cpp')
-rw-r--r--src/ext/Util/ca/BroadcastSettingChange.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ext/Util/ca/BroadcastSettingChange.cpp b/src/ext/Util/ca/BroadcastSettingChange.cpp
new file mode 100644
index 00000000..2e153ad3
--- /dev/null
+++ b/src/ext/Util/ca/BroadcastSettingChange.cpp
@@ -0,0 +1,45 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3#include "precomp.h"
4
5
6/********************************************************************
7WixBroadcastSettingChange
8
9 Send WM_SETTINGCHANGE message to all top-level windows indicating
10 that unspecified settings have changed.
11********************************************************************/
12extern "C" UINT __stdcall WixBroadcastSettingChange(
13 __in MSIHANDLE hInstall
14 )
15{
16 HRESULT hr = WcaInitialize(hInstall, "WixBroadcastSettingChange");
17 ExitOnFailure(hr, "failed to initialize WixBroadcastSettingChange");
18
19 // best effort; ignore failures
20 ::SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL, SMTO_ABORTIFHUNG, 1000, NULL);
21
22LExit:
23 return WcaFinalize(ERROR_SUCCESS);
24}
25
26
27/********************************************************************
28WixBroadcastEnvironmentChange
29
30 Send WM_SETTINGCHANGE message to all top-level windows indicating
31 that environment variables have changed.
32********************************************************************/
33extern "C" UINT __stdcall WixBroadcastEnvironmentChange(
34 __in MSIHANDLE hInstall
35 )
36{
37 HRESULT hr = WcaInitialize(hInstall, "WixBroadcastEnvironmentChange");
38 ExitOnFailure(hr, "failed to initialize WixBroadcastEnvironmentChange");
39
40 // best effort; ignore failures
41 ::SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, reinterpret_cast<LPARAM>(L"Environment"), SMTO_ABORTIFHUNG, 1000, NULL);
42
43LExit:
44 return WcaFinalize(ERROR_SUCCESS);
45}