diff options
Diffstat (limited to 'src/ext/Util/ca/BroadcastSettingChange.cpp')
| -rw-r--r-- | src/ext/Util/ca/BroadcastSettingChange.cpp | 45 |
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 | /******************************************************************** | ||
| 7 | WixBroadcastSettingChange | ||
| 8 | |||
| 9 | Send WM_SETTINGCHANGE message to all top-level windows indicating | ||
| 10 | that unspecified settings have changed. | ||
| 11 | ********************************************************************/ | ||
| 12 | extern "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 | |||
| 22 | LExit: | ||
| 23 | return WcaFinalize(ERROR_SUCCESS); | ||
| 24 | } | ||
| 25 | |||
| 26 | |||
| 27 | /******************************************************************** | ||
| 28 | WixBroadcastEnvironmentChange | ||
| 29 | |||
| 30 | Send WM_SETTINGCHANGE message to all top-level windows indicating | ||
| 31 | that environment variables have changed. | ||
| 32 | ********************************************************************/ | ||
| 33 | extern "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 | |||
| 43 | LExit: | ||
| 44 | return WcaFinalize(ERROR_SUCCESS); | ||
| 45 | } | ||
