aboutsummaryrefslogtreecommitdiff
path: root/src/burn
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn')
-rw-r--r--src/burn/engine/engine.cpp2
-rw-r--r--src/burn/engine/splashscreen.cpp19
2 files changed, 20 insertions, 1 deletions
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp
index 413db69b..334ea23b 100644
--- a/src/burn/engine/engine.cpp
+++ b/src/burn/engine/engine.cpp
@@ -132,7 +132,7 @@ extern "C" HRESULT EngineRun(
132 132
133 engineState.command.nCmdShow = nCmdShow; 133 engineState.command.nCmdShow = nCmdShow;
134 134
135 if (BURN_MODE_ELEVATED != engineState.internalCommand.mode && BOOTSTRAPPER_DISPLAY_NONE < engineState.command.display && !engineState.command.hwndSplashScreen) 135 if (BURN_MODE_ELEVATED != engineState.internalCommand.mode && BOOTSTRAPPER_DISPLAY_NONE < engineState.command.display)
136 { 136 {
137 SplashScreenCreate(hInstance, NULL, &engineState.command.hwndSplashScreen); 137 SplashScreenCreate(hInstance, NULL, &engineState.command.hwndSplashScreen);
138 } 138 }
diff --git a/src/burn/engine/splashscreen.cpp b/src/burn/engine/splashscreen.cpp
index 7ba4e630..d8618feb 100644
--- a/src/burn/engine/splashscreen.cpp
+++ b/src/burn/engine/splashscreen.cpp
@@ -13,6 +13,7 @@ struct SPLASHSCREEN_INFO
13 SIZE size; 13 SIZE size;
14 UINT nDpi; 14 UINT nDpi;
15 HWND hWnd; 15 HWND hWnd;
16 HWND hwndPrevious;
16}; 17};
17 18
18struct SPLASHSCREEN_CONTEXT 19struct SPLASHSCREEN_CONTEXT
@@ -258,6 +259,19 @@ static LRESULT CALLBACK WndProc(
258 case WM_ERASEBKGND: 259 case WM_ERASEBKGND:
259 OnEraseBkgnd(pSplashScreen, wParam); 260 OnEraseBkgnd(pSplashScreen, wParam);
260 return 1; 261 return 1;
262
263 case WM_ENTERIDLE:
264 lres = ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
265
266 // We had to create our own splash screen so that Windows would automatically transfer focus from the other process's splash screen.
267 // Try to make sure new splash screen has painted before closing old one to avoid flickering.
268 if (pSplashScreen->hwndPrevious)
269 {
270 ::PostMessageW(pSplashScreen->hwndPrevious, WM_CLOSE, 0, 0);
271 pSplashScreen->hwndPrevious = NULL;
272 }
273
274 return lres;
261 } 275 }
262 276
263 return ::DefWindowProcW(hWnd, uMsg, wParam, lParam); 277 return ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
@@ -276,6 +290,11 @@ static HRESULT LoadSplashScreen(
276 DPIU_MONITOR_CONTEXT* pMonitorContext = NULL; 290 DPIU_MONITOR_CONTEXT* pMonitorContext = NULL;
277 RECT* pMonitorRect = NULL; 291 RECT* pMonitorRect = NULL;
278 292
293 if (::IsWindow(*pContext->pHwnd))
294 {
295 pSplashScreen->hwndPrevious = *pContext->pHwnd;
296 }
297
279 pSplashScreen->nDpi = USER_DEFAULT_SCREEN_DPI; 298 pSplashScreen->nDpi = USER_DEFAULT_SCREEN_DPI;
280 pSplashScreen->hBitmap = ::LoadBitmapW(pContext->hInstance, MAKEINTRESOURCEW(pContext->pSplashScreenConfiguration->wResourceId)); 299 pSplashScreen->hBitmap = ::LoadBitmapW(pContext->hInstance, MAKEINTRESOURCEW(pContext->pSplashScreenConfiguration->wResourceId));
281 ExitOnNullWithLastError(pSplashScreen->hBitmap, hr, "Failed to load splash screen bitmap."); 300 ExitOnNullWithLastError(pSplashScreen->hBitmap, hr, "Failed to load splash screen bitmap.");