* FILE: dll/shellext/stobject/csystray.cpp
* PURPOSE: Systray shell service object implementation
* PROGRAMMERS: David Quintana <gigaherz@gmail.com>
+* Shriraj Sawant a.k.a SR13 <sr.official@hotmail.com>
*/
#include "precomp.h"
-WINE_DEFAULT_DEBUG_CHANNEL(stobject);
+#include <undocshell.h>
+#include <shellutils.h>
SysTrayIconHandlers_t g_IconHandlers [] = {
{ Volume_Init, Volume_Shutdown, Volume_Update, Volume_Message },
return S_FALSE;
}
-HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip)
+/*++
+* @name NotifyIcon
+*
+* Basically a Shell_NotifyIcon wrapper.
+* Based on the parameters provided, it changes the current state of the notification icon.
+*
+* @param code
+* Determines whether to add, delete or modify the notification icon (represented by uId).
+* @param uId
+* Represents the particular notification icon.
+* @param hIcon
+* A handle to an icon for the notification object.
+* @param szTip
+* A string for the tooltip of the notification.
+* @param dwstate
+* Determines whether to show or hide the notification icon.
+*
+* @return The error code.
+*
+*--*/
+HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate)
{
NOTIFYICONDATA nim = { 0 };
nim.hIcon = hIcon;
nim.uID = uId;
nim.uCallbackMessage = uId;
- nim.dwState = 0;
- nim.dwStateMask = 0;
+ nim.dwState = dwstate;
+ nim.dwStateMask = NIS_HIDDEN;
nim.hWnd = m_hWnd;
nim.uVersion = NOTIFYICON_VERSION;
if (szTip)
return TRUE;
case WM_TIMER:
- switch (wParam)
- {
- case 1:
- UpdateIcons();
- return TRUE;
-
- case POWER_TIMER_ID:
- Power_OnTimer(hWnd);
- break;
-
- case VOLUME_TIMER_ID:
- Volume_OnTimer(hWnd);
- break;
-
- case HOTPLUG_TIMER_ID:
- Hotplug_OnTimer(hWnd);
- break;
- }
- break;
-
- case WM_DEVICECHANGE:
- ERR("WM_DEVICECHANGE\n");
- break;
-
+ UpdateIcons();
+ return TRUE;
case WM_DESTROY:
KillTimer(1);
ShutdownIcons();