diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-03 15:30:50 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-04 10:05:21 -0500 |
commit | 29f7e00586412163a20e298fbf84505f8a917425 (patch) | |
tree | 30257a3544f6982ded159443ebed0eb933f11a51 /src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |
parent | 41d2c12d60ee84cefc26ec99abb328701883c8f5 (diff) | |
download | wix-29f7e00586412163a20e298fbf84505f8a917425.tar.gz wix-29f7e00586412163a20e298fbf84505f8a917425.tar.bz2 wix-29f7e00586412163a20e298fbf84505f8a917425.zip |
Only block shutdown during Apply.
Diffstat (limited to 'src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp')
-rw-r--r-- | src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp index 7c533fea..3cf994fc 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |||
@@ -88,6 +88,56 @@ public: // IBAFunctions | |||
88 | return hr; | 88 | return hr; |
89 | } | 89 | } |
90 | 90 | ||
91 | virtual STDMETHODIMP WndProc( | ||
92 | __in HWND hWnd, | ||
93 | __in UINT uMsg, | ||
94 | __in WPARAM /*wParam*/, | ||
95 | __in LPARAM lParam, | ||
96 | __inout BOOL* pfProcessed, | ||
97 | __inout LRESULT* plResult | ||
98 | ) | ||
99 | { | ||
100 | switch (uMsg) | ||
101 | { | ||
102 | case WM_QUERYENDSESSION: | ||
103 | if (BOOTSTRAPPER_DISPLAY_FULL <= m_command.display) | ||
104 | { | ||
105 | DWORD dwEndSession = static_cast<DWORD>(lParam); | ||
106 | if (ENDSESSION_CRITICAL & dwEndSession) | ||
107 | { | ||
108 | // Return false to get the WM_ENDSESSION message so that critical shutdowns can be delayed. | ||
109 | *plResult = FALSE; | ||
110 | *pfProcessed = TRUE; | ||
111 | } | ||
112 | } | ||
113 | break; | ||
114 | case WM_ENDSESSION: | ||
115 | if (BOOTSTRAPPER_DISPLAY_FULL <= m_command.display) | ||
116 | { | ||
117 | ::MessageBoxW(hWnd, L"WM_ENDSESSION", L"BAFunctions WndProc", MB_OK); | ||
118 | } | ||
119 | break; | ||
120 | } | ||
121 | return S_OK; | ||
122 | } | ||
123 | |||
124 | public: //IBootstrapperApplication | ||
125 | virtual STDMETHODIMP OnExecuteBegin( | ||
126 | __in DWORD /*cExecutingPackages*/, | ||
127 | __inout BOOL* pfCancel | ||
128 | ) | ||
129 | { | ||
130 | if (BOOTSTRAPPER_DISPLAY_FULL <= m_command.display) | ||
131 | { | ||
132 | if (IDCANCEL == ::MessageBoxW(m_hwndParent, L"Shutdown requests should be denied right now.", L"OnExecuteBegin", MB_OKCANCEL)) | ||
133 | { | ||
134 | *pfCancel = TRUE; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | return S_OK; | ||
139 | } | ||
140 | |||
91 | private: | 141 | private: |
92 | HRESULT OnShowTheme() | 142 | HRESULT OnShowTheme() |
93 | { | 143 | { |
@@ -138,6 +188,8 @@ private: | |||
138 | 188 | ||
139 | ThemeInitializeWindowClass(m_pBafTheme, &wc, CBafThmUtilTesting::TestingWndProc, m_hModule, BAFTHMUTILTESTING_WINDOW_CLASS); | 189 | ThemeInitializeWindowClass(m_pBafTheme, &wc, CBafThmUtilTesting::TestingWndProc, m_hModule, BAFTHMUTILTESTING_WINDOW_CLASS); |
140 | 190 | ||
191 | Assert(wc.lpszClassName); | ||
192 | |||
141 | // If the theme did not provide an icon, try using the icon from the bundle engine. | 193 | // If the theme did not provide an icon, try using the icon from the bundle engine. |
142 | if (!wc.hIcon) | 194 | if (!wc.hIcon) |
143 | { | 195 | { |