Browse Source

Weather: Refactored browser rebound procedure

pull/886/head
Valentin Radu 4 years ago
parent
commit
879ec09488
  1. 1
      ep_weather_host/ep_weather.h
  2. 5
      ep_weather_host/ep_weather_host.c
  3. 4
      ep_weather_host/ep_weather_host.h

1
ep_weather_host/ep_weather.h

@ -51,6 +51,7 @@ DEFINE_GUID(IID_IEPWeather, @@ -51,6 +51,7 @@ DEFINE_GUID(IID_IEPWeather,
#define EP_WEATHER_WM_FETCH_DATA (WM_USER + 10)
#define EP_WEATHER_WM_SET_BROWSER_THEME (WM_USER + 11)
#define EP_WEATHER_WM_REBOUND_BROWSER (WM_USER + 12)
#define EP_WEATHER_HEIGHT 391
#define EP_WEATHER_WIDTH 690

5
ep_weather_host/ep_weather_host.c

@ -636,7 +636,7 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA @@ -636,7 +636,7 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
}
return 0;
}
else if (uMsg == WM_TIMER && wParam == EP_WEATHER_TIMER_REBOUND_BROWSER)
else if (wParam == EP_WEATHER_WM_REBOUND_BROWSER)
{
LPWSTR uri = NULL;
if (_this->pCoreWebView2)
@ -645,7 +645,6 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA @@ -645,7 +645,6 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
}
_ep_weather_ReboundBrowser(_this, !wcscmp(L"about:blank", uri ? uri : L""));
CoTaskMemFree(uri);
KillTimer(_this->hWnd, EP_WEATHER_TIMER_REBOUND_BROWSER);
return 0;
}
else if (uMsg == EP_WEATHER_WM_FETCH_DATA)
@ -1147,7 +1146,7 @@ HRESULT STDMETHODCALLTYPE epw_Weather_Initialize(EPWeather* _this, WCHAR wszName @@ -1147,7 +1146,7 @@ HRESULT STDMETHODCALLTYPE epw_Weather_Initialize(EPWeather* _this, WCHAR wszName
HRESULT STDMETHODCALLTYPE epw_Weather_Show(EPWeather* _this)
{
SetTimer(_this->hWnd, EP_WEATHER_TIMER_REBOUND_BROWSER, EP_WEATHER_TIMER_REBOUND_BROWSER_DELAY, NULL);
PostMessageW(_this->hWnd, EP_WEATHER_WM_REBOUND_BROWSER, 0, 0);
ShowWindow(_this->hWnd, SW_SHOW);
_this->pTaskList->lpVtbl->DeleteTab(_this->pTaskList, _this->hWnd);
return S_OK;

4
ep_weather_host/ep_weather_host.h

@ -22,11 +22,9 @@ DEFINE_GUID(IID_ITaskbarList, @@ -22,11 +22,9 @@ DEFINE_GUID(IID_ITaskbarList,
#define EP_WEATHER_TIMER_REQUEST_REPAINT 1
#define EP_WEATHER_TIMER_REQUEST_REPAINT_DELAY 1000
#define EP_WEATHER_TIMER_REBOUND_BROWSER 2
#define EP_WEATHER_TIMER_REBOUND_BROWSER_DELAY 1
#define EP_WEATHER_TIMER_REQUEST_REFRESH 10
#define EP_WEATHER_TIMER_REQUEST_REFRESH_DELAY 2000
#define EP_WEATHER_TIMER_SCHEDULE_REFRESH 10
#define EP_WEATHER_TIMER_SCHEDULE_REFRESH 11
typedef interface EPWeather
{

Loading…
Cancel
Save