#ifndef __TRAYMANAGER_H
#define __TRAYMANAGER_H
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif
#ifndef _WIN32_DCOM
#define _WIN32_DCOM
#endif
#include "BBApi.h"
#include "BImage.h"
#include "Settings.h"
#include "Toolbar.h"
#include "Systembar.h"
#include "Menu/MenuMaker.h"
#include "Desk.h"
#include <windows.h>
#include <string>
#include <shlwapi.h>
#include <shellapi.h>
#include <docobj.h>
#include <shlobj.h>
#ifndef NIN_BALLOONSHOW
#define NIN_BALLOONSHOW (WM_USER + 2)
#endif
#ifndef NIN_BALLOONHIDE
#define NIN_BALLOONHIDE (WM_USER + 3)
#endif
#ifndef NIN_BALLOONTIMEOUT
#define NIN_BALLOONTIMEOUT (WM_USER + 4)
#endif
#ifndef NIN_BALLOONUSERCLICK
#define NIN_BALLOONUSERCLICK (WM_USER + 5)
#endif
#define SYSTRAY_CLEAN_TIMER 1
typedef struct _NOTIFYICONDATAV5
{
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
HICON hIcon;
WCHAR szTip[128];
DWORD dwState;
DWORD dwStateMask;
WCHAR szInfo[256];
union
{
UINT uTimeout;
UINT uVersion;
};
WCHAR szInfoTitle[64];
DWORD dwInfoFlags;
} NOTIFYICONDATAV5;
typedef struct SHELLTRAYDATA
{
DWORD dwUnknown;
DWORD dwMessage;
NOTIFYICONDATA iconData;
} SHELLTRAYDATA;
class TrayManager
{
public:
TrayManager(HINSTANCE hInstance, bool DisableTray);
~TrayManager();
void Initialize();
friend LRESULT CALLBACK TrayManagerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
bool AddTrayIcon(NOTIFYICONDATA *iconData);
bool ModifyTrayIcon(trayIconItem *icon, NOTIFYICONDATA *iconData);
bool RemoveTrayIcon(trayIconItem *iconData);
trayIconItem* FindTrayIcon(NOTIFYICONDATA *iconData);
bool CreateXobloonNotification(trayIconItem *icon, NOTIFYICONDATA *iconData);
void CleanTray();
int GetTraySize();
trayIconItem* GetTrayIcon(int pointer);
bool ConvertTip(char *destination, WCHAR *tip);
void LoadShellServiceObjects();
void UnloadShellServiceObjects();
HINSTANCE hTrayManagerInstance;
HWND hBlackboxWnd;
HWND hTrayManagerWnd;
HWND hTrayNotifyWnd;
bool TrayManagerDisabled;
OSVERSIONINFO osInfo;
bool usingWin2kXP;
bool TrayManagerReady;
bool COMinitialized;
bool ShowBalloonTooltip;
char BalloonTooltipText[350];
LPCSTR BalloonTooltipIcon;
trayIconItem BalloonTooltipItem;
typedef vector<trayIconItem*> trayIconVector;
trayIconVector trayIconList;
typedef vector<IOleCommandTarget*> ssoIconVector;
ssoIconVector ssoIconList;
};
#endif
syntax highlighting by