diff options
Diffstat (limited to 'src/wixstdba/WixStandardBootstrapperApplication.cpp')
-rw-r--r-- | src/wixstdba/WixStandardBootstrapperApplication.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index dd7ad229..8d07c760 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -2300,8 +2300,6 @@ private: // privates | |||
2300 | int x = CW_USEDEFAULT; | 2300 | int x = CW_USEDEFAULT; |
2301 | int y = CW_USEDEFAULT; | 2301 | int y = CW_USEDEFAULT; |
2302 | POINT ptCursor = { }; | 2302 | POINT ptCursor = { }; |
2303 | HMONITOR hMonitor = NULL; | ||
2304 | MONITORINFO mi = { }; | ||
2305 | 2303 | ||
2306 | // If the theme did not provide an icon, try using the icon from the bundle engine. | 2304 | // If the theme did not provide an icon, try using the icon from the bundle engine. |
2307 | if (!hIcon) | 2305 | if (!hIcon) |
@@ -2344,20 +2342,12 @@ private: // privates | |||
2344 | // Center the window on the monitor with the mouse. | 2342 | // Center the window on the monitor with the mouse. |
2345 | if (::GetCursorPos(&ptCursor)) | 2343 | if (::GetCursorPos(&ptCursor)) |
2346 | { | 2344 | { |
2347 | hMonitor = ::MonitorFromPoint(ptCursor, MONITOR_DEFAULTTONEAREST); | 2345 | x = ptCursor.x; |
2348 | if (hMonitor) | 2346 | y = ptCursor.y; |
2349 | { | ||
2350 | mi.cbSize = sizeof(mi); | ||
2351 | if (::GetMonitorInfoW(hMonitor, &mi)) | ||
2352 | { | ||
2353 | x = mi.rcWork.left + (mi.rcWork.right - mi.rcWork.left - m_pTheme->nWidth) / 2; | ||
2354 | y = mi.rcWork.top + (mi.rcWork.bottom - mi.rcWork.top - m_pTheme->nHeight) / 2; | ||
2355 | } | ||
2356 | } | ||
2357 | } | 2347 | } |
2358 | 2348 | ||
2359 | m_hWnd = ::CreateWindowExW(0, wc.lpszClassName, m_pTheme->sczCaption, dwWindowStyle, x, y, m_pTheme->nWidth, m_pTheme->nHeight, HWND_DESKTOP, NULL, m_hModule, this); | 2349 | hr = ThemeCreateParentWindow(m_pTheme, 0, wc.lpszClassName, m_pTheme->sczCaption, dwWindowStyle, x, y, HWND_DESKTOP, m_hModule, this, THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, &m_hWnd); |
2360 | ExitOnNullWithLastError(m_hWnd, hr, "Failed to create window."); | 2350 | ExitOnFailure(hr, "Failed to create window."); |
2361 | 2351 | ||
2362 | hr = S_OK; | 2352 | hr = S_OK; |
2363 | 2353 | ||
@@ -2601,7 +2591,7 @@ private: // privates | |||
2601 | // OnCreate - finishes loading the theme. | 2591 | // OnCreate - finishes loading the theme. |
2602 | // | 2592 | // |
2603 | BOOL OnCreate( | 2593 | BOOL OnCreate( |
2604 | __in HWND hWnd | 2594 | __in HWND /*hWnd*/ |
2605 | ) | 2595 | ) |
2606 | { | 2596 | { |
2607 | HRESULT hr = S_OK; | 2597 | HRESULT hr = S_OK; |
@@ -2612,7 +2602,7 @@ private: // privates | |||
2612 | BA_FUNCTIONS_ONTHEMELOADED_ARGS themeLoadedArgs = { }; | 2602 | BA_FUNCTIONS_ONTHEMELOADED_ARGS themeLoadedArgs = { }; |
2613 | BA_FUNCTIONS_ONTHEMELOADED_RESULTS themeLoadedResults = { }; | 2603 | BA_FUNCTIONS_ONTHEMELOADED_RESULTS themeLoadedResults = { }; |
2614 | 2604 | ||
2615 | hr = ThemeLoadControls(m_pTheme, hWnd, vrgInitControls, countof(vrgInitControls)); | 2605 | hr = ThemeLoadControls(m_pTheme, vrgInitControls, countof(vrgInitControls)); |
2616 | BalExitOnFailure(hr, "Failed to load theme controls."); | 2606 | BalExitOnFailure(hr, "Failed to load theme controls."); |
2617 | 2607 | ||
2618 | C_ASSERT(COUNT_WIXSTDBA_PAGE == countof(vrgwzPageNames)); | 2608 | C_ASSERT(COUNT_WIXSTDBA_PAGE == countof(vrgwzPageNames)); |