From: David Quintana Date: Fri, 31 Oct 2014 15:57:56 +0000 (+0000) Subject: [EXPLORER-NEW] X-Git-Tag: backups/shell-experiments@75904~87 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=1bb0aaf50fb9d0f56653698460df2fa9c440e073;hp=88ae5a3afea47eb989622fd4cd39f1188aaa2087 [EXPLORER-NEW] * Some nitpicking. [STOBJECT] * Fix the notification not having an assigned callback message id. svn path=/branches/shell-experiments/; revision=65151 --- diff --git a/base/shell/explorer-new/tbsite.c b/base/shell/explorer-new/tbsite.c index cbcd042db55..b29879d683c 100644 --- a/base/shell/explorer-new/tbsite.c +++ b/base/shell/explorer-new/tbsite.c @@ -135,22 +135,18 @@ ITrayBandSiteImpl_QueryInterface(IN OUT ITrayBandSite *iface, This = ITrayBandSiteImpl_from_ITrayBandSite(iface); - if (IsEqualIID(riid, - &IID_IUnknown) || - IsEqualIID(riid, - &IID_IBandSiteStreamCallback)) + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IBandSiteStreamCallback)) { /* NOTE: IID_IBandSiteStreamCallback is queried by the shell, we implement this interface directly */ *ppvObj = IUnknown_from_ITrayBandSiteImpl(This); } - else if (IsEqualIID(riid, - &IID_IBandSite)) + else if (IsEqualIID(riid, &IID_IBandSite)) { *ppvObj = IBandSite_from_ITrayBandSiteImpl(This); } - else if (IsEqualIID(riid, - &IID_IWinEventHandler)) + else if (IsEqualIID(riid, &IID_IWinEventHandler)) { TRACE("ITaskBandSite: IWinEventHandler queried!\n"); *ppvObj = NULL; diff --git a/base/shell/explorer-new/trayntfy.c b/base/shell/explorer-new/trayntfy.c index 1ce1dc46706..49d4687499f 100644 --- a/base/shell/explorer-new/trayntfy.c +++ b/base/shell/explorer-new/trayntfy.c @@ -1671,22 +1671,17 @@ TrayNotifyWnd_Size(IN OUT PTRAY_NOTIFY_WND_DATA This, } } -static LRESULT +static VOID TrayNotifyWnd_DrawBackground(IN HWND hwnd, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) + IN HDC hdc) { PTRAY_NOTIFY_WND_DATA This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0); RECT rect; - HDC hdc = (HDC)wParam; GetClientRect(hwnd, &rect); DrawThemeParentBackground(hwnd, hdc, &rect); DrawThemeBackground(This->TrayTheme, hdc, TNP_BACKGROUND, 0, &rect, 0); - - return 0; } VOID @@ -1724,8 +1719,7 @@ TrayNotifyWndProc(IN HWND hwnd, if (uMsg != WM_NCCREATE) { - This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, - 0); + This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0); } if (This != NULL || uMsg == WM_NCCREATE) @@ -1738,7 +1732,8 @@ TrayNotifyWndProc(IN HWND hwnd, case WM_ERASEBKGND: if (!This->TrayTheme) break; - return TrayNotifyWnd_DrawBackground(hwnd, uMsg, wParam, lParam); + TrayNotifyWnd_DrawBackground(hwnd, (HDC) wParam); + return 0; case TNWM_GETMINIMUMSIZE: { return (LRESULT) TrayNotifyWnd_GetMinimumSize(This, (BOOL) wParam, (PSIZE) lParam); @@ -1761,8 +1756,7 @@ TrayNotifyWndProc(IN HWND hwnd, szClient.cx = LOWORD(lParam); szClient.cy = HIWORD(lParam); - TrayNotifyWnd_Size(This, - &szClient); + TrayNotifyWnd_Size(This, &szClient); return 0; } diff --git a/dll/shellext/stobject/csystray.cpp b/dll/shellext/stobject/csystray.cpp index 1aec9fa6d2f..ac7ae7e8775 100644 --- a/dll/shellext/stobject/csystray.cpp +++ b/dll/shellext/stobject/csystray.cpp @@ -22,6 +22,7 @@ CSysTray::~CSysTray() {} HRESULT CSysTray::InitIcons() { + TRACE("Initializing Notification icons...\n"); for (int i = 0; i < g_NumIcons; i++) { HRESULT hr = g_IconHandlers[i].pfnInit(this); @@ -34,6 +35,7 @@ HRESULT CSysTray::InitIcons() HRESULT CSysTray::ShutdownIcons() { + TRACE("Shutting down Notification icons...\n"); for (int i = 0; i < g_NumIcons; i++) { HRESULT hr = g_IconHandlers[i].pfnShutdown(this); @@ -46,6 +48,7 @@ HRESULT CSysTray::ShutdownIcons() HRESULT CSysTray::UpdateIcons() { + TRACE("Updating Notification icons...\n"); for (int i = 0; i < g_NumIcons; i++) { HRESULT hr = g_IconHandlers[i].pfnUpdate(this); @@ -73,9 +76,12 @@ HRESULT CSysTray::ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip) { - NOTIFYICONDATA nim; + NOTIFYICONDATA nim = { 0 }; + + TRACE("NotifyIcon code=%d, uId=%d, hIcon=%p, szTip=%S\n", code, uId, hIcon, szTip); + nim.cbSize = sizeof(NOTIFYICONDATA); - nim.uFlags = NIF_ICON | NIF_STATE | NIF_TIP; + nim.uFlags = NIF_MESSAGE | NIF_ICON | NIF_STATE | NIF_TIP; nim.hIcon = hIcon; nim.uID = uId; nim.uCallbackMessage = uId; diff --git a/dll/shellext/stobject/precomp.h b/dll/shellext/stobject/precomp.h index e74b9880fea..bd639f1f1a1 100644 --- a/dll/shellext/stobject/precomp.h +++ b/dll/shellext/stobject/precomp.h @@ -36,7 +36,7 @@ extern HINSTANCE g_hInstance; -#define ID_ICON_VOLUME 0x4CB +#define ID_ICON_VOLUME (WM_APP + 0x4CB) #include "csystray.h" diff --git a/dll/shellext/stobject/volume.cpp b/dll/shellext/stobject/volume.cpp index d7c041d12e3..844bdd0cea8 100644 --- a/dll/shellext/stobject/volume.cpp +++ b/dll/shellext/stobject/volume.cpp @@ -163,8 +163,7 @@ HRESULT STDMETHODCALLTYPE Volume_Init(_In_ CSysTray * pSysTray) else icon = g_hIconVolume; - pSysTray->NotifyIcon(NIM_ADD, ID_ICON_VOLUME, icon, L"Placeholder"); - return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, L"Placeholder"); + return pSysTray->NotifyIcon(NIM_ADD, ID_ICON_VOLUME, icon, L"Volume Control"); } HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray * pSysTray) @@ -200,11 +199,13 @@ HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT uMsg, WP return Volume_OnDeviceChange(pSysTray, wParam, lParam); if (uMsg != ID_ICON_VOLUME) + { + TRACE("Volume_Message received for unknown ID %d, ignoring.\n"); return S_FALSE; + } - TRACE("Volume_Message\n"); + TRACE("Volume_Message uMsg=%d, w=%x, l=%x\n", uMsg, wParam, lParam); - TRACE("Calling update...\n"); Volume_Update(pSysTray); switch (lParam)