198{
199 switch (message)
200 {
201
202
204 {
206 {
207
208
210 {
211 if (!
pToolbar->throttlingAddRemoveUpdates)
212 {
213
214
216 pToolbar->throttlingAddRemoveUpdates =
true;
218
219 pTaskbar->cachedTaskButtonsExist =
false;
221
222
223
224
225
226
227
228
229 }
230 else pToolbar->updatesThrottled =
true;
231 }
232
233
234
236 {
237 if (wParam != NULL)
238 {
239 int i =
pTaskbar->FindTask((HWND)wParam);
241
242
243
244
245
246
247
248 }
249 }
250
251
252
254 {
255 if (
pTaskbar->FindTask((HWND)wParam) >= 0)
256 {
257 if (!
pToolbar->throttlingActivityUpdates || !
pToolbar->throttlingAddRemoveUpdates)
258 {
259
260
261 pToolbar->throttlingActivityUpdates =
true;
264 }
265 else pToolbar->updatesThrottled =
true;
266
267
268 }
269 else
270 {
271
273 }
274 }
275 }
276 }
277 break;
278
279
280
282 {
284 }
285 break;
286
288 {
290 }
291 break;
292
294 {
295 pTaskbar->SetActiveTask((HWND)wParam);
296 }
297 break;
298
300 {
302 }
303 break;
304
306 {
308 }
309 break;
310
311
312
313 case WM_TIMER:
314 {
316 {
318
320 {
321 if (
pToolbar->throttlingAddRemoveUpdates)
322 {
323 pTaskbar->cachedTaskButtonsExist =
false;
325
326
327 }
328 else
329 {
331
332
333 }
334 }
335
337
338 return 0;
339 }
340
341
342
344 {
347 {
349 pToolbar->saveWidthAfterDelay =
false;
350 }
351 return 0;
352 }
353
354
355
356 else
357 {
358 bool updateToolbar = false;
359
360
362 else
363 {
364 if (
pToolbar->GetClockText(
false)) updateToolbar =
true;
366 }
367
368
370 {
372 if (i >= 0)
373 {
375 {
376 if (wcslen(
pToolbar->CurrentWindow) > 0)
377 {
379 updateToolbar = true;
380 }
381 }
382 else if (_wcsicmp(
pToolbar->CurrentWindow,
pTaskbar->taskList[i]->captionUnicode))
383 {
385 updateToolbar = true;
386 }
387
388
389 }
390 }
391
392
393
394
395
396 if (updateToolbar)
pToolbar->UpdateToolbarWindow();
397
398 return 0;
399 }
400 }
401 break;
402
403
404
405 case WM_DROPFILES:
406 {
408 }
409 break;
410
411
412
414 {
415 SetRectEmpty(&
pToolbar->currentWindowLabelRect);
417
419 {
420
421
422
423
424
425 }
426 }
427 break;
428
429
430
432 {
435
437 ShowWindow(
pToolbar->hToolbarWnd,
pSettings->toolbarHidden ? SW_HIDE : SW_SHOWNOACTIVATE);
438
440
442
444 }
445 break;
446
447
448
450 {
451 pToolbar->ToolbarModeButtonPressed(
true);
452 }
453 break;
454
455
456
457 case WM_CLOSE:
458 return 0;
459
460
461
462 case WM_DISPLAYCHANGE:
463 {
466 }
467 break;
468
469 case WM_SETTINGCHANGE:
470 {
471
472
474 if (wParam == SPI_SETWORKAREA)
pToolbar->UpdatePosition();
475 return 0;
476 }
477
478
479
480
481
482
483
484
485
486
487
488
489 case WM_EXITSIZEMOVE:
490 {
492 {
493 pToolbar->ToolbarPosInProgress =
false;
494
495 RECT r;
496 GetWindowRect(
pToolbar->hToolbarWnd, &r);
500
501
503
505 pToolbar->saveWidthAfterDelay =
true;
507 }
508
509 return 0;
510 }
511
512
513
514
515
516
517 case WM_NCHITTEST:
518 {
519 if ((GetAsyncKeyState(VK_CONTROL) & 0x8000))
520 {
521 POINT pt;
524 ScreenToClient(hwnd, &pt);
525
527 else
528 {
529 pToolbar->ToolbarPosInProgress =
true;
530 return HTCAPTION;
531 }
532 }
533 else return HTCLIENT;
534 }
535 break;
536
537
538
539 case WM_LBUTTONDBLCLK:
540 {
541 if (GetAsyncKeyState(VK_MENU) & 0x8000)
542 {
544 {
545 if (
pToolbar->toolbarVerticalPeeking)
pToolbar->toolbarVerticalPeeking =
false;
546 else pToolbar->toolbarVerticalPeeking =
true;
548 }
549 }
550 else
551 {
552 POINT pt = {LOWORD(lParam), HIWORD(lParam)};
553
555
556 else if (!
pSettings->toolbarClockHidden && PtInRect(&
pToolbar->clockRect, pt))
BBExecute(GetDesktopWindow(), NULL,
"control.exe",
"timedate.cpl", NULL, SW_SHOWNORMAL,
false);
557 }
558 }
559 break;
560
561
562
563 case WM_LBUTTONDOWN:
564 case WM_LBUTTONUP:
565 case WM_RBUTTONDOWN:
566 case WM_RBUTTONUP:
567 case WM_MBUTTONDOWN:
568 case WM_MBUTTONUP:
569 case WM_XBUTTONDOWN:
570 case WM_XBUTTONUP:
571 {
573 {
574 if (
pTaskbar->MouseButtonOnTaskbar(hwnd, message, wParam, lParam))
575 {
576 return DefWindowProc(hwnd, message, wParam, lParam);
577 }
578 }
579
580
581
582 if (message == WM_LBUTTONDOWN)
583 {
584 TRACKMOUSEEVENT track;
585 ZeroMemory(&track,sizeof(track));
586 track.cbSize = sizeof(track);
587 track.dwFlags = TME_LEAVE;
588 track.dwHoverTime = HOVER_DEFAULT;
589 track.hwndTrack =
pToolbar->hToolbarWnd;
590 _TrackMouseEvent(&track);
591
592 POINT pt = {LOWORD(lParam), HIWORD(lParam)};
593
595 {
596 if (PtInRect(&
pToolbar->button1Rect, pt))
597 {
599
601 }
602 else if (PtInRect(&
pToolbar->button2Rect, pt))
603 {
605
607 }
608 }
609
610 if (!
pSettings->toolbarLeftRightButtonsHidden)
611 {
612 if (PtInRect(&
pToolbar->button3Rect, pt))
613 {
615
617 }
618 else if (PtInRect(&
pToolbar->button4Rect, pt))
619 {
621
623 }
624 }
625
627 }
628
629
630
631 else if (message == WM_LBUTTONUP)
632 {
634 {
635 if ((strlen(
pSettings->toolbarDownButtonOverride) > 0) && !(GetAsyncKeyState(VK_MENU) & 0x8000))
636 {
638 }
640 }
642 {
643 if ((strlen(
pSettings->toolbarUpButtonOverride) > 0) && !(GetAsyncKeyState(VK_MENU) & 0x8000))
644 {
646 }
648 }
650 {
651 if ((strlen(
pSettings->toolbarLeftButtonOverride) > 0) && !(GetAsyncKeyState(VK_MENU) & 0x8000))
652 {
654 }
655 else pToolbar->ToolbarModeButtonPressed(
false);
656 }
658 {
659 if ((strlen(
pSettings->toolbarRightButtonOverride) > 0) && !(GetAsyncKeyState(VK_MENU) & 0x8000))
660 {
662 }
663 else pToolbar->ToolbarModeButtonPressed(
true);
664 }
665
668 }
669
670
671
672 else if (message == WM_RBUTTONUP)
673 {
674 if (GetAsyncKeyState(VK_MENU) & 0x8000) SendMessage(
GetBBWnd(),
BB_MENU, 0, 0);
675 else
676 {
677 POINT pt = {LOWORD(lParam), HIWORD(lParam)};
678
679
680
683 }
684 }
685
686
687
688 else if (message == WM_MBUTTONUP)
689 {
692 else
693 {
694 POINT pt = {LOWORD(lParam), HIWORD(lParam)};
696 }
697 }
698
699
700
701 else if (message == WM_XBUTTONDOWN)
702 {
703 if (HIWORD(wParam) == XBUTTON1)
704 {
705 if (GetAsyncKeyState(VK_MENU) & 0x8000)
706 {
708 {
709 if (
pToolbar->toolbarVerticalPeeking)
pToolbar->toolbarVerticalPeeking =
false;
710 else pToolbar->toolbarVerticalPeeking =
true;
713 }
714 }
715
716 else
717 {
718
721
724
726 }
727 }
728 else if (HIWORD(wParam) == XBUTTON2)
729 {
731 {
732
733 if (
pToolbar->toolbarVerticalPeeking)
pToolbar->toolbarVerticalPeeking =
false;
734 else pToolbar->toolbarVerticalPeeking =
true;
735 }
736 else
737 {
738
740 pToolbar->toolbarVerticalPeeking =
true;
741
742 }
743
746 }
747 }
748 }
749 break;
750
751
752
753 case WM_MOUSEWHEEL:
754 case WM_MOUSEHWHEEL:
755 {
756
757 if ((message == WM_MOUSEWHEEL) && (GetAsyncKeyState(VK_CONTROL) & 0x8000))
758 {
759
760 if (
pSettings->toolbarHorizontalWidth > 100)
break;
761
763
764 bool sizechanged = false;
765
766 if (GET_WHEEL_DELTA_WPARAM(wParam) < 0)
767 {
768 if (
pSettings->toolbarHorizontalWidth > 30)
769 {
771 sizechanged = true;
772 }
773 }
774 else
775 {
776 if (
pSettings->toolbarHorizontalWidth < 100)
777 {
779 sizechanged = true;
780 }
781 }
782
783 if (sizechanged)
784 {
787
788
789 pToolbar->cachedBitmapsExist =
false;
792
793 if (
pSettings->toolbarOnTop) SetWindowPos(
pToolbar->hToolbarWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
794 else SetWindowPos(
pToolbar->hToolbarWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
795
796
797
799 pToolbar->saveWidthAfterDelay =
true;
801 }
802 }
803
804
805
806
807
809 {
810 if (((message == WM_MOUSEWHEEL) && (GET_WHEEL_DELTA_WPARAM(wParam) < 0)) || ((message == WM_MOUSEHWHEEL) && (GET_WHEEL_DELTA_WPARAM(wParam) > 0)))
811 {
813 int firstButton =
pTaskbar->FindFirstVisible();
814 if (
pTaskbar->FindLastVisible(firstButton) < 0)
pTaskbar->taskButtonsOffset--;
815 else pToolbar->UpdateToolbarWindow();
816 }
817 else if (
pTaskbar->taskButtonsOffset > 0)
818 {
821 }
822 }
823 }
824 break;
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844 case WM_MOUSELEAVE:
845 case WM_NCMOUSELEAVE:
846 {
849 }
850 break;
851
852
853
854
855 case WM_WINDOWPOSCHANGING:
856 {
857
859 {
861 {
863 }
864 }
865 }
866 return 0;
867
868
869
870 default:
871 return DefWindowProc(hwnd,message,wParam,lParam);
872
873
874 }
875 return 0;
876}
void WriteBool(LPCSTR fp, LPCSTR keyword, bool value)
Definition BBApi.cpp:3131
void WriteInt(LPCSTR fp, LPCSTR keyword, int value)
Definition BBApi.cpp:3144
Desktop * pDesktop
Definition Blackbox.cpp:37
Taskbar * pTaskbar
Definition Blackbox.cpp:47
void BBSmartExecute(LPSTR inputString)
Definition BBApi.cpp:1767
MenuCommon * pMenuCommon
Definition Blackbox.cpp:41
void SnapWindowToEdge(WINDOWPOS *pwPos, int nDist, bool bUseScreenSize)
Definition BBApi.cpp:1970
HINSTANCE BBExecute(HWND Owner, LPCSTR szOperation, LPCSTR szCommand, LPCSTR szArgs, LPCSTR szDirectory, int nShowCmd, bool noErrorMsgs)
Definition BBApi.cpp:1648
Settings * pSettings
Definition Blackbox.cpp:46
HWND GetBBWnd()
Definition BBApi.cpp:128
#define BB_ACTIVETASK
Definition BBApi.h:198
#define TASKITEM_ACTIVATED
Definition BBApi.h:288
#define BB_TOGGLEPLUGINS
Definition BBApi.h:167
#define TASKITEM_MODIFIED
Definition BBApi.h:287
#define TASKITEM_ADDED
Definition BBApi.h:286
#define BB_MENU
Definition BBApi.h:160
#define BB_RECONFIGURE
Definition BBApi.h:147
#define BB_ADDTASK
Definition BBApi.h:195
#define BB_REDRAW
Definition BBApi.h:200
#define TASKITEM_FLASHED
Definition BBApi.h:291
#define BB_WORKSPACE
Definition BBApi.h:183
#define TASKITEM_REFRESH
Definition BBApi.h:290
#define TASKITEM_REMOVED
Definition BBApi.h:289
#define BB_TOGGLESYSTEMBAR
Definition BBApi.h:163
#define BB_ACTIVATESHELLWINDOW
Definition BBApi.h:197
#define BB_REMOVETASK
Definition BBApi.h:196
#define BB_TOGGLEDOCK
Definition BBApi.h:170
#define BB_TASKSUPDATE
Definition BBApi.h:187
#define BB_TOGGLETOOLBAR
Definition BBApi.h:171
Toolbar * pToolbar
Definition Blackbox.cpp:48
#define PLACEMENT_MANUAL
Definition Settings.h:67
#define TASKBAR_MODE_HIDDEN
Definition Settings.h:42
void PlaySoundFX(int sound)
Definition Sounds.cpp:40
@ SFX_TOGGLE_ELEMENT
Definition Sounds.h:48