xoblite™ / Blackbox for Windows bb5 | RC6 preview | 0.25.2.14
http://xoblite.net/
Taskbar Class Reference

#include <Taskbar.h>

Public Member Functions

 Taskbar ()
 
 ~Taskbar ()
 
void InitializeTaskList ()
 
void AddTask (HWND newWindow)
 
void RemoveTask (HWND oldWindow)
 
int FindTask (HWND window)
 
void CheckTaskListIntegrity ()
 
void SetActiveTask (HWND activeWindow)
 
int GetActiveTask ()
 
HWND GetActiveWindow ()
 
void RedrawTask (HWND window)
 
void ActivateShellWindow ()
 
void MinimizeAllWindows ()
 
void RestoreAllWindows ()
 
int DropFiles (HWND hwnd, WPARAM wParam, bool checkTaskbarDrop)
 
bool MouseButtonOnTaskbar (HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam)
 
void DrawTaskbar (HDC hdc, int iconPos, RECT taskbarRect)
 
int DrawTaskButtons (HDC hdc)
 
void ChangeTaskbarMode (int mode)
 
void ToggleCurrentOnly ()
 
bool OnCurrentWorkspace (HWND window)
 
int GetTaskButtonsToDraw ()
 
int GetTaskbarScrollIndicatorSizes (int *leftTopPadding, int *rightBottomPadding)
 
bool CheckCloakedWindow (HWND hwnd)
 
int FindFirstVisible ()
 
int FindLastVisible (int offset)
 
void NextTask (bool currentWorkspaceOnly, bool visibleOnly)
 
void PreviousTask (bool currentWorkspaceOnly, bool visibleOnly)
 
void SortTaskbarItems (int mode)
 
void TileWindow (int placement)
 

Static Public Member Functions

static bool CompareTaskbarItemsByLastUsed (taskListItem *t1, taskListItem *t2)
 

Public Attributes

HWND hBlackboxWnd
 
HDC cachedTaskButtonActive
 
HDC cachedTaskButtonInactive
 
bool cachedTaskButtonsExist
 
RECT TaskbarRect
 
bool activeTaskAvailable
 
RECT ActiveTaskRect
 
RECT currentTaskButton
 
HWND currentTaskButtonWnd
 
HICON currentTaskButtonIcon
 
int iconSize
 
RECT iconRect
 
RECT textRect
 
int taskButtonWidth
 
int taskButtonWidthMinusPadding
 
int taskButtonHeight
 
int taskButtonHeightMinusPadding
 
int taskButtonsToDraw
 
int taskButtonsOffset
 
HWND flashingHwnd
 
vector< taskListItem * > taskList
 
bool enumeratingTasks
 
bool blockNextMouseClick
 

Friends

BOOL CALLBACK TaskEnumerator (HWND window, LPARAM main)
 

Constructor & Destructor Documentation

◆ Taskbar()

Taskbar::Taskbar ( )
45{
46 ZeroMemory(this, sizeof(Taskbar));
47 ZeroMemory(&taskList, sizeof(taskList));
48
50
51 cachedTaskButtonActive = CreateCompatibleDC(NULL);
52 cachedTaskButtonInactive = CreateCompatibleDC(NULL);
54
57
58 blockNextMouseClick = false;
59 enumeratingTasks = false;
60}
HWND GetBBWnd()
Definition BBApi.cpp:128
int taskButtonHeight
Definition Taskbar.h:139
bool blockNextMouseClick
Definition Taskbar.h:152
int taskButtonWidthMinusPadding
Definition Taskbar.h:139
int taskButtonHeightMinusPadding
Definition Taskbar.h:139
Taskbar()
Definition Taskbar.cpp:44
HDC cachedTaskButtonActive
Definition Taskbar.h:120
int taskButtonWidth
Definition Taskbar.h:139
bool cachedTaskButtonsExist
Definition Taskbar.h:122
int taskButtonsToDraw
Definition Taskbar.h:141
HDC cachedTaskButtonInactive
Definition Taskbar.h:121
bool enumeratingTasks
Definition Taskbar.h:150
vector< taskListItem * > taskList
Definition Taskbar.h:148
int taskButtonsOffset
Definition Taskbar.h:142
HWND hBlackboxWnd
Definition Taskbar.h:118

◆ ~Taskbar()

Taskbar::~Taskbar ( )
65{
66 // Clear all elements in the taskList...
67 for (int i=0; i < (int)taskList.size(); i++)
68 {
69// DestroyIcon(taskList[i]->icon);
70 delete taskList[i];
71 taskList.erase(taskList.begin() + i);
72 }
73 taskList.clear();
74
75 // Delete cached bitmaps...
76 DeleteDC(cachedTaskButtonActive);
78}

Member Function Documentation

◆ InitializeTaskList()

void Taskbar::InitializeTaskList ( )
83{
84 enumeratingTasks = true;
85// if (pSettings->debugLogging) Log("==================== TASKBAR WINDOW ENUMERATION STARTING ====================", "");
86 EnumWindows(TaskEnumerator, 0);
87// if (pSettings->debugLogging) Log("==================== TASKBAR WINDOW ENUMERATION FINISHED ====================", "");
88 enumeratingTasks = false;
90 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_ADDED);
91}
#define TASKITEM_ADDED
Definition BBApi.h:286
#define BB_TASKSUPDATE
Definition BBApi.h:187
friend BOOL CALLBACK TaskEnumerator(HWND window, LPARAM main)
Definition Taskbar.cpp:93
void CheckTaskListIntegrity()
Definition Taskbar.cpp:270

◆ AddTask()

void Taskbar::AddTask ( HWND newWindow)
118{
119 if (!IsAppWindow(window)) return;
120
121 // Check if the task is already present in the taskList...
122 int i = FindTask(window);
123 // ...and whether the task is a DWM cloaked window...
124 bool cloaked = CheckCloakedWindow(window);
125
126 if (i != -1) // -> This is an *existing* task item, but check if any of its parameters need updating...
127 {
129 {
130 if (taskList[i]->hidden != cloaked)
131 {
132 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
133 GetWindowText(window, windowText, sizeof(windowText));
134 if (cloaked) sprintf(msg, "DEBUG -> Taskbar::AddTask -> Window cloaking! -> %s", windowText);
135 else sprintf(msg, "DEBUG -> Taskbar::AddTask -> Window uncloaking! -> %s", windowText);
136 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
137 Log(msg, "");
138 }
139 }
140 taskList[i]->hidden = cloaked;
141 }
142 else // -> This is a *new* task item, so let's add it to the taskList...
143 {
144 // ...but first, let's also check for various other types of rogue windows that don't belong on the taskbar...
145 char newWindowTemp[MAX_LINE_LENGTH];
146 GetClassName(window, newWindowTemp, MAX_LINE_LENGTH);
147 if (strlen(newWindowTemp) == 0) return;
148 if (!_stricmp(newWindowTemp, "AcrobatOffscreenDocumentWnd")) return; // Check for Adobe Acrobat 7.0 offscreen windows...
149 bool isAppPlugin = (!_strnicmp(newWindowTemp, "BBAppPlugin", 11)); // Allow specific "application-like" plugins to show up on the taskbar...
150
151 GetWindowText(window, newWindowTemp, sizeof(newWindowTemp));
152 if (strlen(newWindowTemp) == 0) return;
153 // Check for Microsoft Powerpoint non-document windows...
154 // "Microsoft Powerpoint - [" or "Microsoft Office PowerPoint - ["
155 // if (IsInString(newWindowTemp, " Powerpoint - [")) return;
156
158 {
159 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
160 GetWindowText(window, windowText, sizeof(windowText));
161 if (cloaked) sprintf(msg, "DEBUG -> Taskbar::AddTask -> Cloaked window found! -> %s", windowText);
162 else sprintf(msg, "DEBUG -> Taskbar::AddTask -> Uncloaked window found! -> %s", windowText);
163 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
164 Log(msg, "");
165 }
166
167 // Increase the "last used" counter for all other taskbar items...
168 for (int i = 0; i < (int)taskList.size(); i++) taskList[i]->lastUsed++;
169
170 // -> All checks passed, so now we can create the new taskList item! :)
171 taskListItem *newTask = new taskListItem;
172 newTask->hwnd = window;
173 newTask->active = false;
174// if (IsIconic(window)) newTask->workspace = 255;
175// else newTask->workspace = pSettings->currentWorkspace;
177 if (cloaked) newTask->hidden = true;
178 else newTask->hidden = false;
179// newTask->hidden = false;
180 newTask->isAppPlugin = isAppPlugin;
181 GetWindowText(window, newTask->captionANSI, 255); // -> ANSI representation
182 GetWindowTextW(window, newTask->captionUnicode, 255); // -> Unicode representation
183 newTask->lastUsed = 0; // ...because the new task is automatically also the most recently active task...
184 newTask->priorityClass = 0;
185 newTask->dimensions.placement = PLACEMENT_DEFAULT; // All windows start in the default non-tiled state
186
187 DWORD pid = 0;
188 GetWindowThreadProcessId(window, &pid);
189 HANDLE windowProcessHandle = OpenProcess((PROCESS_QUERY_INFORMATION), FALSE, pid);
190 if (windowProcessHandle != NULL)
191 {
192 GetModuleFileNameEx(windowProcessHandle, NULL, newTask->path, sizeof(newTask->path));
193 CloseHandle(windowProcessHandle);
194 }
195 else newTask->path[0] = '\0';
196
197 taskList.push_back(newTask);
198 }
199
201
202 //====================
203
204 // Redraw the taskbar...
205 if (!enumeratingTasks)
206 {
207 if (i != -1) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_REFRESH);
208 else SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)window, (LPARAM)TASKITEM_ADDED);
209 }
210}
bool IsAppWindow(HWND hWnd)
Definition BBApi.cpp:1836
void Log(LPCSTR des, LPCSTR line)
Definition BBApi.cpp:638
Settings * pSettings
Definition Blackbox.cpp:46
#define BB_CONSOLEMESSAGE
Definition BBApi.h:165
#define TASKITEM_REFRESH
Definition BBApi.h:290
#define MAX_LINE_LENGTH
Definition BBApi.h:64
#define CONSOLE_INFORMATION_MESSAGE
Definition BBApi.h:298
#define PLACEMENT_DEFAULT
Definition Settings.h:77
struct taskListItem taskListItem
int currentWorkspace
Definition Settings.h:372
bool debugLogging
Definition Settings.h:361
int FindTask(HWND window)
Definition Taskbar.cpp:255
bool CheckCloakedWindow(HWND hwnd)
Definition Taskbar.cpp:1837
int placement
Definition Settings.h:89
int lastUsed
Definition Taskbar.h:59
bool isAppPlugin
Definition Taskbar.h:55
char path[MAX_PATH]
Definition Taskbar.h:56
int workspace
Definition Taskbar.h:52
bool active
Definition Taskbar.h:51
char captionANSI[265]
Definition Taskbar.h:57
Placement dimensions
Definition Taskbar.h:61
HWND hwnd
Definition Taskbar.h:48
wchar_t captionUnicode[265]
Definition Taskbar.h:58
bool hidden
Definition Taskbar.h:54
DWORD priorityClass
Definition Taskbar.h:60

◆ RemoveTask()

void Taskbar::RemoveTask ( HWND oldWindow)
218{
219 int i = FindTask(oldWindow);
220 if (i != -1)
221 {
222 // Task found in taskList, let's remove it + any associated tooltips...
223
225 {
226 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
227 GetWindowText(oldWindow, windowText, sizeof(windowText));
228 sprintf(msg, "DEBUG -> Taskbar::RemoveTask -> %s", windowText);
229 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
230 Log(msg, "");
231 }
232
234
235// DestroyIcon(taskList[i]->icon);
236 delete taskList[i];
237 taskList.erase(taskList.begin() + i);
238
240
241 // Adjust the visible taskbar items if one of them was removed and we're at the *end* of
242 // the task list... (i.e. leave no gap at the end, adjust the offset backwards instead)
244
245 // Redraw the taskbar...
246 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)oldWindow, (LPARAM)TASKITEM_REMOVED);
247 }
248}
#define TASKITEM_REMOVED
Definition BBApi.h:289
Tooltips * pTooltips
Definition Blackbox.cpp:49
#define TOOLTIP_TYPE_TASK
Definition Tooltips.h:39
bool taskbarTooltips
Definition Settings.h:227
int FindLastVisible(int offset)
Definition Taskbar.cpp:1567
int FindFirstVisible()
Definition Taskbar.cpp:1550
void DeleteToolTip(unsigned int tipID, int tipType)
Definition Tooltips.cpp:170

◆ FindTask()

int Taskbar::FindTask ( HWND window)
256{
257 for (int i=0; i < (int)taskList.size(); i++)
258 {
259 if (taskList[i]->hwnd == window) return i;
260 }
261
262 return -1;
263}

◆ CheckTaskListIntegrity()

void Taskbar::CheckTaskListIntegrity ( )
271{
272 // Look for zombie items in the taskList...
273 for (int i=0; i < (int)taskList.size(); i++)
274 {
275 if (!IsWindow(taskList[i]->hwnd))
276 {
278
279// DestroyIcon(taskList[i]->icon);
280 delete taskList[i];
281 taskList.erase(taskList.begin() + i);
282 }
283 }
284
285// GetTaskButtonsToDraw();
286}

◆ SetActiveTask()

void Taskbar::SetActiveTask ( HWND activeWindow)
294{
295 bool cloakingChanged = false;
296
297 int i = FindTask(window);
298
299 if (i != -1) // -> Focus has moved to an item shown on the taskbar...
300 {
301 // First, we hide any open and non-pinned menus as focus has moved to another application...
303
304 bool cloaked = CheckCloakedWindow(window);
305
306 // Increase the "last used" counter for all other taskbar items...
307 for (int i = 0; i < (int)taskList.size(); i++) taskList[i]->lastUsed++; // (yes, I know this could in *theory* wrap around, but... ;))
308
309 // Find the new active task... (and set all other tasks to inactive)
310 for (int i=0; i < (int)taskList.size(); i++)
311 {
312 if (taskList[i]->hwnd == window)
313 {
314 taskList[i]->active = true;
315 taskList[i]->lastUsed = 0; // Reset the "last used" counter for the new active item...
316/*
317 if (pSettings->debugLogging)
318 {
319 if (taskList[i]->hidden != cloaked)
320 {
321 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
322 GetWindowText(window, windowText, sizeof(windowText));
323 if (cloaked) sprintf(msg, "DEBUG -> Taskbar::SetActiveTask -> Window cloaking! -> %s", windowText);
324 else sprintf(msg, "DEBUG -> Taskbar::SetActiveTask -> Window uncloaking! -> %s", windowText);
325 // SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
326 Log(msg, "");
327 }
328 }
329*/
330 if (taskList[i]->hidden != cloaked) cloakingChanged = true;
331// taskList[i]->hidden = cloaked;
332 taskList[i]->hidden = false; // Note: Necessary because some apps go active *before* they uncloak... (i.e. avoiding related taskbar update race conditions)
333 }
334 else taskList[i]->active = false;
335 }
336
337 // Should we update the visible section of the taskbar to follow the newly active task?
339 {
341 int firstButton = FindFirstVisible();
342 int lastButton = FindLastVisible(firstButton);
343 if (lastButton < 0) lastButton = (int)taskList.size() - 1; // Failsafe
344
345 if (i < firstButton)
346 {
347 while ((i < firstButton) && (taskButtonsOffset > 0))
348 {
350 firstButton = FindFirstVisible();
351 }
352 }
353 else if (i > lastButton)
354 {
355 while ((i > lastButton) && (taskButtonsOffset < ((int)taskList.size() - 1)))
356 {
358 lastButton = FindLastVisible(FindFirstVisible());
359 }
360 if (lastButton < 0) taskButtonsOffset = 0; // Failsafe
361 }
362 }
364 {
365// int i = FindFirstVisible();
366// int centerX = taskList[i]->r.left + ((taskList[i]->r.right - taskList[i]->r.left) / 2);
367// int centerY = taskList[i]->r.top + ((taskList[i]->r.bottom - taskList[i]->r.top) / 2);
368// POINT pt = { centerX, centerY };
369// ClientToScreen(pToolbar->hToolbarWnd, &pt);
370// SetCursorPos(pt.x, pt.y);
371
374 }
375 // else if (pSettings->taskbarSorting == TASKBAR_SORT_BY_NAME) SortTaskbarItems(TASKBAR_SORT_BY_NAME); // ...in the end not that attractive given that task titles may change over time... (kept only for future reference)
376
377 // Since one task has become active and the others non-active
378 // we need to refresh all task buttons -> use NULL as WPARAM
379// if (cloakingChanged) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_REFRESH);
380// else SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)window, (LPARAM)TASKITEM_ACTIVATED);
381 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)window, (LPARAM)TASKITEM_ACTIVATED);
382 }
383 else // -> Focus has moved to something not shown on the taskbar... (e.g. *box UI element)
384 {
385 bool foundActive = false;
386
387 for (int i=0; i < (int)taskList.size(); i++)
388 {
389 if (taskList[i]->active) foundActive = true;
390 taskList[i]->active = false;
391 }
392
393 if (foundActive) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_ACTIVATED);
394 }
395}
MenuCommon * pMenuCommon
Definition Blackbox.cpp:41
#define TASKITEM_ACTIVATED
Definition BBApi.h:288
#define TASKBAR_SORT_BY_LAST_USED
Definition Settings.h:49
#define TASKBAR_SORT_FOLLOW_ACTIVE
Definition Settings.h:48
bool Hide(int index=0)
Definition MenuCommon.cpp:1028
int taskbarSorting
Definition Settings.h:217
void SortTaskbarItems(int mode)
Definition Taskbar.cpp:1882
int GetTaskButtonsToDraw()
Definition Taskbar.cpp:1782

◆ GetActiveTask()

int Taskbar::GetActiveTask ( )
403{
404 // Find the currently active task...
405 for (int i=0; i < (int)taskList.size(); i++)
406 {
407 if (taskList[i]->active) return i;
408 }
409
410 return NULL;
411}

◆ GetActiveWindow()

HWND Taskbar::GetActiveWindow ( )
414{
415 // Find the currently active window...
416 for (int i=0; i < (int)taskList.size(); i++)
417 {
418 if (taskList[i]->active) return taskList[i]->hwnd;
419 }
420
421 return NULL;
422}

◆ RedrawTask()

void Taskbar::RedrawTask ( HWND window)
430{
431 int i = FindTask(window);
432 if (i != -1)
433 {
434 bool cloaked = CheckCloakedWindow(window);
435
436 bool cloakingChanged = false;
437 if (taskList[i]->hidden != cloaked) cloakingChanged = true;
438 taskList[i]->hidden = cloaked;
439
440 if (pSettings->debugLogging && cloakingChanged)
441 {
442 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
443 GetWindowText(window, windowText, sizeof(windowText));
444 if (cloaked) sprintf(msg, "DEBUG -> Taskbar::RedrawTask -> Window cloaking! -> %s", windowText);
445 else sprintf(msg, "DEBUG -> Taskbar::RedrawTask -> Window uncloaking! -> %s", windowText);
446 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
447 Log(msg, "");
448 }
449
450 // if ((pSettings->taskbarMode != TASKBAR_MODE_HIDDEN) && pToolbar) InvalidateRect(pToolbar->hToolbarWnd, &taskList[i]->r, false);
451
452 if (cloakingChanged) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_REFRESH);
453 else if (!cloaked)
454 {
455 GetWindowText(taskList[i]->hwnd, taskList[i]->captionANSI, 255); // -> ANSI representation
456 GetWindowTextW(taskList[i]->hwnd, taskList[i]->captionUnicode, 255); // -> Unicode representation
457
458 if (flashingHwnd != 0) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)taskList[i]->hwnd, (LPARAM)TASKITEM_FLASHED);
459 else SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)taskList[i]->hwnd, (LPARAM)TASKITEM_MODIFIED);
460 }
461 }
462 else
463 {
464/*
465 if (pSettings->debugLogging)
466 {
467 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
468 GetWindowText(window, windowText, sizeof(windowText));
469 sprintf(msg, "DEBUG -> Taskbar::RedrawTask -> Task not found, redirecting to AddTask... -> %s", windowText);
470 // SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
471 Log(msg, "");
472 }
473*/
474 // The task to be redrawn wasn't present in the taskList for some reason, so let's add it... (nb. AddTask will perform IsAppWindow() etc checks itself)
475 AddTask(window);
476 }
477}
#define TASKITEM_MODIFIED
Definition BBApi.h:287
#define TASKITEM_FLASHED
Definition BBApi.h:291
HWND flashingHwnd
Definition Taskbar.h:144
void AddTask(HWND newWindow)
Definition Taskbar.cpp:117

◆ ActivateShellWindow()

void Taskbar::ActivateShellWindow ( )
485{
486 for (int i=0; i < (int)taskList.size(); i++)
487 {
488 taskList[i]->active = false;
489 }
490
491// SetForegroundWindow(hBlackboxWnd);
492
493 // Since all tasks have become non-active we need
494 // to refresh all task buttons -> use NULL as WPARAM
495 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_ACTIVATED);
496}

◆ MinimizeAllWindows()

void Taskbar::MinimizeAllWindows ( )
504{
505 // Minimize all windows...
506 for (int i=0; i < (int)taskList.size(); i++)
507 {
508// if (!IsIconic(taskList[i]->hwnd)) ShowWindow(taskList[i]->hwnd, SW_MINIMIZE);
509 ShowWindow(taskList[i]->hwnd, SW_MINIMIZE);
510// if (taskList[i]->isAppPlugin) SendMessage(taskList[i]->hwnd, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Hide");
511// else ShowWindow(taskList[i]->hwnd, SW_MINIMIZE);
512 taskList[i]->active = false;
513 }
514
515 // Since all tasks have become non-active we need
516 // to refresh all task buttons -> use NULL as WPARAM
517 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_ACTIVATED);
518
519 // Finally, we trigger the "minimize" message...
520 SendMessage(hBlackboxWnd, BB_WINDOWMINIMIZE, 0, (LPARAM)taskList[0]->hwnd);
522}
#define BB_WINDOWMINIMIZE
Definition BBApi.h:207
void PlaySoundFX(int sound)
Definition Sounds.cpp:40
@ SFX_TASKBAR_MINIMIZE
Definition Sounds.h:51

◆ RestoreAllWindows()

void Taskbar::RestoreAllWindows ( )
530{
531 // Find the currently active window so we can
532 // focus it again after restoring all windows...
533 HWND activeWindow = GetActiveWindow();
534
535 //====================
536
537 // Restore all windows... (except DWM cloaked ones)
538 for (int i=0; i < (int)taskList.size(); i++)
539 {
540// if (IsIconic(taskList[i]->hwnd) && !CheckCloakedWindow(taskList[i]->hwnd))
541 if (IsIconic(taskList[i]->hwnd) && !taskList[i]->hidden)
542 {
543 if (taskList[i]->isAppPlugin) SendMessage(taskList[i]->hwnd, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
544 else ShowWindow(taskList[i]->hwnd, SW_RESTORE);
545 }
546 }
547
548 //====================
549
550 // If we had an active window to begin with we now focus it again...
551 if (activeWindow != NULL)
552 {
553 SetForegroundWindow(activeWindow);
554 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)activeWindow);
555 }
556
558}
#define BB_BROADCAST
Definition BBApi.h:245
#define BB_BRINGTOFRONT
Definition BBApi.h:182
@ SFX_TASKBAR_RESTORE
Definition Sounds.h:52
HWND GetActiveWindow()
Definition Taskbar.cpp:413

◆ DropFiles()

int Taskbar::DropFiles ( HWND hwnd,
WPARAM wParam,
bool checkTaskbarDrop )
566{
567 if (checkTaskbarDrop)
568 {
569 if (MouseButtonOnTaskbar(hwnd, WM_DROPFILES, wParam, NULL)) return 0;
570 }
571
572 return ParseDropFiles(hwnd, wParam);
573}
int ParseDropFiles(HWND hwnd, WPARAM wParam)
Definition BBApi.cpp:3381
bool MouseButtonOnTaskbar(HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam)
Definition Taskbar.cpp:580

◆ MouseButtonOnTaskbar()

bool Taskbar::MouseButtonOnTaskbar ( HWND hwnd,
unsigned int message,
WPARAM wParam,
LPARAM lParam )
581{
582 POINT pt;
583
584 if (message == WM_DROPFILES)
585 {
586 // Drag'n'drop of files onto a task button...
587 GetCursorPos(&pt);
588 ScreenToClient(hwnd, &pt);
589 }
590 else
591 {
592 // Regular mouse clicks on a task button...
593 pt.x = LOWORD(lParam);
594 pt.y = HIWORD(lParam);
595 }
596
597 if (!PtInRect(&TaskbarRect, pt)) return false;
598
599 //====================
600
601 HWND window;
602
603 for (int i = FindFirstVisible(); i < (int)taskList.size(); i++)
604 {
605 // Should we exclude tasks not on the current workspace? (-> user configurable "current workspace only" taskbar setting)
606 if (!OnCurrentWorkspace(taskList[i]->hwnd)) continue;
607
608 //====================
609
610 if (PtInRect(&taskList[i]->r, pt))
611 {
612 switch (message)
613 {
614 //====================
615
616 case WM_LBUTTONDOWN:
617 {
619
620 if (GetAsyncKeyState(VK_CONTROL) & 0x8000) // -> Ctrl+Left click on the task button
621 {
622 // Toggle the window's stickiness... (i.e. whether it should be visible on all workspaces or not)
623 if (!CheckSticky(taskList[i]->hwnd))
624 {
625 MakeSticky(taskList[i]->hwnd);
626 taskList[i]->workspace = 254; // -> Visible on all workspaces! ("sticky")
627 }
628 else
629 {
630 RemoveSticky(taskList[i]->hwnd);
631 taskList[i]->workspace = pSettings->currentWorkspace; // -> Visible only on the current workspace! ("non-sticky")
632 }
633/*
634 window = taskList[i]->hwnd;
635 if (IsIconic(window))
636 {
637 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
638 else ShowWindow(window, SW_RESTORE);
639 if (!CheckSticky(taskList[i]->hwnd)) taskList[i]->workspace = pSettings->currentWorkspace;
640 }
641 SetForegroundWindow(window);
642 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
643*/
644/*
645 if (pSettings->debugLogging)
646 {
647 char msg[MAX_LINE_LENGTH];
648 if (CheckSticky(window)) sprintf(msg, "Taskbar -> %s -> Sticky! (on all workspaces)", taskList[i]->captionANSI);
649 else sprintf(msg, "Taskbar -> %s -> Located on workspace #%d", taskList[i]->captionANSI, taskList[i]->workspace+1);
650 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
651 }
652*/
654 }
655
656 // First we show and focus the window in question...
657 window = taskList[i]->hwnd;
658 if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
659// if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
660// else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
661 SetForegroundWindow(window);
662 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
663/*
664 if (GetAsyncKeyState(VK_MENU) & 0x8000)
665 {
666
667 if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
668 {
669 window = taskList[i]->hwnd;
670 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
671 else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
672 SetForegroundWindow(window);
673 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
674 PostMessage(window, WM_SYSCOMMAND, SC_MOVE, 0);
675 }
676 else RestoreAllWindows();
677 }
678*/
679 if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+Left click on the task button
680 {
681 if (!CheckSticky(taskList[i]->hwnd))
682 {
683 // Move the window to the next workspace...
684 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
685 MakeSticky(window);
687 RemoveSticky(window);
688 taskList[i]->workspace = pSettings->currentWorkspace;
689 }
690
692 }
693 else if (GetAsyncKeyState(VK_SHIFT) & 0x8000) // -> Shift+Left click on the task button
694 {
695 // Toggle the priority class of the window's parent process... (Default<->High)
696 DWORD pid = 0;
697 GetWindowThreadProcessId(taskList[i]->hwnd, &pid);
698 HANDLE h = OpenProcess((PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION), TRUE, pid);
699 if (taskList[i]->priorityClass == 0)
700 {
701 taskList[i]->priorityClass = GetPriorityClass(h);
702 SetPriorityClass(h, HIGH_PRIORITY_CLASS);
703 }
704 else
705 {
706 SetPriorityClass(h, taskList[i]->priorityClass);
707 taskList[i]->priorityClass = 0;
708 }
709 CloseHandle(h);
710
712 }
713 else // -> Left click on the task button (no keyboard modifiers)
714 {
715 // ...no specific action needed here, as we've already made the window visible above...
716
718 }
719
720 return true;
721 }
722 break;
723
724 //====================
725
726 case WM_LBUTTONUP:
727 case WM_LBUTTONDBLCLK:
728 {
729 return true;
730 }
731 break;
732
733 //====================
734
735 case WM_RBUTTONDOWN: // -> Minimize window...
736 {
737 if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+Right click on the task button
738 {
741 }
742/*
743 {
744 if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
745 {
746 window = taskList[i]->hwnd;
747 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
748 else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
749 SetForegroundWindow(window);
750 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
751 PostMessage(window, WM_SYSCOMMAND, SC_SIZE, 0);
752 }
753 else MinimizeAllWindows();
754 }
755*/
756 else if (GetAsyncKeyState(VK_CONTROL) & 0x8000) // -> Ctrl+Right click on the task button
757 {
758 return true; // Unassigned (for now at least)
759 }
760 else if (GetAsyncKeyState(VK_SHIFT) & 0x8000) // -> Shift+Right click on the task button
761 {
762 return true; // Pass through -> Show the configuration menu on RBUTTONUP, see below!
763 }
764 else // -> Right click on the task button (no keyboard modifiers)
765 {
766 if ((message == WM_RBUTTONDOWN) && pSettings->taskbarCurrentOnly && (taskButtonsToDraw == 1)) blockNextMouseClick = true;
767
768 // Minimize the window...
769 window = taskList[i]->hwnd;
770 if (!IsIconic(window)) ShowWindow(window, SW_MINIMIZE);
771// if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Hide");
772// else if (!IsIconic(window)) ShowWindow(window, SW_MINIMIZE);
773 taskList[i]->active = false;
774// taskList[i]->workspace = 255;
775 SendMessage(hBlackboxWnd, BB_WINDOWMINIMIZE, 0, (LPARAM)window);
776
777// if ((pSettings->taskbarMode != TASKBAR_MODE_HIDDEN) && pToolbar) InvalidateRect(pToolbar->hToolbarWnd, &pTaskbar->taskList[i]->r, false);
778 if (pSettings->taskbarMode != TASKBAR_MODE_HIDDEN) SendMessage(hBlackboxWnd, BB_TASKSUPDATE, (WPARAM)taskList[i]->hwnd, (LPARAM)TASKITEM_MODIFIED);
779
781 }
782
783 return true;
784 }
785 break;
786
787 //====================
788
789 case WM_RBUTTONUP: // Only show menus on RButtonUp...
790 {
791 if (GetAsyncKeyState(VK_SHIFT) & 0x8000) SendMessage(GetBBWnd(), BB_MENU, 2, 0);
792 return true;
793 }
794 break;
795
796 //====================
797
798 case WM_MBUTTONDOWN:
799 {
801
802 // First we show and focus the window in question...
803 window = taskList[i]->hwnd;
804 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
805 else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
806 SetForegroundWindow(window);
807 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
808
809 if (GetAsyncKeyState(VK_CONTROL) & 0x8000) // -> Ctrl+Mid click on the task button
810 {
811 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Left");
812 }
813 else if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+Mid click on the task button
814 {
815 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Right");
816 }
817/*
818 if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+Mid click on the task button
819 {
820 // Shade/unshade the window...
821 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin ToggleShaded");
822 else if (pDesktop) pDesktop->ShadeWindow();
823 PlaySoundFX(SFX_TASKBAR_ZOOM); // ...assign a unique SFX later? (TBD)
824 }
825 else if (GetAsyncKeyState(VK_CONTROL) & 0x8000) // -> Ctrl+Mid click on the task button
826 {
827 if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
828 {
829 if (!CheckSticky(taskList[i]->hwnd))
830 {
831 MakeSticky(taskList[i]->hwnd);
832 taskList[i]->workspace = 254; // Visible on all workspaces
833 }
834 else
835 {
836 RemoveSticky(taskList[i]->hwnd);
837 taskList[i]->workspace = pSettings->currentWorkspace;
838 }
839 }
840 else if (!CheckSticky(taskList[i]->hwnd))
841 {
842 // Move the window to the next/previous workspace...
843 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
844 MakeSticky(window);
845 if (GetAsyncKeyState(VK_MENU) & 0x8000) pWorkspaces->PreviousWorkspace();
846 else pWorkspaces->NextWorkspace();
847 RemoveSticky(window);
848 taskList[i]->workspace = pSettings->currentWorkspace;
849
850// if (GetAsyncKeyState(VK_MENU) & 0x8000) pWorkspaces->MoveWindowToPreviousWorkspace(window);
851// else pWorkspaces->MoveWindowToNextWorkspace(window);
852 }
853
854 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Left"); // Temporary (for now at least)
855 return true; // Unassigned (for now at least)
856 }
857 else if (GetAsyncKeyState(VK_SHIFT) & 0x8000) // -> Shift+Mid click on the task button
858 {
859/*
860 if (!taskList[i]->isAppPlugin)
861 {
862 // Close the application...
863 window = taskList[i]->hwnd;
864 if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
865 SetForegroundWindow(window);
866 PostMessage(window, WM_SYSCOMMAND, SC_CLOSE, 0);
867 }
868
869 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Right"); // Temporary (for now at least)
870 return true; // Unassigned (for now at least)
871 }
872*/
873 else // -> Mid click on the task button (no keyboard modifiers)
874 {
875 // Toggle the window maximized/restored... (i.e. equivalent to clicking the window's "zoom" button)
876
877 if (taskList[i]->dimensions.placement != PLACEMENT_DEFAULT)
878 {
881 }
882 else
883 {
884 if (taskList[i]->isAppPlugin)
885 {
886 SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin ToggleMaximized");
887 }
888 else if (IsZoomed(window))
889 {
890 ShowWindow(window, SW_RESTORE);
891/*
892 if (pSettings->desktopAreaDefined) // ...JUST TESTING SOME STUFF... ;)
893 {
894 RECT workArea;
895 SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&workArea, SPIF_SENDCHANGE);
896 int newWindowX = workArea.left + pSettings->desktopArea.left;
897 int newWindowY = workArea.top + pSettings->desktopArea.top;
898 int newWindowWidth = (workArea.right - workArea.left) - pSettings->desktopArea.left - pSettings->desktopArea.right;
899 int newWindowHeight = (workArea.bottom - workArea.top) - pSettings->desktopArea.top - pSettings->desktopArea.bottom;
900 SetWindowPos(window, NULL, newWindowX, newWindowY, newWindowWidth, newWindowHeight, SWP_SHOWWINDOW | SWP_NOZORDER);
901 }
902*/
903 }
904 else ShowWindow(window, SW_MAXIMIZE);
905
907 }
908 }
909
910 return true;
911 }
912 break;
913
914 //====================
915
916 case WM_MBUTTONUP:
917 {
918 return true;
919 }
920 break;
921
922 //====================
923
924 case WM_XBUTTONDOWN:
925 {
927
928 // First we show and focus the window in question...
929 window = taskList[i]->hwnd;
930 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
931 else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
932 SetForegroundWindow(window);
933 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
934
935 if (HIWORD(wParam) == XBUTTON1)
936 {
937 if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+X1 click on the task button
938 {
939 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Right"); // Temporary (for now at least)
940 }
941 else // -> X1 click on the task button (no keyboard modifiers)
942 {
943 if (!CheckSticky(taskList[i]->hwnd))
944 {
945 // Move the window to the *previous* workspace...
946 MakeSticky(window);
948 RemoveSticky(window);
949 taskList[i]->workspace = pSettings->currentWorkspace;
950 }
951 }
952 }
953 else if (HIWORD(wParam) == XBUTTON2)
954 {
955 if (GetAsyncKeyState(VK_MENU) & 0x8000) // -> Alt+X2 click on the task button
956 {
957 SendMessage(hBlackboxWnd, BB_BROADCAST, 0, (LPARAM)"@xoblite Window Tile Left"); // Temporary (for now at least)
958 }
959 else // -> X2 click on the task button (no keyboard modifiers)
960 {
961 if (!CheckSticky(taskList[i]->hwnd))
962 {
963 // Move the window to the *next* workspace...
964 MakeSticky(window);
966 RemoveSticky(window);
967 taskList[i]->workspace = pSettings->currentWorkspace;
968 }
969 }
970 }
971
972 return true;
973 }
974 break;
975
976 case WM_XBUTTONUP: { } break;
977
978 //====================
979
980 case WM_DROPFILES:
981 {
982 // Drag'n'drop of file(s) onto the task button:
983 // -> Forward the drag'n'drop information to the window in question...
984 window = taskList[i]->hwnd;
985 if (taskList[i]->isAppPlugin) SendMessage(window, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
986 else if (IsIconic(window)) ShowWindow(window, SW_RESTORE);
987 SetForegroundWindow(window);
988 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)window);
989
990 PostMessage(window, WM_DROPFILES, wParam, lParam);
991
992 return true;
993 }
994 break;
995
996 //====================
997 }
998 }
999 }
1000
1001 return false;
1002}
void RemoveSticky(HWND window)
Definition BBApi.cpp:2978
bool CheckSticky(HWND window)
Definition BBApi.cpp:2994
Workspaces * pWorkspaces
Definition Blackbox.cpp:51
void MakeSticky(HWND window)
Definition BBApi.cpp:2965
Taskbar * pTaskbar
Definition Blackbox.cpp:47
#define BB_MENU
Definition BBApi.h:160
#define TASKBAR_MODE_HIDDEN
Definition Settings.h:42
@ SFX_TASKBAR_TILE
Definition Sounds.h:54
@ SFX_TOGGLE_ELEMENT
Definition Sounds.h:48
@ SFX_TASKBAR_ZOOM
Definition Sounds.h:53
bool taskbarCurrentOnly
Definition Settings.h:219
int taskbarMode
Definition Settings.h:215
void TileWindow(int placement)
Definition Taskbar.cpp:1903
RECT TaskbarRect
Definition Taskbar.h:126
bool OnCurrentWorkspace(HWND window)
Definition Taskbar.cpp:1759
void MinimizeAllWindows()
Definition Taskbar.cpp:503
void NextWorkspace()
Definition Workspaces.cpp:369
void PreviousWorkspace()
Definition Workspaces.cpp:359

◆ DrawTaskbar()

void Taskbar::DrawTaskbar ( HDC hdc,
int iconPos,
RECT taskbarRect )
1010{
1011 CopyRect(&TaskbarRect, &taskbarRect);
1012 activeTaskAvailable = false;
1013
1014 // Reset flash indicator if flashing is disabled...
1016
1017 //====================
1018
1020 {
1021 // Failsafe: Abort if the taskbar is not wide enough to fit all the task buttons... (nb. quite simplistic implementation at the moment)
1022 if ((TaskbarRect.right - TaskbarRect.left) < (taskButtonsToDraw*16)) return;
1023 }
1024
1025 //====================
1026
1027 // Get the number of task buttons to draw...
1029
1031 {
1032 HFONT font = CreateFont(pSettings->Toolbar->FontHeight, 0, 0, 0, pSettings->Toolbar->FontWeight, false, false, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, pSettings->Toolbar->Font);
1033 HGDIOBJ oldfont = SelectObject(hdc, font);
1034 SetBkMode(hdc, TRANSPARENT);
1035
1036 SetTextColor(hdc, pSettings->Toolbar->TextColor);
1037
1038 unsigned int format = DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS;
1039
1040 int totalNumberOfTasks = 0;
1042 {
1043 for (int i = 0; i < (int)taskList.size(); i++)
1044 {
1045 if (!taskList[i]->hidden) totalNumberOfTasks++;
1046 }
1047 }
1048
1049 if (pSettings->taskbarCurrentOnly && (totalNumberOfTasks > 0))
1050 {
1051 // -> There are no tasks on the current workspace, but there are on other workspaces...
1052// DrawText(hdc, "(No tasks on this workspace)", strlen("(No tasks on this workspace)"), &TaskbarRect, DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS);
1054 }
1055 else
1056 {
1057 // -> There are no tasks on the current or any other workspace, so let's advertise the shell instead... ;)
1058// DrawText(hdc, "xoblite", strlen("xoblite"), &TaskbarRect, DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS);
1059// DrawText(hdc, "Welcome to xoblite.", strlen("Welcome to xoblite."), &TaskbarRect, DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS);
1061
1062/*
1063 int width = TaskbarRect.right - TaskbarRect.left;x
1064 int iconSize = height;
1065 if (iconSize > 16) iconSize = 16;
1066 int xpos = TaskbarRect.left + ((width - iconSize) / 2);
1067 int ypos = TaskbarRect.top + ((height - iconSize) / 2);
1068 RECT iconRect;
1069 SetRect(&iconRect, xpos, ypos, xpos+iconSize, ypos+iconSize);
1070
1071 HICON xobIcon = LoadIcon(pToolbar->hToolbarInstance, MAKEINTRESOURCE(IDI_XOBLITE));
1072 DrawSatHueIcon(hdc, iconRect, xobIcon, iconSize, 255, 0);
1073 DeleteObject(xobIcon);
1074*/
1075 }
1076
1077 DeleteObject(SelectObject(hdc, oldfont));
1078 }
1079 else DrawTaskButtons(hdc);
1080}
void DrawTextWithEffects(HDC hdc, RECT r, LPSTR text, unsigned int format, COLORREF textColor, bool outline, COLORREF outlineColor, bool shadow, COLORREF shadowColor, int shadowX, int shadowY)
Definition BBApi.cpp:3519
bool taskbarFlashing
Definition Settings.h:220
bool toolbarVertical
Definition Settings.h:191
StyleItem * Toolbar
Definition Settings.h:424
int DrawTaskButtons(HDC hdc)
Definition Taskbar.cpp:1087
bool activeTaskAvailable
Definition Taskbar.h:128
COLORREF TextColor
Definition BBApi.h:408
bool FontOutline
Definition BBApi.h:430
char ShadowX
Definition BBApi.h:426
char ShadowY
Definition BBApi.h:426
COLORREF OutlineColor
Definition BBApi.h:431
bool FontShadow
Definition BBApi.h:423
COLORREF ShadowColor
Definition BBApi.h:429
int FontWeight
Definition BBApi.h:410
int FontHeight
Definition BBApi.h:409
char Font[128]
Definition BBApi.h:413

◆ DrawTaskButtons()

int Taskbar::DrawTaskButtons ( HDC hdc)
1088{
1089 RECT TaskbarButtonsRect;
1090 CopyRect(&TaskbarButtonsRect, &TaskbarRect);
1091
1092 int taskbarScrollIndicatorSize;
1093 if (pSettings->Toolbar->marginWidth > 0) taskbarScrollIndicatorSize = pSettings->Toolbar->marginWidth;
1094 else if (pSettings->Toolbar->borderWidth > 0) taskbarScrollIndicatorSize = pSettings->Toolbar->borderWidth;
1095 taskbarScrollIndicatorSize = 2 * pSettings->scalingFactorHiDPI;
1096
1097 // Get the number of task buttons to draw...
1098// GetTaskButtonsToDraw();
1099
1100 // Get the range (first<->last) of currently visible taskbar items, if so applicable...
1101 int firstButton = FindFirstVisible();
1102 int lastButton = FindLastVisible(firstButton);
1103 if (lastButton < 0) lastButton = (int)taskList.size()-1; // Failsafe
1104
1105 // Is the taskbar scrollable to the left/up? If so, make room for indicator...
1106 if (taskButtonsOffset > 0)
1107 {
1108 if (pSettings->toolbarVertical) TaskbarButtonsRect.top += taskbarScrollIndicatorSize;
1109 else TaskbarButtonsRect.left += taskbarScrollIndicatorSize;
1110 }
1111
1112 // Is the taskbar scrollable to the right/down? If so, make room for indicator...
1113 for (int i = (lastButton+1); i < (int)taskList.size(); i++)
1114 {
1115 if (!OnCurrentWorkspace(taskList[i]->hwnd) || taskList[i]->hidden) continue;
1116 else
1117 {
1118 if (pSettings->toolbarVertical) TaskbarButtonsRect.bottom -= taskbarScrollIndicatorSize;
1119 else TaskbarButtonsRect.right -= taskbarScrollIndicatorSize;
1120 break;
1121 }
1122 }
1123
1124 // For the vertical toolbar we only allow Bars or Bars+Icons mode... (at least for the time being)
1125 int drawTaskbarMode = pSettings->taskbarMode;
1127
1128 //====================
1129
1130 // Calculate task button and icon dimensions...
1131
1132 int oldButtonHeight = taskButtonHeightMinusPadding;
1133 taskButtonHeight = TaskbarButtonsRect.bottom - TaskbarButtonsRect.top;
1135 {
1137 // ##### EXPERIMENTAL SAFEGUARD #####
1138 // Just after startup the height of the vertical toolbar may
1139 // not yet have been set to match the number of task buttons...
1140 if (taskButtonHeight < pSettings->Toolbar->FontHeight) return 0;
1141 // ##################################
1142 taskButtonHeightMinusPadding = taskButtonHeight;;// -pSettings->Toolbar->marginWidth;
1143 }
1144 else
1145 {
1147 }
1148
1149 if (taskButtonHeightMinusPadding != oldButtonHeight) cachedTaskButtonsExist = false;
1150
1151 // Choose icon size depending on the height of the task button...
1152// iconSize = 11;
1153// if (taskButtonHeight > 20) iconSize = 16;
1154// if (taskButtonHeight > 36) iconSize = 32;
1156 else iconSize = 16;
1157 if (iconSize < 11) iconSize = 11;
1158
1159/*
1160 if (drawTaskbarMode != TASKBAR_MODE_ICONS) // -> Bars or Bars+Icons mode...
1161 {
1162 taskButtonWidth = TaskbarButtonsRect.right - TaskbarButtonsRect.left;
1163 if (pSettings->toolbarVertical)
1164 {
1165 taskButtonWidthMinusPadding = taskButtonWidth;
1166 }
1167 else
1168 {
1169 if (taskButtonsToDraw > 0) taskButtonWidth = taskButtonWidth / taskButtonsToDraw;
1170 taskButtonWidthMinusPadding = taskButtonWidth - 2; // Padding 2 pixels between task buttons...
1171// taskButtonWidthMinusPadding = taskButtonWidth + pSettings->InactiveTask->borderWidth; // No padding between task buttons...
1172 }
1173 }
1174 else // TASKBAR_MODE_ICONS -> Icons mode
1175 {
1176 taskButtonWidth = iconSize + 7;
1177 taskButtonWidthMinusPadding = taskButtonWidth - 1; // Padding 1 pixel between task buttons...
1178// taskButtonWidth = iconSize + 5;
1179// taskButtonWidthMinusPadding = taskButtonWidth + pSettings->InactiveTask->borderWidth; // No padding between task buttons...
1180 }
1181*/
1182
1183 int oldButtonWidth = taskButtonWidthMinusPadding;
1184 taskButtonWidth = TaskbarButtonsRect.right - TaskbarButtonsRect.left;
1186 {
1188 }
1189 else
1190 {
1192 taskButtonWidthMinusPadding = taskButtonWidth - 2; // Padding 2 pixels between task buttons...
1193// taskButtonWidthMinusPadding = taskButtonWidth + pSettings->InactiveTask->borderWidth; // No padding between task buttons...
1194 }
1195
1196 if (taskButtonWidthMinusPadding != oldButtonWidth) cachedTaskButtonsExist = false;
1197
1198 //====================
1199
1200 // If we have not yet created any cached task buttons, or they need to be updated for other reasons, let's do that...
1202 {
1203/*
1204 if (cachedTaskButtonActive) DeleteDC(cachedTaskButtonActive);
1205 if (cachedTaskButtonInactive) DeleteDC(cachedTaskButtonInactive);
1206 cachedTaskButtonActive = CreateCompatibleDC(NULL);
1207 cachedTaskButtonInactive = CreateCompatibleDC(NULL);
1208*/
1210
1211 HBITMAP tempBitmapActive = CreateCompatibleBitmap(hdc, taskButtonWidthMinusPadding, taskButtonHeightMinusPadding);
1212 HBITMAP oldBitmapActive = (HBITMAP)SelectObject(cachedTaskButtonActive, tempBitmapActive);
1213 DeleteObject(oldBitmapActive);
1215 DeleteObject(tempBitmapActive);
1216
1217 HBITMAP tempBitmapInactive = CreateCompatibleBitmap(hdc, taskButtonWidthMinusPadding, taskButtonHeightMinusPadding);
1218 HBITMAP oldBitmapInactive = (HBITMAP)SelectObject(cachedTaskButtonInactive, tempBitmapInactive);
1219 DeleteObject(oldBitmapInactive);
1221 DeleteObject(tempBitmapInactive);
1222
1223 // Set the "cached task buttons created" indicator...
1225 }
1226
1227 //====================
1228
1229 // Delete any existing taskbar tooltips... (nb. because a full flush is much easier+safer than delta updates)
1231
1232 // ...and taskbar thumbnails...
1233 if (pToolbar->thumbnail != NULL)
1234 {
1235 DwmUnregisterThumbnail(pToolbar->thumbnail);
1236 pToolbar->thumbnail = NULL;
1237 }
1238
1239 //====================
1240
1241 // Draw the taskbar buttons...
1242 int drawnTasks = 0;
1243
1244 for (int i = firstButton; i <= lastButton; i++)
1245 {
1246 if (drawnTasks >= taskButtonsToDraw) break;
1247
1248 // Exclude tasks not on the current workspace?
1249 if (!OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1250 // Exclude hidden/cloaked tasks...
1251 if (taskList[i]->hidden) continue;
1252
1253 //====================
1254
1255 // Calculate the bounding rect of the current task button, and save it for later use...
1256
1257 CopyRect(&currentTaskButton, &TaskbarButtonsRect);
1258
1260 {
1261 currentTaskButton.top = TaskbarButtonsRect.top + (drawnTasks * taskButtonHeight);
1263
1264 // Extend the bottommost button to fit the bottom border of the taskbar...
1265 if (drawnTasks == (taskButtonsToDraw-1)) currentTaskButton.bottom = TaskbarButtonsRect.bottom;
1266
1267 if (currentTaskButton.bottom > TaskbarButtonsRect.bottom) break; // Failsafe
1268 }
1269 else
1270 {
1271 currentTaskButton.left = TaskbarButtonsRect.left + (drawnTasks * taskButtonWidth);
1273
1274 if (drawTaskbarMode != TASKBAR_MODE_ICONS) // Bars or Bars+Icons mode
1275 {
1276 // Extend the rightmost button to fit the right border of the taskbar...
1277 if (drawnTasks == (taskButtonsToDraw-1)) currentTaskButton.right = TaskbarButtonsRect.right;
1278 }
1279
1280 if (currentTaskButton.right > TaskbarButtonsRect.right) break; // Failsafe
1281 }
1282
1283 CopyRect(&taskList[i]->r, &currentTaskButton);
1284
1285 //====================
1286
1287 // Have we previously increased the process priority class for this task? If so, let's indicate that...
1288 if ((taskList[i]->priorityClass != 0) || CheckSticky(taskList[i]->hwnd))
1289 {
1290 int highPrioIndicatorSize = 1 * pSettings->scalingFactorHiDPI;
1291
1292 RECT r;
1293 SetRect(&r, currentTaskButton.left, currentTaskButton.top, currentTaskButton.right, currentTaskButton.top+highPrioIndicatorSize);
1294
1295 COLORREF priorityIndicatorColor = 0x0000ff; // Show a smoothly faded in/out *RED* gradient indicator for high priority tasks!
1296 COLORREF stickyIndicatorColor = 0x008888; // Show a smoothly faded in/out *YELLOW* gradient indicator for stickied tasks!
1297 // ...or if both high priority *and* stickied, a top yellow / bottom red gradient indicator.
1298
1299 if (CheckSticky(taskList[i]->hwnd)) MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.top), stickyIndicatorColor, stickyIndicatorColor, GetPixel(hdc, r.right - 1, r.top), 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1300 else MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.top), priorityIndicatorColor, priorityIndicatorColor, GetPixel(hdc, r.right-1, r.top), 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1301
1302 SetRect(&r, currentTaskButton.left, currentTaskButton.bottom-highPrioIndicatorSize, currentTaskButton.right, currentTaskButton.bottom);
1303 if (taskList[i]->priorityClass != 0) MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.bottom-1), priorityIndicatorColor, priorityIndicatorColor, GetPixel(hdc, r.right-1, r.bottom-1), 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1304 else MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, GetPixel(hdc, r.left, r.bottom-1), stickyIndicatorColor, stickyIndicatorColor, GetPixel(hdc, r.right-1, r.bottom-1), 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1305
1306 CopyRect(&r, &currentTaskButton);
1307 InflateRect(&r, 0, -(highPrioIndicatorSize*2));
1310 }
1311 else if (taskList[i]->hwnd == flashingHwnd) // Flashing task button?
1312 {
1313 // Paint border+background for this flashed taskbar button...
1315 }
1316// else if ((drawnTasks == (taskButtonsToDraw-1)) && (drawTaskbarMode != TASKBAR_MODE_ICONS) && !pSettings->toolbarVertical) // Rightmost button on a horizontal taskbar?
1317 else if (drawnTasks == (taskButtonsToDraw-1))
1318 {
1319 // Manually paint the border+background for the last visible task button... (i.e. don't use the fixed size cached
1320 // task button bitmap, in order to allow this button's size to be adjusted to perfectly fit the remaining space available)
1323 }
1324 else
1325 {
1326 // Copy the cached task button bitmap into the temporary buffer...
1329 }
1330
1331 //====================
1332
1333 if (taskList[i]->active)
1334 {
1335 // Store the active task RECT for possible later use by the toolbar... (i.e. active task alpha transparency etc)
1336 CopyRect(&ActiveTaskRect, &currentTaskButton);
1337 activeTaskAvailable = true;
1338 }
1339
1340 //====================
1341
1342 int padding = ((currentTaskButton.bottom - currentTaskButton.top - iconSize) / 2);
1343
1344 // Should we draw an icon on the task button? (-> all taskbar modes except "Bars" mode)
1345 if (drawTaskbarMode != TASKBAR_MODE_BARS)
1346 {
1347 // Fetch the window icon...
1348 currentTaskButtonWnd = taskList[i]->hwnd;
1350 currentTaskButtonIcon = NULL;
1351
1352 if (taskList[i]->isAppPlugin) // -> "Application-like" plugins get a xoblite icon for their task buttons...
1353 {
1354 currentTaskButtonIcon = LoadIcon(pToolbar->hToolbarInstance, MAKEINTRESOURCE(IDI_XOBLITE));
1355 }
1356 else
1357 {
1358 if (iconSize <= 16) // -> Use small size (ICON_SMALL) source icon when applicable...
1359 {
1360 SendMessageTimeout(currentTaskButtonWnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG|SMTO_BLOCK, 200, (PDWORD_PTR)&currentTaskButtonIcon);
1361 if (!currentTaskButtonIcon) currentTaskButtonIcon = (HICON)GetClassLongPtr(currentTaskButtonWnd, GCLP_HICONSM);
1362 }
1363 if (!currentTaskButtonIcon) SendMessageTimeout(currentTaskButtonWnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG|SMTO_BLOCK, 200, (PDWORD_PTR)&currentTaskButtonIcon);
1364 if (!currentTaskButtonIcon) currentTaskButtonIcon = (HICON)GetClassLongPtr(currentTaskButtonWnd, GCLP_HICON);
1365 }
1366
1367 // Calculate icon position...
1368 if (drawTaskbarMode == TASKBAR_MODE_BARSICONS)
1369 {
1370 // Bars+Icons mode -> Left adjusted icons...
1371 CopyRect(&iconRect, &currentTaskButton);
1372 InflateRect(&iconRect, -padding, 0);
1373 }
1374 else // TASKBAR_MODE_ICONS
1375 {
1376 // Icons mode -> Centered icons...
1377 iconRect.left = currentTaskButton.left + (((currentTaskButton.right - currentTaskButton.left) - iconSize) / 2);
1378 }
1379
1381 iconRect.right = iconRect.left + iconSize;
1382 iconRect.bottom = iconRect.top + iconSize;
1383
1384 // Draw the icon...
1386 {
1387 if (taskList[i]->active && !pSettings->taskbarActiveSatHue) DrawIconEx(hdc, iconRect.left, iconRect.top, currentTaskButtonIcon, iconSize, iconSize, 0, NULL, DI_NORMAL);
1389 }
1390
1392 }
1393
1394 //====================
1395
1396 // Copy the current task's window label, i.e. its titlebar text...
1397 // (note: this may later be used for the task button as well as its associated tooltip, so we should not add anything here.)
1398 GetWindowText(taskList[i]->hwnd, taskList[i]->captionANSI, 255); // -> ANSI representation
1399 GetWindowTextW(taskList[i]->hwnd, taskList[i]->captionUnicode, 255); // -> Unicode representation
1400
1401 // Should we draw the window label on the task button?
1402 if (drawTaskbarMode != TASKBAR_MODE_ICONS) // -> Bars or Bars+Icons mode
1403 {
1404 HFONT font = CreateFont(pSettings->Toolbar->FontHeight, 0, 0, 0, pSettings->Toolbar->FontWeight, false, false, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, pSettings->Toolbar->Font);
1405 HGDIOBJ oldfont = SelectObject(hdc, font);
1406 SetBkMode(hdc, TRANSPARENT);
1407
1408 CopyRect(&textRect, &currentTaskButton);
1409 InflateRect(&textRect, -padding, 0);
1410 if (drawTaskbarMode == TASKBAR_MODE_BARSICONS)
1411 {
1412 // ...adjust text to the already drawn icon...
1413 textRect.left = iconRect.right + padding;
1414 if (textRect.left > currentTaskButton.right) textRect.left = currentTaskButton.left; // "Failsafe"
1415 }
1416
1417 // Added support for Unicode for the task button labels...
1418 wchar_t currentTaskButtonCaption[275];
1420 {
1421 if (IsIconic(taskList[i]->hwnd)) // -> The task is minimized (workspace==255)
1422 {
1423// taskList[i]->workspace = 255; // ...just in case the task's workspace tag is not up-to-date for some reason...
1424 wcscpy(currentTaskButtonCaption, L"[_] ");
1425 }
1426 else if (CheckSticky(taskList[i]->hwnd)) // -> The task is "sticky" i.e. visible on all workspaces (sticky)
1427 {
1428 taskList[i]->workspace = 254; // ...just in case the task's workspace tag is not up-to-date for some reason...
1429 wcscpy(currentTaskButtonCaption, L"[*] ");
1430 }
1431 else // -> The task is visible and located on a single workspace
1432 {
1433 if (taskList[i]->workspace >= 254) taskList[i]->workspace = pSettings->currentWorkspace; // ...just in case the task's workspace tag is not up-to-date for some reason...
1434 swprintf(currentTaskButtonCaption, sizeof(currentTaskButtonCaption), L"[%d] ", taskList[i]->workspace + 1);
1435 }
1436 wcscat(currentTaskButtonCaption, taskList[i]->captionUnicode);
1437 }
1438 else wcscpy(currentTaskButtonCaption, taskList[i]->captionUnicode);
1439
1440 unsigned int flags = DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_WORD_ELLIPSIS;
1444
1445 DeleteObject(SelectObject(hdc, oldfont));
1446
1447 // Should we display a live preview thumbnail for the currently active task?
1448 if (taskList[i]->active && pSettings->taskbarActiveLivePreview)
1449 {
1450 HRESULT hr = DwmRegisterThumbnail(pToolbar->hToolbarWnd, taskList[i]->hwnd, &pToolbar->thumbnail);
1451 if (SUCCEEDED(hr))
1452 {
1453// RECT windowRect;
1454// GetWindowRect(taskList[i]->hwnd, &windowRect);
1455
1456 RECT thumbnailRect;
1457 CopyRect(&thumbnailRect, &textRect);
1458 InflateRect(&thumbnailRect, 0, -(padding/2));
1459/*
1460 double windowRatio = (windowRect.right - windowRect.left) / (windowRect.bottom - windowRect.top);
1461 double thumbnailRatio = (thumbnailRect.right - thumbnailRect.left) / (thumbnailRect.bottom - thumbnailRect.top);
1462
1463 if (thumbnailRatio > windowRatio)
1464 {
1465 int thumbnailWidth = (thumbnailRect.right - thumbnailRect.left) / windowRatio;
1466 int thumbnailPadding = ((thumbnailRect.right - thumbnailRect.left) - thumbnailWidth) / 2;
1467 InflateRect(&thumbnailRect, -thumbnailPadding, 0);
1468 }
1469 else if (windowRatio > thumbnailRatio)
1470 {
1471 int thumbnailWidth = (thumbnailRect.right - thumbnailRect.left) / windowRatio;
1472 int thumbnailPadding = ((thumbnailRect.right - thumbnailRect.left) - thumbnailWidth) / 2;
1473 InflateRect(&thumbnailRect, -thumbnailPadding, 0);
1474 }
1475*/
1476 DWM_THUMBNAIL_PROPERTIES dskThumbProps;
1477 dskThumbProps.dwFlags = DWM_TNP_RECTDESTINATION | DWM_TNP_OPACITY | DWM_TNP_VISIBLE | DWM_TNP_SOURCECLIENTAREAONLY;
1478 dskThumbProps.rcDestination = thumbnailRect;
1479 dskThumbProps.opacity = 255;
1480 dskThumbProps.fVisible = TRUE;
1481 dskThumbProps.fSourceClientAreaOnly = FALSE;
1482 DwmUpdateThumbnailProperties(pToolbar->thumbnail, &dskThumbProps);
1483 }
1484 }
1485 }
1486
1487 //====================
1488
1489 if (taskList[i]->hwnd == flashingHwnd) flashingHwnd = 0; // Reset flash indicator...
1490
1491 // Should we create a tooltip for the task button?
1493
1494 drawnTasks++;
1495 }
1496
1497 //====================
1498
1499 // Finally, we draw "scroll for more" indicators at the left/top (-> more items to the left, or above on a vertical toolbar)
1500 // and/or right/bottom (-> more items to the right, or below on a vertical toolbar) respectively if so applicable...
1501
1502 if (taskButtonsOffset > 0)
1503 {
1504 RECT r;
1505 if (pSettings->toolbarVertical) SetRect(&r, TaskbarRect.left, TaskbarRect.top, TaskbarRect.right, TaskbarRect.top + taskbarScrollIndicatorSize);
1506 else SetRect(&r, TaskbarRect.left, TaskbarRect.top, TaskbarRect.left + taskbarScrollIndicatorSize, TaskbarRect.bottom);
1507
1508 COLORREF beginIndicatorColor = GetPixel(hdc, r.left, r.top);
1509 COLORREF endIndicatorColor = GetPixel(hdc, r.right-1, r.bottom-1);
1510
1511 int centerX = r.left + ((r.right - r.left) / 2);
1512 int centerY = r.top + ((r.bottom - r.top) / 2);
1513 COLORREF scrollIndicatorColor = pSettings->MixColors(GetPixel(hdc, centerX, centerY), pSettings->Toolbar->TextColor);
1514
1515 if (pSettings->toolbarVertical) MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1516 else MakeGradientSuper(hdc, r, B_SPLITVERTICAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1517 }
1518
1519 for (int i = (lastButton+1); i < (int)taskList.size(); i++)
1520 {
1521 if (!OnCurrentWorkspace(taskList[i]->hwnd) || taskList[i]->hidden) continue;
1522 else
1523 {
1524 RECT r;
1525 if (pSettings->toolbarVertical) SetRect(&r, TaskbarRect.left, TaskbarRect.bottom - taskbarScrollIndicatorSize, TaskbarRect.right, TaskbarRect.bottom);
1526 else SetRect(&r, TaskbarRect.right - taskbarScrollIndicatorSize, TaskbarRect.top, TaskbarRect.right, TaskbarRect.bottom);
1527
1528 COLORREF beginIndicatorColor = GetPixel(hdc, r.left, r.top);
1529 COLORREF endIndicatorColor = GetPixel(hdc, r.right-1, r.bottom-1);
1530
1531 int centerX = r.left + ((r.right - r.left) / 2);
1532 int centerY = r.top + ((r.bottom - r.top) / 2);
1533 COLORREF scrollIndicatorColor = pSettings->MixColors(GetPixel(hdc, centerX, centerY), pSettings->Toolbar->TextColor);
1534
1535 if (pSettings->toolbarVertical) MakeGradientSuper(hdc, r, B_SPLITHORIZONTAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1536 else MakeGradientSuper(hdc, r, B_SPLITVERTICAL, beginIndicatorColor, scrollIndicatorColor, scrollIndicatorColor, endIndicatorColor, 0, 0, 0, 0, false, BEVEL_FLAT, BEVEL1, 0, 0, 0);
1537
1538 break;
1539 }
1540 }
1541
1542 return 1;
1543}
void MakeGradientSuper(HDC hdc, RECT rect, int type, COLORREF color1, COLORREF color2, COLORREF color3, COLORREF color4, COLORREF color5, COLORREF color6, COLORREF color7, COLORREF color8, bool bInterlaced, int bevelStyle, int bevelPosition, int bevelWidth, COLORREF borderColour, int borderWidth)
Definition BBApi.cpp:2127
void DrawTextWithEffectsUnicode(HDC hdc, RECT r, LPWSTR text, unsigned int format, COLORREF textColor, bool outline, COLORREF outlineColor, bool shadow, COLORREF shadowColor, int shadowX, int shadowY)
Definition BBApi.cpp:3528
void DrawSatHueIcon(HDC hdc, RECT r, HICON icon, int size, int saturation, int hue)
Definition BBApi.cpp:3765
#define BEVEL1
Definition BBApi.h:108
#define BEVEL_FLAT
Definition BBApi.h:105
#define B_SPLITHORIZONTAL
Definition BBApi.h:86
#define B_SPLITVERTICAL
Definition BBApi.h:87
Toolbar * pToolbar
Definition Blackbox.cpp:48
#define TASKBAR_MODE_BARS
Definition Settings.h:43
#define TASKBAR_MODE_BARSICONS
Definition Settings.h:44
#define TASKBAR_MODE_ICONS
Definition Settings.h:45
int scalingFactorHiDPI
Definition Settings.h:327
StyleItem * ActiveTask
Definition Settings.h:448
unsigned int taskbarSaturationValue
Definition Settings.h:221
COLORREF MixColors(COLORREF colorA, COLORREF colorB)
Definition Settings.cpp:2231
bool taskbarInactiveBackground
Definition Settings.h:226
unsigned int taskbarHueIntensity
Definition Settings.h:222
int bevelWidth
Definition Settings.h:564
bool taskbarShowTaskWorkspace
Definition Settings.h:218
StyleItem * FlashingTask
Definition Settings.h:450
bool taskbarActiveLivePreview
Definition Settings.h:225
StyleItem * InactiveTask
Definition Settings.h:449
bool taskbarActiveSatHue
Definition Settings.h:223
RECT iconRect
Definition Taskbar.h:137
RECT ActiveTaskRect
Definition Taskbar.h:129
RECT textRect
Definition Taskbar.h:137
HWND currentTaskButtonWnd
Definition Taskbar.h:132
HICON currentTaskButtonIcon
Definition Taskbar.h:133
RECT currentTaskButton
Definition Taskbar.h:131
int iconSize
Definition Taskbar.h:136
HTHUMBNAIL thumbnail
Definition Toolbar.h:138
HWND hToolbarWnd
Definition Toolbar.h:89
HINSTANCE hToolbarInstance
Definition Toolbar.h:87
void CreateToolTip(unsigned int tipID, RECT tipRect, char tipText[MAX_LINE_LENGTH], int tipType)
Definition Tooltips.cpp:140
void DeleteAllTooltips()
Definition Tooltips.cpp:190
int borderWidth
Definition BBApi.h:417
COLORREF Color5
Definition BBApi.h:436
int bevelstyle
Definition BBApi.h:400
COLORREF Color4
Definition BBApi.h:434
COLORREF Color6
Definition BBApi.h:437
int type
Definition BBApi.h:402
int bevelposition
Definition BBApi.h:401
COLORREF Color7
Definition BBApi.h:438
COLORREF Color8
Definition BBApi.h:439
bool interlaced
Definition BBApi.h:404
COLORREF Color3
Definition BBApi.h:433
COLORREF borderColor
Definition BBApi.h:418
int marginWidth
Definition BBApi.h:416

◆ ChangeTaskbarMode()

void Taskbar::ChangeTaskbarMode ( int mode)
1707{
1708 char setting[MAX_LINE_LENGTH];
1709
1710 if (mode == TASKBAR_MODE_BARS)
1711 {
1713 strcpy(setting, "Bars");
1714 }
1715 else if (mode == TASKBAR_MODE_BARSICONS)
1716 {
1718 strcpy(setting, "Bars+Icons");
1719 }
1720 else if (mode == TASKBAR_MODE_ICONS)
1721 {
1723 strcpy(setting, "Icons");
1724 }
1725 else // TASKBAR_MODE_HIDDEN
1726 {
1728 strcpy(setting, "Hidden");
1729 }
1730
1732
1733 pToolbar->UpdatePosition(); // -> Refreshes the toolbar including the change of modes...
1735
1736 WriteString(pSettings->xobrcFile, "xoblite.taskbar.mode:", setting);
1737}
void WriteString(LPCSTR fp, LPCSTR keyword, LPSTR value)
Definition BBApi.cpp:3156
char xobrcFile[MAX_LINE_LENGTH]
Definition Settings.h:405
void UpdatePosition()
Definition Toolbar.cpp:1941

◆ ToggleCurrentOnly()

void Taskbar::ToggleCurrentOnly ( )
1745{
1747 else pSettings->taskbarCurrentOnly = false;
1748
1749 SendMessage(hBlackboxWnd, BB_TASKSUPDATE, NULL, (LPARAM)TASKITEM_REFRESH);
1750
1751 WriteBool(pSettings->xobrcFile, "xoblite.taskbar.currentOnly:", pSettings->taskbarCurrentOnly);
1752}
void WriteBool(LPCSTR fp, LPCSTR keyword, bool value)
Definition BBApi.cpp:3131

◆ OnCurrentWorkspace()

bool Taskbar::OnCurrentWorkspace ( HWND window)
1760{
1761 if (!pSettings->taskbarCurrentOnly) return true;
1762
1763// int TaskOnWorkspaceNumber = pWorkspaces->GetWorkspaceByWindow(window);
1764// if ((TaskOnWorkspaceNumber == pSettings->currentWorkspace) || (TaskOnWorkspaceNumber == 254) || (TaskOnWorkspaceNumber == 255)) return true;
1765// else return false;
1766
1767 int i = FindTask(window);
1768 if (i >= 0)
1769 {
1770 if ((taskList[i]->workspace == pSettings->currentWorkspace) || (taskList[i]->workspace == 254)) return true;
1771 }
1772
1773 return false;
1774}

◆ GetTaskButtonsToDraw()

int Taskbar::GetTaskButtonsToDraw ( )
1783{
1785
1786 for (int i=0; i < (int)taskList.size(); i++)
1787 {
1788 if (pSettings->taskbarCurrentOnly && !OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1789 if (!taskList[i]->hidden) taskButtonsToDraw++;
1790 }
1791
1793
1794 return taskButtonsToDraw;
1795}
int taskbarMaxItems
Definition Settings.h:216

◆ GetTaskbarScrollIndicatorSizes()

int Taskbar::GetTaskbarScrollIndicatorSizes ( int * leftTopPadding,
int * rightBottomPadding )
1803{
1804 int taskbarScrollIndicatorSize;
1805 if (pSettings->Toolbar->marginWidth > 0) taskbarScrollIndicatorSize = pSettings->Toolbar->marginWidth;
1806 else if (pSettings->Toolbar->borderWidth > 0) taskbarScrollIndicatorSize = pSettings->Toolbar->borderWidth;
1807 taskbarScrollIndicatorSize = 2 * pSettings->scalingFactorHiDPI;
1808
1810 int firstButton = FindFirstVisible();
1811 int lastButton = FindLastVisible(firstButton);
1812 if (lastButton < 0) lastButton = (int)taskList.size()-1; // Failsafe
1813
1814 if (taskButtonsOffset > 0) *leftTopPadding = taskbarScrollIndicatorSize; // -> Left/top taskbar scroll indicator to be drawn!
1815 else *leftTopPadding = 0;
1816
1817 for (int i = (lastButton+1); i < (int)taskList.size(); i++)
1818 {
1819 if (!OnCurrentWorkspace(taskList[i]->hwnd) || taskList[i]->hidden) continue;
1820 else
1821 {
1822 *rightBottomPadding = taskbarScrollIndicatorSize; // -> Right/bottom taskbar scroll indicator to be drawn!
1823 return taskbarScrollIndicatorSize;
1824 }
1825 }
1826
1827 *rightBottomPadding = 0;
1828
1829 return taskbarScrollIndicatorSize;
1830}

◆ CheckCloakedWindow()

bool Taskbar::CheckCloakedWindow ( HWND hwnd)
1838{
1839 // Check for DWM cloaked windows... (e.g. preloading Windows 10 apps like Microsoft Edge etc)
1840 int cloaked = 0;
1841 HRESULT hr = DwmGetWindowAttribute(hwnd, DWMWA_CLOAKED, &cloaked, 4);
1842 if (hr != S_OK) return false;
1843
1844 if (cloaked > 0)
1845 {
1846/*
1847 if (pSettings->debugLogging)
1848 {
1849 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
1850 GetWindowText(hwnd, windowText, sizeof(windowText));
1851 if (cloaked == DWM_CLOAKED_APP) sprintf(msg, "DEBUG -> Taskbar::CheckCloakedWindow -> Cloaked window found! (DWM_CLOAKED_APP) -> %s", windowText);
1852 else if (cloaked == DWM_CLOAKED_SHELL) sprintf(msg, "DEBUG -> Taskbar::CheckCloakedWindow -> Cloaked window found! (DWM_CLOAKED_SHELL) -> %s", windowText);
1853 else if (cloaked == DWM_CLOAKED_INHERITED) sprintf(msg, "DEBUG -> Taskbar::CheckCloakedWindow -> Cloaked window found! (DWM_CLOAKED_INHERITED) -> %s", windowText);
1854 else sprintf(msg, "DEBUG -> Taskbar::CheckCloakedWindow -> Cloaked window found! (unknown DWMWA_CLOAKED value) -> %s", windowText);
1855 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
1856 Log(msg, "");
1857 }
1858*/
1859 return true;
1860 }
1861 else
1862 {
1863/*
1864 if (pSettings->debugLogging)
1865 {
1866 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH];
1867 GetWindowText(hwnd, windowText, sizeof(windowText));
1868 sprintf(msg, "DEBUG -> Taskbar::CheckCloakedWindow -> This window is uncloaked... -> %s", windowText);
1869 SendMessage(GetBBWnd(), BB_CONSOLEMESSAGE, (WPARAM)CONSOLE_INFORMATION_MESSAGE, (LPARAM)msg);
1870 Log(msg, "");
1871 }
1872*/
1873 return false;
1874 }
1875}

◆ FindFirstVisible()

int Taskbar::FindFirstVisible ( )
1551{
1552 int visibleItemsFound = 0;
1553
1554 for (int i = 0; i < (int)taskList.size(); i++)
1555 {
1556 if (!OnCurrentWorkspace(taskList[i]->hwnd) || taskList[i]->hidden) continue;
1557 else
1558 {
1559 if (visibleItemsFound == taskButtonsOffset) return i; // -> Requested offset found!
1560 visibleItemsFound++;
1561 }
1562 }
1563
1564 return 0; // -> Failsafe (requested offset not found)
1565}

◆ FindLastVisible()

int Taskbar::FindLastVisible ( int offset)
1568{
1569 int visibleItemsFound = 0;
1570
1571 for (int i = offset; i < (int)taskList.size(); i++)
1572 {
1573 if (!OnCurrentWorkspace(taskList[i]->hwnd) || taskList[i]->hidden) continue;
1574 else
1575 {
1576 visibleItemsFound++;
1577 if (visibleItemsFound == pSettings->taskbarMaxItems) return i;
1578 }
1579 }
1580
1581 return -1; // -> Fewer than the maximum number of simultaneously visible items left in the taskbar list...
1582}

◆ NextTask()

void Taskbar::NextTask ( bool currentWorkspaceOnly,
bool visibleOnly )
1590{
1591 if ((int)taskList.size() == 0) return;
1592
1593 HWND nextWindow = NULL;
1594 bool isAppPlugin = false;
1595
1596 int offset = GetActiveTask();
1597 if (offset == NULL) offset = 0;
1598 else
1599 {
1600 offset++;
1601 if (offset >= (int)taskList.size()) offset = 0;
1602 }
1603
1604 for (int i = offset; i < (int)taskList.size(); i++)
1605 {
1606 if (taskList[i]->active || taskList[i]->hidden) continue;
1607 else if (visibleOnly && IsIconic(taskList[i]->hwnd)) continue;
1608 else if (currentWorkspaceOnly && !OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1609 else
1610 {
1611 nextWindow = taskList[i]->hwnd;
1612 if (taskList[i]->isAppPlugin) isAppPlugin = true;
1613 break;
1614 }
1615 }
1616
1617 if ((offset > 0) && (nextWindow == NULL))
1618 {
1619 for (int i = 0; i < offset; i++)
1620 {
1621 if (taskList[i]->active || taskList[i]->hidden) continue;
1622 else if (visibleOnly && IsIconic(taskList[i]->hwnd)) continue;
1623 else if (currentWorkspaceOnly && !OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1624 else
1625 {
1626 nextWindow = taskList[i]->hwnd;
1627 if (taskList[i]->isAppPlugin) isAppPlugin = true;
1628 break;
1629 }
1630 }
1631 }
1632
1633 if (nextWindow != NULL)
1634 {
1635 SetForegroundWindow(pToolbar->hToolbarWnd);
1636 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)nextWindow);
1637 SetActiveTask(nextWindow);
1638 if (isAppPlugin) SendMessage(nextWindow, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
1639 else if (IsIconic(nextWindow)) ShowWindow(nextWindow, SW_RESTORE);
1640 SetForegroundWindow(nextWindow);
1641 SetWindowPos(nextWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
1643 }
1644}
int GetActiveTask()
Definition Taskbar.cpp:402
void SetActiveTask(HWND activeWindow)
Definition Taskbar.cpp:293

◆ PreviousTask()

void Taskbar::PreviousTask ( bool currentWorkspaceOnly,
bool visibleOnly )
1649{
1650 if ((int)taskList.size() == 0) return;
1651
1652 HWND previousWindow = NULL;
1653 bool isAppPlugin = false;
1654
1655 int offset = GetActiveTask();
1656 if (offset == NULL) offset = 0;
1657 else if (offset > 0) offset--;
1658
1659 for (int i = offset; i >= 0; i--)
1660 {
1661 if (taskList[i]->active || taskList[i]->hidden) continue;
1662 else if (visibleOnly && IsIconic(taskList[i]->hwnd)) continue;
1663 else if (currentWorkspaceOnly && !OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1664 else
1665 {
1666 previousWindow = taskList[i]->hwnd;
1667 if (taskList[i]->isAppPlugin) isAppPlugin = true;
1668 break;
1669 }
1670 }
1671
1672 if (previousWindow == NULL)
1673 {
1674 for (int i = ((int)taskList.size()-1); i > offset; i--)
1675 {
1676 if (taskList[i]->active || taskList[i]->hidden) continue;
1677 else if (visibleOnly && IsIconic(taskList[i]->hwnd)) continue;
1678 else if (currentWorkspaceOnly && !OnCurrentWorkspace(taskList[i]->hwnd)) continue;
1679 else
1680 {
1681 previousWindow = taskList[i]->hwnd;
1682 if (taskList[i]->isAppPlugin) isAppPlugin = true;
1683 break;
1684 }
1685 }
1686 }
1687
1688 if (previousWindow != NULL)
1689 {
1690 SetForegroundWindow(pToolbar->hToolbarWnd);
1691 SendMessage(hBlackboxWnd, BB_BRINGTOFRONT, 0, (LPARAM)previousWindow);
1692 SetActiveTask(previousWindow);
1693 if (isAppPlugin) SendMessage(previousWindow, BB_BROADCAST, 0, (LPARAM)"@AppPlugin Show");
1694 else if (IsIconic(previousWindow)) ShowWindow(previousWindow, SW_RESTORE);
1695 SetForegroundWindow(previousWindow);
1696 SetWindowPos(previousWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
1698 }
1699}

◆ SortTaskbarItems()

void Taskbar::SortTaskbarItems ( int mode)
1883{
1885// else if (mode == TASKBAR_SORT_BY_NAME) sort(taskList.begin(), taskList.end(), Taskbar::CompareTaskbarItemsByName);
1886}
static bool CompareTaskbarItemsByLastUsed(taskListItem *t1, taskListItem *t2)
Definition Taskbar.cpp:1888

◆ CompareTaskbarItemsByLastUsed()

bool Taskbar::CompareTaskbarItemsByLastUsed ( taskListItem * t1,
taskListItem * t2 )
static
1889{
1890 return t1->lastUsed < t2->lastUsed;
1891}

◆ TileWindow()

void Taskbar::TileWindow ( int placement)
1904{
1905 // Find the currently active task...
1906 int i = GetActiveTask();
1907 if (i == -1) return;
1908 if (taskList[i]->dimensions.placement == placement) return;
1909
1910 HWND currentWnd = taskList[i]->hwnd;
1911
1912 RECT workArea;
1913 SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&workArea, SPIF_SENDCHANGE);
1914 int screenWidth = (workArea.right - workArea.left);
1915 int screenHeight = (workArea.bottom - workArea.top);
1916 int halfScreenWidth = screenWidth / 2;
1917 int halfScreenHeight = screenHeight / 2;
1918 int quarterScreenWidth = screenWidth / 4;
1919 int quarterScreenHeight = screenHeight / 4;
1920 int thirdScreenWidth = screenWidth / 3;
1921
1922 if (taskList[i]->dimensions.placement == PLACEMENT_DEFAULT)
1923 {
1924 // Save the position and dimensions of a non-tiled window before tiling it,
1925 // so we can go back to this non-tiled state later on...
1926 if (IsZoomed(currentWnd))
1927 {
1928 taskList[i]->dimensions.centeredx = taskList[i]->dimensions.centeredy = true; // For now we re-use these placement bools to save the maximized/restored state of the window
1929 ShowWindow(currentWnd, SW_RESTORE);
1930 }
1931 else taskList[i]->dimensions.centeredx = taskList[i]->dimensions.centeredy = false;
1932
1933 RECT r;
1934 GetWindowRect(currentWnd, &r);
1935 taskList[i]->dimensions.x = r.left;
1936 taskList[i]->dimensions.y = r.top;
1937 taskList[i]->dimensions.width = r.right - r.left;
1938 taskList[i]->dimensions.height = r.bottom - r.top;
1939 }
1940
1941 taskList[i]->dimensions.placement = placement; // Save the new window placement
1942
1943 switch (placement)
1944 {
1945 // ###################################
1946 // ##### Default non-tiled state #####
1947 // ###################################
1948
1949 case PLACEMENT_DEFAULT:
1950 {
1951 MoveWindow(currentWnd, taskList[i]->dimensions.x, taskList[i]->dimensions.y, taskList[i]->dimensions.width, taskList[i]->dimensions.height, true);
1952 if (taskList[i]->dimensions.centeredx && taskList[i]->dimensions.centeredy) ShowWindow(currentWnd, SW_MAXIMIZE);
1953 break;
1954 }
1955
1956 // #######################################
1957 // ##### Centered at 2/3 screen size #####
1958 // #######################################
1959
1960 case PLACEMENT_CENTERED:
1961 {
1962 MoveWindow(currentWnd, workArea.left + (quarterScreenWidth / 2), workArea.top + (quarterScreenHeight / 2), (halfScreenWidth + quarterScreenWidth), (halfScreenHeight + quarterScreenHeight), true);
1963 break;
1964 }
1965
1966 // ###########################################
1967 // ##### Half screen size tiling options #####
1968 // ###########################################
1969
1971 {
1972 MoveWindow(currentWnd, workArea.left, workArea.top, halfScreenWidth, screenHeight, true);
1973 break;
1974 }
1975
1977 {
1978 MoveWindow(currentWnd, workArea.left + halfScreenWidth, workArea.top, halfScreenWidth, screenHeight, true);
1979 break;
1980 }
1981
1982 case PLACEMENT_TOP_HALF:
1983 {
1984 MoveWindow(currentWnd, workArea.left, workArea.top, screenWidth, halfScreenHeight, true);
1985 break;
1986 }
1987
1989 {
1990 MoveWindow(currentWnd, workArea.left, workArea.top + halfScreenHeight, screenWidth, halfScreenHeight, true);
1991 break;
1992 }
1993
1994 // ################################################
1995 // ##### One third screen size tiling options #####
1996 // ################################################
1997
1999 {
2000 MoveWindow(currentWnd, workArea.left, workArea.top, thirdScreenWidth, screenHeight, true);
2001 break;
2002 }
2003
2005 {
2006 MoveWindow(currentWnd, workArea.left + thirdScreenWidth, workArea.top, thirdScreenWidth, screenHeight, true);
2007 break;
2008 }
2009
2011 {
2012 MoveWindow(currentWnd, workArea.right - thirdScreenWidth, workArea.top, thirdScreenWidth, screenHeight, true);
2013 break;
2014 }
2015
2016 // ##################################################
2017 // ##### One quarter screen size tiling options #####
2018 // ##################################################
2019
2020 case PLACEMENT_TOP_LEFT:
2021 {
2022 MoveWindow(currentWnd, workArea.left, workArea.top, halfScreenWidth, halfScreenHeight, true);
2023 break;
2024 }
2025
2027 {
2028 MoveWindow(currentWnd, workArea.left, workArea.bottom - halfScreenHeight, halfScreenWidth, halfScreenHeight, true);
2029 break;
2030 }
2031
2033 {
2034 MoveWindow(currentWnd, workArea.left + halfScreenWidth, workArea.top, halfScreenWidth, halfScreenHeight, true);
2035 break;
2036 }
2037
2039 {
2040 MoveWindow(currentWnd, workArea.left + halfScreenWidth, workArea.top + halfScreenHeight, halfScreenWidth, halfScreenHeight, true);
2041 break;
2042 }
2043
2044 // ##################################################
2045 // ##### One sixth screen size tiling options #####
2046 // ##### (i.e. matches one third options above) #####
2047 // ##################################################
2048
2050 {
2051 MoveWindow(currentWnd, workArea.left + thirdScreenWidth, workArea.top, thirdScreenWidth, halfScreenHeight, true);
2052 break;
2053 }
2054
2056 {
2057 MoveWindow(currentWnd, workArea.left + thirdScreenWidth, workArea.top + halfScreenHeight, thirdScreenWidth, halfScreenHeight, true);
2058 break;
2059 }
2060
2061 default: { break; }
2062 }
2063
2064 InvalidateRect(currentWnd, NULL, false);
2065 SetForegroundWindow(currentWnd);
2067}
#define PLACEMENT_CENTER_LEFT
Definition Settings.h:71
#define PLACEMENT_LEFT_HALF
Definition Settings.h:80
#define PLACEMENT_TOP_CENTER
Definition Settings.h:69
#define PLACEMENT_CENTERED
Definition Settings.h:84
#define PLACEMENT_TOP_HALF
Definition Settings.h:82
#define PLACEMENT_BOTTOM_CENTER
Definition Settings.h:75
#define PLACEMENT_BOTTOM_LEFT
Definition Settings.h:74
#define PLACEMENT_BOTTOM_HALF
Definition Settings.h:83
#define PLACEMENT_TOP_LEFT
Definition Settings.h:68
#define PLACEMENT_CENTER_CENTER
Definition Settings.h:72
#define PLACEMENT_TOP_RIGHT
Definition Settings.h:70
#define PLACEMENT_BOTTOM_RIGHT
Definition Settings.h:76
#define PLACEMENT_CENTER_RIGHT
Definition Settings.h:73
#define PLACEMENT_RIGHT_HALF
Definition Settings.h:81

Friends And Related Symbol Documentation

◆ TaskEnumerator

BOOL CALLBACK TaskEnumerator ( HWND window,
LPARAM main )
friend
94{
95/*
96 if (pSettings->debugLogging)
97 {
98 char msg[MAX_LINE_LENGTH], windowText[MAX_LINE_LENGTH], windowClass[MAX_LINE_LENGTH];
99 GetWindowText(window, windowText, sizeof(windowText));
100 if (!strlen(windowText)) strcpy(windowText, "NULL");
101 GetClassName(window, windowClass, sizeof(windowClass));
102 if (!strlen(windowClass)) strcpy(windowClass, "NULL");
103 sprintf(msg, "DEBUG -> Taskbar::TaskEnumerator -> %s | %s", windowText, windowClass);
104 Log(msg, "");
105 }
106*/
107 pTaskbar->AddTask(window);
108
109 return 1;
110}

Member Data Documentation

◆ hBlackboxWnd

HWND Taskbar::hBlackboxWnd

◆ cachedTaskButtonActive

HDC Taskbar::cachedTaskButtonActive

◆ cachedTaskButtonInactive

HDC Taskbar::cachedTaskButtonInactive

◆ cachedTaskButtonsExist

bool Taskbar::cachedTaskButtonsExist

◆ TaskbarRect

RECT Taskbar::TaskbarRect

◆ activeTaskAvailable

bool Taskbar::activeTaskAvailable

◆ ActiveTaskRect

RECT Taskbar::ActiveTaskRect

◆ currentTaskButton

RECT Taskbar::currentTaskButton

◆ currentTaskButtonWnd

HWND Taskbar::currentTaskButtonWnd

◆ currentTaskButtonIcon

HICON Taskbar::currentTaskButtonIcon

◆ iconSize

int Taskbar::iconSize

◆ iconRect

RECT Taskbar::iconRect

◆ textRect

RECT Taskbar::textRect

◆ taskButtonWidth

int Taskbar::taskButtonWidth

◆ taskButtonWidthMinusPadding

int Taskbar::taskButtonWidthMinusPadding

◆ taskButtonHeight

int Taskbar::taskButtonHeight

◆ taskButtonHeightMinusPadding

int Taskbar::taskButtonHeightMinusPadding

◆ taskButtonsToDraw

int Taskbar::taskButtonsToDraw

◆ taskButtonsOffset

int Taskbar::taskButtonsOffset

◆ flashingHwnd

HWND Taskbar::flashingHwnd

◆ taskList

vector<taskListItem*> Taskbar::taskList

◆ enumeratingTasks

bool Taskbar::enumeratingTasks

◆ blockNextMouseClick

bool Taskbar::blockNextMouseClick