|
|
|
|
@ -508,7 +508,7 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
@@ -508,7 +508,7 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|
|
|
|
} |
|
|
|
|
return HRESULT_FROM_WIN32(ERROR_BUSY); |
|
|
|
|
} |
|
|
|
|
else if ((uMsg == WM_KEYUP && wParam == VK_ESCAPE) || (uMsg == WM_ACTIVATEAPP && wParam == FALSE && GetAncestor(GetForegroundWindow(), GA_ROOT) != _this->hWnd)) |
|
|
|
|
else if (uMsg == WM_CLOSE || (uMsg == WM_KEYUP && wParam == VK_ESCAPE) || (uMsg == WM_ACTIVATEAPP && wParam == FALSE && GetAncestor(GetForegroundWindow(), GA_ROOT) != _this->hWnd)) |
|
|
|
|
{ |
|
|
|
|
epw_Weather_Hide(_this); |
|
|
|
|
return 0; |
|
|
|
|
@ -531,7 +531,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
@@ -531,7 +531,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*if (uMsg == WM_CREATE)
|
|
|
|
|
BOOL bIsRunningWithoutVisualStyle = !IsThemeActive() || IsHighContrast(); |
|
|
|
|
if (uMsg == WM_CREATE) |
|
|
|
|
{ |
|
|
|
|
if (bIsRunningWithoutVisualStyle) |
|
|
|
|
{ |
|
|
|
|
SetRectEmpty(&_this->rcBorderThickness); |
|
|
|
|
if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_THICKFRAME) |
|
|
|
|
@ -546,7 +549,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
@@ -546,7 +549,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|
|
|
|
} |
|
|
|
|
SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (uMsg == WM_NCCALCSIZE) |
|
|
|
|
{ |
|
|
|
|
if (bIsRunningWithoutVisualStyle) |
|
|
|
|
{ |
|
|
|
|
if (lParam) |
|
|
|
|
{ |
|
|
|
|
@ -557,7 +563,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
@@ -557,7 +563,10 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (uMsg == WM_NCHITTEST) |
|
|
|
|
{ |
|
|
|
|
if (bIsRunningWithoutVisualStyle) |
|
|
|
|
{ |
|
|
|
|
LRESULT lRes = DefWindowProcW(hWnd, uMsg, wParam, lParam); |
|
|
|
|
if (lRes == HTCLIENT) |
|
|
|
|
@ -578,17 +587,20 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
@@ -578,17 +587,20 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|
|
|
|
return lRes; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (uMsg == WM_NCACTIVATE) |
|
|
|
|
{ |
|
|
|
|
if (bIsRunningWithoutVisualStyle) |
|
|
|
|
{ |
|
|
|
|
return 0; |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return DefWindowProcW(hWnd, uMsg, wParam, lParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DWORD WINAPI epw_Weather_MainThread(EPWeather* _this) |
|
|
|
|
{ |
|
|
|
|
HRESULT hr = S_OK; |
|
|
|
|
DWORD bIsThemeActive = IsThemeActive(); |
|
|
|
|
|
|
|
|
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); |
|
|
|
|
|
|
|
|
|
@ -615,7 +627,7 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
@@ -615,7 +627,7 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
|
|
|
|
|
wc.style = CS_DBLCLKS; |
|
|
|
|
wc.lpfnWndProc = epw_Weather_WindowProc; |
|
|
|
|
wc.hInstance = epw_hModule; |
|
|
|
|
wc.hbrBackground = bIsThemeActive ? (HBRUSH)GetStockObject(BLACK_BRUSH) : (HBRUSH)GetStockObject(WHITE_BRUSH); |
|
|
|
|
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); |
|
|
|
|
wc.lpszClassName = _T(EPW_WEATHER_CLASSNAME); |
|
|
|
|
wc.hCursor = LoadCursorW(NULL, IDC_ARROW); |
|
|
|
|
if (!RegisterClassW(&wc)) |
|
|
|
|
@ -650,13 +662,10 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
@@ -650,13 +662,10 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
|
|
|
|
|
goto cleanup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (bIsThemeActive) |
|
|
|
|
{ |
|
|
|
|
MARGINS marGlassInset = { -1, -1, -1, -1 }; // -1 means the whole window
|
|
|
|
|
DwmExtendFrameIntoClientArea(_this->hWnd, &marGlassInset); |
|
|
|
|
BOOL value = 1; |
|
|
|
|
DwmSetWindowAttribute(_this->hWnd, 1029, &value, sizeof(BOOL)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
InterlockedExchange64(&_this->bBrowserBusy, TRUE); |
|
|
|
|
|
|
|
|
|
|