diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
| commit | ff659159e041bf6c083e6b7fcb9b726065a9dd73 (patch) | |
| tree | ea95bf3d3e031edcee65de33b9e6954178be669c /src/ext/Util/ca/BroadcastSettingChange.cpp | |
| parent | 8a8a25695351ee542f08886a9d0957c78c6af366 (diff) | |
| download | wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.gz wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.bz2 wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.zip | |
Move Util.wixext into ext
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 | } | ||
