[EXPLORER-NEW]

* Some nitpicking.

[STOBJECT]
* Fix the notification not having an assigned callback message id.

svn path=/branches/shell-experiments/; revision=65151
This commit is contained in:
David Quintana 2014-10-31 15:57:56 +00:00
parent 88ae5a3afe
commit 1bb0aaf50f
5 changed files with 24 additions and 27 deletions

View file

@ -135,22 +135,18 @@ ITrayBandSiteImpl_QueryInterface(IN OUT ITrayBandSite *iface,
This = ITrayBandSiteImpl_from_ITrayBandSite(iface); This = ITrayBandSiteImpl_from_ITrayBandSite(iface);
if (IsEqualIID(riid, if (IsEqualIID(riid, &IID_IUnknown) ||
&IID_IUnknown) || IsEqualIID(riid, &IID_IBandSiteStreamCallback))
IsEqualIID(riid,
&IID_IBandSiteStreamCallback))
{ {
/* NOTE: IID_IBandSiteStreamCallback is queried by the shell, we /* NOTE: IID_IBandSiteStreamCallback is queried by the shell, we
implement this interface directly */ implement this interface directly */
*ppvObj = IUnknown_from_ITrayBandSiteImpl(This); *ppvObj = IUnknown_from_ITrayBandSiteImpl(This);
} }
else if (IsEqualIID(riid, else if (IsEqualIID(riid, &IID_IBandSite))
&IID_IBandSite))
{ {
*ppvObj = IBandSite_from_ITrayBandSiteImpl(This); *ppvObj = IBandSite_from_ITrayBandSiteImpl(This);
} }
else if (IsEqualIID(riid, else if (IsEqualIID(riid, &IID_IWinEventHandler))
&IID_IWinEventHandler))
{ {
TRACE("ITaskBandSite: IWinEventHandler queried!\n"); TRACE("ITaskBandSite: IWinEventHandler queried!\n");
*ppvObj = NULL; *ppvObj = NULL;

View file

@ -1671,22 +1671,17 @@ TrayNotifyWnd_Size(IN OUT PTRAY_NOTIFY_WND_DATA This,
} }
} }
static LRESULT static VOID
TrayNotifyWnd_DrawBackground(IN HWND hwnd, TrayNotifyWnd_DrawBackground(IN HWND hwnd,
IN UINT uMsg, IN HDC hdc)
IN WPARAM wParam,
IN LPARAM lParam)
{ {
PTRAY_NOTIFY_WND_DATA This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0); PTRAY_NOTIFY_WND_DATA This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0);
RECT rect; RECT rect;
HDC hdc = (HDC)wParam;
GetClientRect(hwnd, &rect); GetClientRect(hwnd, &rect);
DrawThemeParentBackground(hwnd, hdc, &rect); DrawThemeParentBackground(hwnd, hdc, &rect);
DrawThemeBackground(This->TrayTheme, hdc, TNP_BACKGROUND, 0, &rect, 0); DrawThemeBackground(This->TrayTheme, hdc, TNP_BACKGROUND, 0, &rect, 0);
return 0;
} }
VOID VOID
@ -1724,8 +1719,7 @@ TrayNotifyWndProc(IN HWND hwnd,
if (uMsg != WM_NCCREATE) if (uMsg != WM_NCCREATE)
{ {
This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0);
0);
} }
if (This != NULL || uMsg == WM_NCCREATE) if (This != NULL || uMsg == WM_NCCREATE)
@ -1738,7 +1732,8 @@ TrayNotifyWndProc(IN HWND hwnd,
case WM_ERASEBKGND: case WM_ERASEBKGND:
if (!This->TrayTheme) if (!This->TrayTheme)
break; break;
return TrayNotifyWnd_DrawBackground(hwnd, uMsg, wParam, lParam); TrayNotifyWnd_DrawBackground(hwnd, (HDC) wParam);
return 0;
case TNWM_GETMINIMUMSIZE: case TNWM_GETMINIMUMSIZE:
{ {
return (LRESULT) TrayNotifyWnd_GetMinimumSize(This, (BOOL) wParam, (PSIZE) lParam); return (LRESULT) TrayNotifyWnd_GetMinimumSize(This, (BOOL) wParam, (PSIZE) lParam);
@ -1761,8 +1756,7 @@ TrayNotifyWndProc(IN HWND hwnd,
szClient.cx = LOWORD(lParam); szClient.cx = LOWORD(lParam);
szClient.cy = HIWORD(lParam); szClient.cy = HIWORD(lParam);
TrayNotifyWnd_Size(This, TrayNotifyWnd_Size(This, &szClient);
&szClient);
return 0; return 0;
} }

View file

@ -22,6 +22,7 @@ CSysTray::~CSysTray() {}
HRESULT CSysTray::InitIcons() HRESULT CSysTray::InitIcons()
{ {
TRACE("Initializing Notification icons...\n");
for (int i = 0; i < g_NumIcons; i++) for (int i = 0; i < g_NumIcons; i++)
{ {
HRESULT hr = g_IconHandlers[i].pfnInit(this); HRESULT hr = g_IconHandlers[i].pfnInit(this);
@ -34,6 +35,7 @@ HRESULT CSysTray::InitIcons()
HRESULT CSysTray::ShutdownIcons() HRESULT CSysTray::ShutdownIcons()
{ {
TRACE("Shutting down Notification icons...\n");
for (int i = 0; i < g_NumIcons; i++) for (int i = 0; i < g_NumIcons; i++)
{ {
HRESULT hr = g_IconHandlers[i].pfnShutdown(this); HRESULT hr = g_IconHandlers[i].pfnShutdown(this);
@ -46,6 +48,7 @@ HRESULT CSysTray::ShutdownIcons()
HRESULT CSysTray::UpdateIcons() HRESULT CSysTray::UpdateIcons()
{ {
TRACE("Updating Notification icons...\n");
for (int i = 0; i < g_NumIcons; i++) for (int i = 0; i < g_NumIcons; i++)
{ {
HRESULT hr = g_IconHandlers[i].pfnUpdate(this); 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) 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.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.hIcon = hIcon;
nim.uID = uId; nim.uID = uId;
nim.uCallbackMessage = uId; nim.uCallbackMessage = uId;

View file

@ -36,7 +36,7 @@
extern HINSTANCE g_hInstance; extern HINSTANCE g_hInstance;
#define ID_ICON_VOLUME 0x4CB #define ID_ICON_VOLUME (WM_APP + 0x4CB)
#include "csystray.h" #include "csystray.h"

View file

@ -163,8 +163,7 @@ HRESULT STDMETHODCALLTYPE Volume_Init(_In_ CSysTray * pSysTray)
else else
icon = g_hIconVolume; icon = g_hIconVolume;
pSysTray->NotifyIcon(NIM_ADD, ID_ICON_VOLUME, icon, L"Placeholder"); return pSysTray->NotifyIcon(NIM_ADD, ID_ICON_VOLUME, icon, L"Volume Control");
return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, L"Placeholder");
} }
HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray * pSysTray) 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); return Volume_OnDeviceChange(pSysTray, wParam, lParam);
if (uMsg != ID_ICON_VOLUME) if (uMsg != ID_ICON_VOLUME)
{
TRACE("Volume_Message received for unknown ID %d, ignoring.\n");
return S_FALSE; 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); Volume_Update(pSysTray);
switch (lParam) switch (lParam)