Author: dquintana Date: Fri Oct 31 15:57:56 2014 New Revision: 65151
URL: http://svn.reactos.org/svn/reactos?rev=65151&view=rev Log: [EXPLORER-NEW] * Some nitpicking.
[STOBJECT] * Fix the notification not having an assigned callback message id.
Modified: branches/shell-experiments/base/shell/explorer-new/tbsite.c branches/shell-experiments/base/shell/explorer-new/trayntfy.c branches/shell-experiments/dll/shellext/stobject/csystray.cpp branches/shell-experiments/dll/shellext/stobject/precomp.h branches/shell-experiments/dll/shellext/stobject/volume.cpp
Modified: branches/shell-experiments/base/shell/explorer-new/tbsite.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/exp... ============================================================================== --- branches/shell-experiments/base/shell/explorer-new/tbsite.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/tbsite.c [iso-8859-1] Fri Oct 31 15:57:56 2014 @@ -135,22 +135,18 @@
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;
Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/exp... ============================================================================== --- branches/shell-experiments/base/shell/explorer-new/trayntfy.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/trayntfy.c [iso-8859-1] Fri Oct 31 15:57:56 2014 @@ -1671,22 +1671,17 @@ } }
-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 @@
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 @@ 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 @@ szClient.cx = LOWORD(lParam); szClient.cy = HIWORD(lParam);
- TrayNotifyWnd_Size(This, - &szClient); + TrayNotifyWnd_Size(This, &szClient); return 0; }
Modified: branches/shell-experiments/dll/shellext/stobject/csystray.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/shellext/s... ============================================================================== --- branches/shell-experiments/dll/shellext/stobject/csystray.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/shellext/stobject/csystray.cpp [iso-8859-1] Fri Oct 31 15:57:56 2014 @@ -22,6 +22,7 @@
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::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::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::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;
Modified: branches/shell-experiments/dll/shellext/stobject/precomp.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/shellext/s... ============================================================================== --- branches/shell-experiments/dll/shellext/stobject/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/shellext/stobject/precomp.h [iso-8859-1] Fri Oct 31 15:57:56 2014 @@ -36,7 +36,7 @@
extern HINSTANCE g_hInstance;
-#define ID_ICON_VOLUME 0x4CB +#define ID_ICON_VOLUME (WM_APP + 0x4CB)
#include "csystray.h"
Modified: branches/shell-experiments/dll/shellext/stobject/volume.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/shellext/s... ============================================================================== --- branches/shell-experiments/dll/shellext/stobject/volume.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/shellext/stobject/volume.cpp [iso-8859-1] Fri Oct 31 15:57:56 2014 @@ -163,8 +163,7 @@ 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 @@ 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("Calling update...\n"); + } + + TRACE("Volume_Message uMsg=%d, w=%x, l=%x\n", uMsg, wParam, lParam); + Volume_Update(pSysTray);
switch (lParam)