#pragma warning(disable: 4786)
#ifndef __SYSTEMBAR_H
#define __SYSTEMBAR_H
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif
#ifndef _WIN32_DCOM
#define _WIN32_DCOM
#endif
#include "BBApi.h"
#include "BImage.h"
#include "Desk.h"
#include "Settings.h"
#include "Toolbar.h"
#include "TrayManager.h"
#include "Menu/MenuMaker.h"
#include "Desk.h"
#include "Workspaces.h"
#include "Slit.h"
#include <windows.h>
#include <string>
#include <shlwapi.h>
#include <docobj.h>
#include <shlobj.h>
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A
#endif
#ifndef GET_WHEEL_DELTA_WPARAM
#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
#endif
#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 SYSTEMBAR_XOBLOON_TIMER 1
typedef struct TaskButton
{
HWND Window;
bool Active;
RECT r;
} TaskButton;
class Systembar
{
public:
Systembar(HINSTANCE hInstance, bool DisableTray);
~Systembar();
void Initialize();
friend LRESULT CALLBACK SystembarWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
bool MouseButtonOnTaskbar(HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam);
int DrawSysTray(HDC hdc);
void DrawTaskbar(HDC hdc, int iconPos, RECT taskbarRect);
int DrawTaskButtons();
void DrawSatHueIcon(HDC hdc, HICON icon, int size, RECT r, bool trayIcon, bool activeTask);
void GetSettings();
void UpdatePosition();
void ToggleAlwaysOnTop();
void ChangeTaskbarMode(int mode);
void ToggleSysTray();
void ToggleCurrentOnly();
void AddWindow(HWND newWindow);
void RemoveWindow(HWND oldWindow);
void CleanWindows();
void MinimizeAllWindows();
void RestoreAllWindows();
HWND GetCurrentWindow();
friend BOOL CALLBACK WinEnumerator(HWND Window, LPARAM Main);
void SetToolTip(unsigned int tipID, RECT tipRect, char tipText[MAX_LINE_LENGTH]);
void DeleteToolTip(unsigned int tipID);
void UpdateToolTipPositions();
void CreateTooltipsWindow();
void ToggleTooltips();
HINSTANCE hSystembarInstance;
HWND hBlackboxWnd;
HWND hSystembarWnd;
HWND hToolTips;
bool SysTrayDisabled;
int ScreenWidth, ScreenHeight;
int SystembarX, SystembarY, SystembarWidth, SystembarHeight;
bool SystembarHidden;
RECT TrayRect;
RECT ToggleTrayButtonRect;
bool SystembarPosInProgress;
BYTE red, green, blue, greyscale;
COLORREF pixel, hueColor;
int invsat, invhue;
HDC cachedBackground;
bool cachedBackgroundExists;
HDC cachedTaskButtonActive;
HDC cachedTaskButtonInactive;
bool cachedTaskButtonsExist;
bool saveWidthOnRestart;
bool DockedToSlit;
#define ICON_SIZE 16
#define TASKICON_SIZE 14
HDC MainDC;
RECT MainRect;
RECT ThisButton;
HWND ThisButtonWnd;
HICON ThisButtonIcon;
char ThisButtonWindowText[MAX_LINE_LENGTH];
int iconSize;
RECT iconRect;
int TaskWidth, TaskWidthMinusPadding, TaskHeight;
int NumberOfTasks, WinEnumeratorCount, CurrentOnlyCount;
TaskButton WindowList[255];
HWND flashingHwnd;
bool blockNextMouseClick;
};
#endif
syntax highlighting by