1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

Weather: Fixed a bug that had "COM Surrogate" display as a running

app in Task Manager after the widget flyout was opened the first time
This commit is contained in:
Valentin Radu 2022-04-30 03:35:13 +03:00
parent 52e86d739a
commit 5e17f5a817

View File

@ -1560,6 +1560,12 @@ HRESULT STDMETHODCALLTYPE epw_Weather_Initialize(EPWeather* _this, WCHAR wszName
HRESULT STDMETHODCALLTYPE epw_Weather_Show(EPWeather* _this)
{
SetLastError(0);
LONG_PTR dwExStyle = GetWindowLongPtrW(_this->hWnd, GWL_EXSTYLE);
if (!GetLastError())
{
SetWindowLongPtrW(_this->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW | dwExStyle);
}
INT preference = InterlockedAdd64(&_this->dwWindowCornerPreference, 0);
DwmSetWindowAttribute(_this->hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &preference, sizeof(preference));
PostMessageW(_this->hWnd, EP_WEATHER_WM_REBOUND_BROWSER, 0, 0);
@ -1570,6 +1576,12 @@ HRESULT STDMETHODCALLTYPE epw_Weather_Show(EPWeather* _this)
HRESULT STDMETHODCALLTYPE epw_Weather_Hide(EPWeather* _this)
{
SetLastError(0);
LONG_PTR dwExStyle = GetWindowLongPtrW(_this->hWnd, GWL_EXSTYLE);
if (!GetLastError())
{
SetWindowLongPtrW(_this->hWnd, GWL_EXSTYLE, ~WS_EX_TOOLWINDOW & dwExStyle);
}
ShowWindow(_this->hWnd, SW_HIDE);
return S_OK;
}