mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[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:
parent
88ae5a3afe
commit
1bb0aaf50f
5 changed files with 24 additions and 27 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
extern HINSTANCE g_hInstance;
|
||||
|
||||
#define ID_ICON_VOLUME 0x4CB
|
||||
#define ID_ICON_VOLUME (WM_APP + 0x4CB)
|
||||
|
||||
#include "csystray.h"
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue