ReactOS 0.4.17-dev-804-g023d8af
syspager.cpp
Go to the documentation of this file.
1/*
2 * ReactOS Explorer
3 *
4 * Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
5 * Copyright 2018 Ged Murphy <gedmurphy@reactos.org>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "precomp.h"
23
24#define BALLOON_MAXWIDTH 340
25
27{
28 void SaveVersion(UINT Version) // uVersion is unioned with uTimeout but cbSize is free so we store it there
29 {
30 cbSize = HIWORD(cbSize) | (HIWORD(Version) ? 0xffff : Version);
31 }
32 UINT GetVersion() const { return LOWORD(cbSize); }
33 BOOL IsRemoved() const { return HIWORD(cbSize); }
34 void MarkAsRemoved() { cbSize |= 0x80000000; }
35};
36
38{
42
45 {
47 IconData.hWnd = iconData->hWnd;
48 IconData.uID = iconData->uID;
49 IconData.guidItem = iconData->guidItem;
50 }
51
53 {
54 if (hProcess)
55 {
57 }
58 }
59};
60
62{
68 bool m_Loop;
69
70public:
72
73 virtual ~CIconWatcher();
74
76 void Uninitialize();
77
80
82
83private:
84
85 static UINT WINAPI WatcherThread(_In_opt_ LPVOID lpParam);
86};
87
88class CNotifyToolbar;
89
91{
92public:
93 static const int TimerInterval = 2000;
94 static const int BalloonsTimerId = 1;
95 static const int MinTimeout = 10000;
96 static const int MaxTimeout = 30000;
97 static const int CooldownBetweenBalloons = 2000;
98
99private:
100 struct Info
101 {
107
109 {
110 pSource = source;
113 uIcon = source->dwInfoFlags & NIIF_ICON_MASK;
114 if (source->dwInfoFlags == NIIF_USER)
115 uIcon = reinterpret_cast<WPARAM>(source->hIcon);
116 uTimeout = source->uTimeout;
117 }
118 };
119
121
123
125
127
129
131
132public:
134
135 void Init(HWND hwndParent, CNotifyToolbar * toolbar, CTooltips * balloons);
136 void Deinit();
137
138 bool OnTimer(int timerId);
139 void UpdateInfo(InternalIconData * notifyItem);
140 void RemoveInfo(InternalIconData * notifyItem);
141 void CloseCurrent();
142
143private:
144
146 void SetTimer(int length);
147 void Show(Info& info);
148 void Close(IN OUT InternalIconData * notifyItem, IN UINT uReason);
149};
150
152 public CWindowImplBaseT< CToolbar<InternalIconData>, CControlWinTraits >
153{
156
158
159public:
161 virtual ~CNotifyToolbar();
162
172 bool SendNotifyCallback(InternalIconData* notifyItem, UINT uMsg);
173 void RefreshToolbarMetrics(BOOL bForceRefresh);
174
175private:
176 LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
177 LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
180 LRESULT OnTooltipShow(INT uCode, LPNMHDR hdr, BOOL& bHandled);
181
182public:
189
191};
192
193
194static const WCHAR szSysPagerWndClass[] = L"SysPager";
195
200 public IOleWindow,
201 public CIconWatcher
202{
206
207public:
208 CSysPagerWnd();
209 virtual ~CSysPagerWnd();
210
211 HWND GetTrayNotifyWindow() const { return GetParent(); }
212 HWND GetTaskbarWindow() const { return ::GetParent(GetTrayNotifyWindow()); }
213
215 LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
216 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
217 LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
218 LRESULT OnGetInfoTip(INT uCode, LPNMHDR hdr, BOOL& bHandled);
219 LRESULT OnCustomDraw(INT uCode, LPNMHDR hdr, BOOL& bHandled);
220 LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
221 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
222 LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
223 LRESULT OnBalloonPop(UINT uCode, LPNMHDR hdr, BOOL& bHandled);
224 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
226 LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
227 LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
228
229public:
230 // *** IOleWindow methods ***
231
233 GetWindow(HWND* phwnd) override
234 {
235 if (!phwnd)
236 return E_INVALIDARG;
237 *phwnd = m_hWnd;
238 return S_OK;
239 }
240
242 ContextSensitiveHelp(BOOL fEnterMode) override
243 {
244 return E_NOTIMPL;
245 }
246
248
253
254 BOOL NotifyIcon(DWORD dwMessage, _In_ CONST NOTIFYICONDATA *iconData);
255 void GetSize(IN BOOL IsHorizontal, IN PSIZE size);
256
258
262 MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
268 MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChanged)
269 MESSAGE_HANDLER(TNWM_GETMINIMUMSIZE, OnGetMinimumSize)
270 NOTIFY_CODE_HANDLER(TTN_POP, OnBalloonPop)
274
276};
277
278/*
279 * IconWatcher
280 */
281
283 m_hWatcherThread(NULL),
284 m_WakeUpEvent(NULL),
285 m_hwndSysTray(NULL),
286 m_Loop(false)
287{
288}
289
291{
292 Uninitialize();
293 DeleteCriticalSection(&m_ListLock);
294
295 if (m_WakeUpEvent)
296 CloseHandle(m_WakeUpEvent);
297 if (m_hWatcherThread)
298 CloseHandle(m_hWatcherThread);
299}
300
302{
303 m_hwndSysTray = hWndParent;
304
305 InitializeCriticalSection(&m_ListLock);
306 m_WakeUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
307 if (m_WakeUpEvent == NULL)
308 return false;
309
310 m_hWatcherThread = (HANDLE)_beginthreadex(NULL,
311 0,
312 WatcherThread,
313 (LPVOID)this,
314 0,
315 NULL);
316 if (m_hWatcherThread == NULL)
317 return false;
318
319 return true;
320}
321
323{
324 m_Loop = false;
325 if (m_WakeUpEvent)
326 SetEvent(m_WakeUpEvent);
327
328 EnterCriticalSection(&m_ListLock);
329
331 for (size_t i = 0; i < m_WatcherList.GetCount(); i++)
332 {
333 Pos = m_WatcherList.FindIndex(i);
334 if (Pos)
335 {
336 IconWatcherData *Icon;
337 Icon = m_WatcherList.GetAt(Pos);
338 delete Icon;
339 }
340 }
341 m_WatcherList.RemoveAll();
342
343 LeaveCriticalSection(&m_ListLock);
344}
345
347{
349 (void)GetWindowThreadProcessId(iconData->hWnd, &ProcessId);
350
353 if (hProcess == NULL)
354 {
355 return false;
356 }
357
358 IconWatcherData *Icon = new IconWatcherData(iconData);
359 Icon->hProcess = hProcess;
360 Icon->ProcessId = ProcessId;
361
362 bool Added = false;
363 EnterCriticalSection(&m_ListLock);
364
365 // The likelyhood of someone having more than 64 icons in their tray is
366 // pretty slim. We could spin up a new thread for each multiple of 64, but
367 // it's not worth the effort, so we just won't bother watching those icons
368 if (m_WatcherList.GetCount() < MAXIMUM_WAIT_OBJECTS)
369 {
370 m_WatcherList.AddTail(Icon);
371 SetEvent(m_WakeUpEvent);
372 Added = true;
373 }
374
375 LeaveCriticalSection(&m_ListLock);
376
377 if (!Added)
378 {
379 delete Icon;
380 }
381
382 return Added;
383}
384
386{
387 EnterCriticalSection(&m_ListLock);
388
389 IconWatcherData *Icon;
390 Icon = GetListEntry(iconData, NULL, true);
391
392 SetEvent(m_WakeUpEvent);
393 LeaveCriticalSection(&m_ListLock);
394
395 delete Icon;
396 return true;
397}
398
400{
402 for (POSITION NextPosition = m_WatcherList.GetHeadPosition(); NextPosition;)
403 {
404 POSITION Position = NextPosition;
405 Entry = m_WatcherList.GetNext(NextPosition); // Note: This will advance NextPosition
406 if (Entry)
407 {
408 if ((iconData && ((Entry->IconData.hWnd == iconData->hWnd) && (Entry->IconData.uID == iconData->uID))) ||
409 (hProcess && (Entry->hProcess == hProcess)))
410 {
411 if (Remove)
412 m_WatcherList.RemoveAt(Position);
413 return Entry;
414 }
415 }
416 }
417 return NULL;
418}
419
421{
422 CIconWatcher* This = reinterpret_cast<CIconWatcher *>(lpParam);
423 HANDLE *WatchList = NULL;
424
425 This->m_Loop = true;
426 while (This->m_Loop)
427 {
428 EnterCriticalSection(&This->m_ListLock);
429
430 DWORD Size;
431 Size = This->m_WatcherList.GetCount() + 1;
433
434 if (WatchList)
435 delete[] WatchList;
436 WatchList = new HANDLE[Size];
437 WatchList[0] = This->m_WakeUpEvent;
438
440 for (size_t i = 0; i < This->m_WatcherList.GetCount(); i++)
441 {
442 Pos = This->m_WatcherList.FindIndex(i);
443 if (Pos)
444 {
445 IconWatcherData *Icon;
446 Icon = This->m_WatcherList.GetAt(Pos);
447 WatchList[i + 1] = Icon->hProcess;
448 }
449 }
450
451 LeaveCriticalSection(&This->m_ListLock);
452
455 WatchList,
456 FALSE,
457 INFINITE);
458 if (Status == WAIT_OBJECT_0)
459 {
460 // We've been kicked, we have updates to our list (or we're exiting the thread)
461 if (This->m_Loop)
462 TRACE("Updating watched icon list\n");
463 }
464 else if ((Status >= WAIT_OBJECT_0 + 1) && (Status < Size))
465 {
466 IconWatcherData *Icon;
467 Icon = This->GetListEntry(NULL, WatchList[Status], false);
468
469 TRACE("Pid %lu owns a notification icon and has stopped without deleting it. We'll cleanup on its behalf\n", Icon->ProcessId);
470
471 TRAYNOTIFYDATAW tnid = {0};
472 tnid.dwSignature = NI_NOTIFY_SIG;
473 tnid.dwMessage = NIM_DELETE;
474 CopyMemory(&tnid.nid, &Icon->IconData, Icon->IconData.cbSize);
475
477 data.dwData = 1;
478 data.cbData = sizeof(tnid);
479 data.lpData = &tnid;
480
481 BOOL Success = ::SendMessage(This->m_hwndSysTray, WM_COPYDATA,
482 (WPARAM)&Icon->IconData, (LPARAM)&data);
483 if (!Success)
484 {
485 // If we failed to handle the delete message, forcibly remove it
486 This->RemoveIconFromWatcher(&Icon->IconData);
487 }
488 }
489 else
490 {
491 if (Status == WAIT_FAILED)
492 {
494 }
495 ERR("Failed to wait on process handles : %lu\n", Status);
496 This->Uninitialize();
497 }
498 }
499
500 if (WatchList)
501 delete[] WatchList;
502
503 return 0;
504}
505
506/*
507 * BalloonQueue
508 */
509
511 m_hwndParent(NULL),
512 m_tooltips(NULL),
513 m_toolbar(NULL),
514 m_current(NULL),
515 m_timer(-1)
516{
517}
518
520{
522 m_toolbar = toolbar;
523 m_tooltips = balloons;
524}
525
527{
528 if (m_timer >= 0)
529 {
531 }
532}
533
534bool CBalloonQueue::OnTimer(int timerId)
535{
536 if (timerId != m_timer)
537 return false;
538
540 m_timer = -1;
541
542 if (m_current)
543 {
544 Close(m_current, NIN_BALLOONTIMEOUT);
545 }
546 else
547 {
548 if (!m_queue.IsEmpty())
549 {
550 Info info = m_queue.RemoveHead();
551 Show(info);
552 }
553 }
554
555 return true;
556}
557
559{
560 if (notifyItem->szInfo[0])
561 {
562 Info info(notifyItem);
563
564 // If m_current == notifyItem, we want to replace the previous balloon even if there is a queue.
565 if (m_current != notifyItem && (m_current != NULL || !m_queue.IsEmpty()))
566 {
567 m_queue.AddTail(info);
568 }
569 else
570 {
571 Show(info);
572 }
573 }
574 else
575 {
576 Close(notifyItem, NIN_BALLOONHIDE);
577 }
578}
579
581{
582 Close(notifyItem, NIN_BALLOONHIDE);
583
584 for (POSITION next = m_queue.GetHeadPosition(); next;)
585 {
587 Info& info = m_queue.GetNext(next); // Note: This will advance the position
588 if (info.pSource == notifyItem)
589 {
590 m_queue.RemoveAt(current);
591 break;
592 }
593 }
594}
595
597{
598 if (m_current != NULL)
599 {
600 Close(m_current, NIN_BALLOONTIMEOUT);
601 }
602}
603
605{
606 int count = m_toolbar->GetButtonCount();
607 for (int i = 0; i < count; i++)
608 {
609 if (m_toolbar->GetItemData(i) == pdata)
610 return i;
611 }
612 return -1;
613}
614
616{
618}
619
621{
622 TRACE("ShowBalloonTip called for flags=%x text=%ws; title=%ws\n", info.uIcon, info.szInfo, info.szInfoTitle);
623
624 // TODO: NIF_REALTIME, NIIF_NOSOUND, other Vista+ flags
625
626 m_current = info.pSource;
627 RECT rc;
628 m_toolbar->GetItemRect(IndexOf(m_current), &rc);
629 UINT halfsize = (rc.right - rc.left) / 2;
631 WORD x = rc.left + halfsize, y = rc.top + halfsize;
632
633 m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
636 m_tooltips->UpdateTipText(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd), info.szInfo);
638
639 int timeout = info.uTimeout;
642
644
645 m_toolbar->SendNotifyCallback(m_current, NIN_BALLOONSHOW);
646}
647
649{
650 TRACE("HideBalloonTip called\n");
651
652 if (m_current == notifyItem)
653 {
655
656 m_current = NULL; // Prevent re-entry (TrackDeactivate will generate a TTN_POP)
659 }
660}
661
662/*
663 * NotifyToolbar
664 */
665
667 m_ImageList(NULL),
668 m_VisibleButtonCount(0),
669 m_BalloonQueue(NULL)
670{
671}
672
674{
675}
676
678{
680}
681
683{
684 for (UINT i = 0;; ++i)
685 {
687 if (!(state & TBSTATE_HIDDEN))
688 return i;
689 if (state == -1)
690 return state;
691 }
692}
693
695{
696 int count = GetButtonCount();
697
698 for (int i = 0; i < count; i++)
699 {
700 InternalIconData * data = GetItemData(i);
701
702 if (data->hWnd == hWnd &&
703 data->uID == uID)
704 {
705 if (pdata)
706 *pdata = data;
707 return i;
708 }
709 }
710
711 return -1;
712}
713
715{
716 int count = GetButtonCount();
717 for (int i = 0; i < count; i++)
718 {
719 InternalIconData * data = GetItemData(i);
720 if (data->hIcon == handle)
721 {
722 TBBUTTON btn;
723 GetButton(i, &btn);
724 return btn.iBitmap;
725 }
726 }
727
728 return -1;
729}
730
732{
733 TBBUTTON tbBtn = { 0 };
734 InternalIconData * notifyItem;
735 WCHAR text[] = L"";
736
737 TRACE("Adding icon %d from hWnd %08x flags%s%s state%s%s\n",
738 iconData->uID, iconData->hWnd,
739 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
740 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
741 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
742 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
743
744 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
745 if (index >= 0)
746 {
747 TRACE("Icon %d from hWnd %08x ALREADY EXISTS!\n", iconData->uID, iconData->hWnd);
748 return FALSE;
749 }
750
751 notifyItem = new InternalIconData();
752 ZeroMemory(notifyItem, sizeof(*notifyItem));
753
754 notifyItem->hWnd = iconData->hWnd;
755 notifyItem->uID = iconData->uID;
756
757 tbBtn.fsState = TBSTATE_ENABLED;
758 tbBtn.fsStyle = BTNS_NOPREFIX;
759 tbBtn.dwData = (DWORD_PTR)notifyItem;
760 tbBtn.iString = (INT_PTR) text;
761 tbBtn.idCommand = GetButtonCount();
762 tbBtn.iBitmap = -1;
763
764 if (iconData->uFlags & NIF_STATE)
765 {
766 notifyItem->dwState = iconData->dwState & iconData->dwStateMask;
767 }
768
769 if (iconData->uFlags & NIF_MESSAGE)
770 {
771 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
772 }
773
774 if (iconData->uFlags & NIF_ICON)
775 {
776 notifyItem->hIcon = iconData->hIcon;
777 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
778 if (hasSharedIcon)
779 {
780 INT iIcon = FindExistingSharedIcon(notifyItem->hIcon);
781 if (iIcon < 0)
782 {
783 notifyItem->hIcon = NULL;
784 TRACE("Shared icon requested, but HICON not found!!!\n");
785 }
786 tbBtn.iBitmap = iIcon;
787 }
788 else
789 {
790 tbBtn.iBitmap = ImageList_AddIcon(m_ImageList, notifyItem->hIcon);
791 }
792 }
793
794 if (iconData->uFlags & NIF_TIP)
795 {
796 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
797 }
798
799 if (iconData->uFlags & NIF_INFO)
800 {
801 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
802 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
803 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
804 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
805 notifyItem->uTimeout = iconData->uTimeout;
806 }
807
808 if (notifyItem->dwState & NIS_HIDDEN)
809 {
810 tbBtn.fsState |= TBSTATE_HIDDEN;
811 }
812 else
813 {
815 }
816
817 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
818
819 CToolbar::AddButton(&tbBtn);
821
822 if (iconData->uFlags & NIF_INFO)
823 {
824 m_BalloonQueue->UpdateInfo(notifyItem);
825 }
826
827 return TRUE;
828}
829
831{
832 InternalIconData * notifyItem;
833 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
834 if (index < 0)
835 {
836 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
837 return FALSE;
838 }
839
840 if (iconData->uVersion != 0 && iconData->uVersion != NOTIFYICON_VERSION)
841 {
842 WARN("Tried to set the version of icon %d from hWnd %08x, to an unknown value %d. Vista+ program?\n", iconData->uID, iconData->hWnd, iconData->uVersion);
843 return FALSE;
844 }
845
846 // We can not store the version in the uVersion field, because it's union'd with uTimeout,
847 // which we also need to keep track of.
848 notifyItem->SaveVersion(iconData->uVersion);
849
850 return TRUE;
851}
852
854{
855 InternalIconData * notifyItem;
856 TBBUTTONINFO tbbi = { 0 };
857
858 TRACE("Updating icon %d from hWnd %08x flags%s%s state%s%s\n",
859 iconData->uID, iconData->hWnd,
860 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
861 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
862 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
863 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
864
865 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
866 if (index < 0)
867 {
868 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
869 return FALSE;
870 }
871
872 TBBUTTON btn;
873 GetButton(index, &btn);
874 int oldIconIndex = btn.iBitmap;
875
876 tbbi.cbSize = sizeof(tbbi);
877 tbbi.dwMask = TBIF_BYINDEX | TBIF_COMMAND;
878 tbbi.idCommand = index;
879
880 if (iconData->uFlags & NIF_STATE)
881 {
882 if (iconData->dwStateMask & NIS_HIDDEN &&
883 (notifyItem->dwState & NIS_HIDDEN) != (iconData->dwState & NIS_HIDDEN))
884 {
885 tbbi.dwMask |= TBIF_STATE;
886 if (iconData->dwState & NIS_HIDDEN)
887 {
888 tbbi.fsState |= TBSTATE_HIDDEN;
890 }
891 else
892 {
893 tbbi.fsState &= ~TBSTATE_HIDDEN;
895 }
896 }
897
898 notifyItem->dwState &= ~iconData->dwStateMask;
899 notifyItem->dwState |= (iconData->dwState & iconData->dwStateMask);
900 }
901
902 if (iconData->uFlags & NIF_MESSAGE)
903 {
904 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
905 }
906
907 if (iconData->uFlags & NIF_ICON)
908 {
909 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
910 if (hasSharedIcon)
911 {
912 INT iIcon = FindExistingSharedIcon(iconData->hIcon);
913 if (iIcon >= 0)
914 {
915 notifyItem->hIcon = iconData->hIcon;
916 tbbi.dwMask |= TBIF_IMAGE;
917 tbbi.iImage = iIcon;
918 }
919 else
920 {
921 TRACE("Shared icon requested, but HICON not found!!! IGNORING!\n");
922 }
923 }
924 else
925 {
926 notifyItem->hIcon = iconData->hIcon;
927 tbbi.dwMask |= TBIF_IMAGE;
928 tbbi.iImage = ImageList_ReplaceIcon(m_ImageList, oldIconIndex, notifyItem->hIcon);
929 }
930 }
931
932 if (iconData->uFlags & NIF_TIP)
933 {
934 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
935 }
936
937 if (iconData->uFlags & NIF_INFO)
938 {
939 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
940 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
941 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
942 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
943 notifyItem->uTimeout = iconData->uTimeout;
944 }
945
946 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
947
948 SetButtonInfo(index, &tbbi);
949
950 if (iconData->uFlags & NIF_INFO)
951 {
952 m_BalloonQueue->UpdateInfo(notifyItem);
953 }
954
955 return TRUE;
956}
957
959{
960 InternalIconData * notifyItem;
961
962 TRACE("Removing icon %d from hWnd %08x\n", iconData->uID, iconData->hWnd);
963
964 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
965 if (index < 0)
966 {
967 TRACE("Icon %d from hWnd %08x ALREADY MISSING!\n", iconData->uID, iconData->hWnd);
968
969 return FALSE;
970 }
971 if (notifyItem->IsRemoved())
972 return FALSE; // Avoid recursion [CORE-20685]
973 else
974 notifyItem->MarkAsRemoved();
975
976 if (!(notifyItem->dwState & NIS_HIDDEN))
977 {
979 }
980
981 if (!(notifyItem->dwState & NIS_SHAREDICON))
982 {
983 TBBUTTON btn;
984 GetButton(index, &btn);
985 int oldIconIndex = btn.iBitmap;
986 ImageList_Remove(m_ImageList, oldIconIndex);
987
988 // Update other icons!
989 int count = GetButtonCount();
990 for (int i = 0; i < count; i++)
991 {
992 TBBUTTON btn;
993 GetButton(i, &btn);
994
995 if (btn.iBitmap > oldIconIndex)
996 {
997 TBBUTTONINFO tbbi2 = { 0 };
998 tbbi2.cbSize = sizeof(tbbi2);
999 tbbi2.dwMask = TBIF_BYINDEX | TBIF_IMAGE;
1000 tbbi2.iImage = btn.iBitmap-1;
1001 SetButtonInfo(i, &tbbi2);
1002 }
1003 }
1004 }
1005
1006 m_BalloonQueue->RemoveInfo(notifyItem);
1007
1008 DeleteButton(index);
1009
1010 delete notifyItem;
1011
1012 return TRUE;
1013}
1014
1016{
1017 int cx, cy;
1018 HIMAGELIST iml;
1019
1021 return;
1022
1024 return;
1025
1027 if (!iml)
1028 return;
1029
1031 m_ImageList = iml;
1033
1034 int count = GetButtonCount();
1035 for (int i = 0; i < count; i++)
1036 {
1037 InternalIconData * data = GetItemData(i);
1038 BOOL hasSharedIcon = data->dwState & NIS_SHAREDICON;
1039 INT iIcon = hasSharedIcon ? FindExistingSharedIcon(data->hIcon) : -1;
1040 if (iIcon < 0)
1041 iIcon = ImageList_AddIcon(iml, data->hIcon);
1042 TBBUTTONINFO tbbi = { sizeof(tbbi), TBIF_BYINDEX | TBIF_IMAGE, 0, iIcon};
1043 SetButtonInfo(i, &tbbi);
1044 }
1045
1047}
1048
1050{
1051 if (m_ImageList)
1052 {
1054 m_ImageList = NULL;
1055 }
1056
1057 return 0;
1058}
1059
1061{
1062 bHandled = FALSE;
1063
1064 /*
1065 * WM_CONTEXTMENU message can be generated either by the mouse,
1066 * in which case lParam encodes the mouse coordinates where the
1067 * user right-clicked the mouse, or can be generated by (Shift-)F10
1068 * keyboard press, in which case lParam equals -1.
1069 */
1070 INT iBtn = GetHotItem();
1071 if (iBtn < 0)
1072 return 0;
1073
1074 InternalIconData* notifyItem = GetItemData(iBtn);
1075
1076 if (!::IsWindow(notifyItem->hWnd))
1077 return 0;
1078
1079 if (notifyItem->GetVersion() >= NOTIFYICON_VERSION)
1080 {
1081 /* Transmit the WM_CONTEXTMENU message if the notification icon supports it */
1082 ::SendNotifyMessage(notifyItem->hWnd,
1083 notifyItem->uCallbackMessage,
1084 notifyItem->uID,
1086 }
1087 else if (lParam == -1)
1088 {
1089 /*
1090 * Otherwise, and only if the WM_CONTEXTMENU message was generated
1091 * from the keyboard, simulate right-click mouse messages. This is
1092 * not needed if the message came from the mouse because in this
1093 * case the right-click mouse messages were already sent together.
1094 */
1095 ::SendNotifyMessage(notifyItem->hWnd,
1096 notifyItem->uCallbackMessage,
1097 notifyItem->uID,
1099 ::SendNotifyMessage(notifyItem->hWnd,
1100 notifyItem->uCallbackMessage,
1101 notifyItem->uID,
1102 WM_RBUTTONUP);
1103 }
1104
1105 return 0;
1106}
1107
1109{
1110 if (!::IsWindow(notifyItem->hWnd))
1111 {
1112 // We detect and destroy icons with invalid handles only on mouse move over systray, same as MS does.
1113 // Alternatively we could search for them periodically (would waste more resources).
1114 TRACE("Destroying icon %d with invalid handle hWnd=%08x\n", notifyItem->uID, notifyItem->hWnd);
1115
1116 RemoveButton(notifyItem);
1117
1118 /* Ask the parent to resize */
1119 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
1120 GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
1121
1122 return true;
1123 }
1124
1125 DWORD pid;
1126 GetWindowThreadProcessId(notifyItem->hWnd, &pid);
1127
1128 if (pid == GetCurrentProcessId() ||
1129 (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST))
1130 {
1131 ::PostMessage(notifyItem->hWnd,
1132 notifyItem->uCallbackMessage,
1133 notifyItem->uID,
1134 uMsg);
1135 }
1136 else
1137 {
1138 ::SendMessage(notifyItem->hWnd,
1139 notifyItem->uCallbackMessage,
1140 notifyItem->uID,
1141 uMsg);
1142 }
1143 return false;
1144}
1145
1147{
1148 static LPCWSTR eventNames [] = {
1149 L"WM_MOUSEMOVE",
1150 L"WM_LBUTTONDOWN",
1151 L"WM_LBUTTONUP",
1152 L"WM_LBUTTONDBLCLK",
1153 L"WM_RBUTTONDOWN",
1154 L"WM_RBUTTONUP",
1155 L"WM_RBUTTONDBLCLK",
1156 L"WM_MBUTTONDOWN",
1157 L"WM_MBUTTONUP",
1158 L"WM_MBUTTONDBLCLK",
1159 L"WM_MOUSEWHEEL",
1160 L"WM_XBUTTONDOWN",
1161 L"WM_XBUTTONUP",
1162 L"WM_XBUTTONDBLCLK"
1163 };
1164
1165 InternalIconData * notifyItem = GetItemData(wIndex);
1166
1167 if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
1168 {
1169 TRACE("Sending message %S from button %d to %p (msg=%x, w=%x, l=%x)...\n",
1170 eventNames[uMsg - WM_MOUSEFIRST], wIndex,
1171 notifyItem->hWnd, notifyItem->uCallbackMessage, notifyItem->uID, uMsg);
1172 }
1173
1174 SendNotifyCallback(notifyItem, uMsg);
1175}
1176
1178{
1180 INT iBtn = HitTest(&pt);
1181
1182 if (iBtn >= 0)
1183 {
1184 SendMouseEvent(iBtn, uMsg, wParam);
1185 }
1186
1187 bHandled = FALSE;
1188 return FALSE;
1189}
1190
1192{
1193 InternalIconData * notifyItem = reinterpret_cast<InternalIconData *>(data);
1194 if (notifyItem)
1195 {
1196 StringCchCopy(szTip, cchTip, notifyItem->szTip);
1197 }
1198 else
1199 {
1200 StringCchCopy(szTip, cchTip, L"");
1201 }
1202}
1203
1205{
1206 RECT rcTip, rcItem;
1207 ::GetWindowRect(hdr->hwndFrom, &rcTip);
1208
1209 SIZE szTip = { rcTip.right - rcTip.left, rcTip.bottom - rcTip.top };
1210
1211 INT iBtn = GetHotItem();
1212
1213 if (iBtn >= 0)
1214 {
1215 MONITORINFO monInfo = { 0 };
1216 HMONITOR hMon = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
1217
1218 monInfo.cbSize = sizeof(monInfo);
1219
1220 if (hMon)
1221 GetMonitorInfo(hMon, &monInfo);
1222 else
1223 ::GetWindowRect(GetDesktopWindow(), &monInfo.rcMonitor);
1224
1225 GetItemRect(iBtn, &rcItem);
1226
1227 POINT ptItem = { rcItem.left, rcItem.top };
1228 SIZE szItem = { rcItem.right - rcItem.left, rcItem.bottom - rcItem.top };
1229 ClientToScreen(&ptItem);
1230
1231 ptItem.x += szItem.cx / 2;
1232 ptItem.y -= szTip.cy;
1233
1234 if (ptItem.x + szTip.cx > monInfo.rcMonitor.right)
1235 ptItem.x = monInfo.rcMonitor.right - szTip.cx;
1236
1237 if (ptItem.y + szTip.cy > monInfo.rcMonitor.bottom)
1238 ptItem.y = monInfo.rcMonitor.bottom - szTip.cy;
1239
1240 if (ptItem.x < monInfo.rcMonitor.left)
1241 ptItem.x = monInfo.rcMonitor.left;
1242
1243 if (ptItem.y < monInfo.rcMonitor.top)
1244 ptItem.y = monInfo.rcMonitor.top;
1245
1246 TRACE("ptItem { %d, %d }\n", ptItem.x, ptItem.y);
1247
1248 ::SetWindowPos(hdr->hwndFrom, NULL, ptItem.x, ptItem.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
1249
1250 return TRUE;
1251 }
1252
1253 bHandled = FALSE;
1254 return 0;
1255}
1256
1258{
1260
1261 DWORD styles =
1265
1266 // HACK & FIXME: CORE-18016
1268 m_hWnd = NULL;
1270
1271 // Force the toolbar tooltips window to always show tooltips even if not foreground
1272 HWND tooltipsWnd = (HWND)SendMessageW(TB_GETTOOLTIPS);
1273 if (tooltipsWnd)
1274 {
1275 ::SetWindowLong(tooltipsWnd, GWL_STYLE, ::GetWindowLong(tooltipsWnd, GWL_STYLE) | TTS_ALWAYSTIP);
1276 }
1277
1278 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
1279
1282
1284
1286}
1287
1289{
1290 // Toolbar metrics only needs to be refreshed for the automatic setting and first launch
1291 if (g_TaskbarSettings.eCompactTrayIcons == TrayIconsMode::TIM_Default ||
1292 bForceRefresh)
1293 {
1294 TBMETRICS tbm = {sizeof(tbm)};
1296 tbm.cxPad = 1;
1297 tbm.cyPad = 1;
1299 {
1302 }
1303 tbm.cxBarPad = 1;
1304 tbm.cyBarPad = 1;
1305 tbm.cxButtonSpacing = 1;
1306 tbm.cyButtonSpacing = 1;
1307 SetMetrics(&tbm);
1308 }
1309}
1310
1311/*
1312 * SysPagerWnd
1313 */
1314
1316
1318
1320{
1321 HDC hdc = (HDC) wParam;
1322
1323 if (!IsAppThemed())
1324 {
1325 bHandled = FALSE;
1326 return 0;
1327 }
1328
1329 RECT rect;
1332
1333 return TRUE;
1334}
1335
1337{
1340
1341 HWND hWndTop = GetAncestor(m_hWnd, GA_ROOT);
1342
1344
1345 TOOLINFOW ti = { 0 };
1346 ti.cbSize = TTTOOLINFOW_V1_SIZE;
1347 ti.uFlags = TTF_TRACK | TTF_IDISHWND;
1348 ti.uId = reinterpret_cast<UINT_PTR>(Toolbar.m_hWnd);
1349 ti.hwnd = m_hWnd;
1350 ti.lpszText = NULL;
1351 ti.lParam = NULL;
1352
1353 BOOL ret = m_Balloons.AddTool(&ti);
1354 if (!ret)
1355 {
1356 WARN("AddTool failed, LastError=%d (probably meaningless unless non-zero)\n", GetLastError());
1357 }
1358
1360
1361 // Explicitly request running applications to re-register their systray icons
1363 RegisterWindowMessageW(L"TaskbarCreated"),
1364 0, 0);
1365
1366 return TRUE;
1367}
1368
1370{
1373 return TRUE;
1374}
1375
1377{
1378 BOOL ret = FALSE;
1379
1380 int VisibleButtonCount = Toolbar.GetVisibleButtonCount();
1381
1382 TRACE("NotifyIcon received. Code=%d\n", dwMessage);
1383 switch (dwMessage)
1384 {
1385 case NIM_ADD:
1386 ret = Toolbar.AddButton(iconData);
1387 if (ret == TRUE)
1388 {
1389 (void)AddIconToWatcher(iconData);
1390 }
1391 break;
1392
1393 case NIM_MODIFY:
1394 ret = Toolbar.UpdateButton(iconData);
1395 break;
1396
1397 case NIM_DELETE:
1398 ret = Toolbar.RemoveButton(iconData);
1399 if (ret == TRUE)
1400 {
1401 (void)RemoveIconFromWatcher(iconData);
1402 }
1403 break;
1404
1405 case NIM_SETFOCUS:
1407 {
1409 int index = Toolbar.FindItem(iconData->hWnd, iconData->uID, &pData);
1410 if (index < 0 || (pData->dwState & NIS_HIDDEN))
1412 Toolbar.SetFocus();
1413 Toolbar.SetHotItem(index);
1414 }
1415 ret = TRUE;
1416 break;
1417
1418 case NIM_SETVERSION:
1419 ret = Toolbar.SwitchVersion(iconData);
1420 break;
1421
1422 default:
1423 TRACE("NotifyIcon received with unknown code %d.\n", dwMessage);
1424 return FALSE;
1425 }
1426
1427 if (VisibleButtonCount != Toolbar.GetVisibleButtonCount())
1428 {
1429 /* Ask the parent to resize */
1430 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
1431 // FIXME: This causes the desktop icons to flash (InvalidateRect?)
1432 GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
1433 }
1434
1435 return ret;
1436}
1437
1439{
1440 /* Get the ideal height or width */
1441#if 0
1442 /* Unfortunately this doens't work correctly in ros */
1443 Toolbar.GetIdealSize(!IsHorizontal, size);
1444
1445 /* Make the reference dimension an exact multiple of the icon size */
1446 if (IsHorizontal)
1447 size->cy -= size->cy % GetSystemMetrics(SM_CYSMICON);
1448 else
1449 size->cx -= size->cx % GetSystemMetrics(SM_CXSMICON);
1450
1451#else
1452 INT rows = 0;
1453 INT columns = 0;
1454 INT cyButton = GetSystemMetrics(SM_CYSMICON) + 2;
1455 INT cxButton = GetSystemMetrics(SM_CXSMICON) + 2;
1457 {
1458 cyButton = MulDiv(GetSystemMetrics(SM_CYSMICON), 3, 2);
1459 cxButton = MulDiv(GetSystemMetrics(SM_CXSMICON), 3, 2);
1460 }
1461 int VisibleButtonCount = Toolbar.GetVisibleButtonCount();
1462
1463 if (IsHorizontal)
1464 {
1466 rows = max(size->cy / MulDiv(cyButton, 3, 2), 1);
1467 else
1468 rows = max(size->cy / cyButton, 1);
1469 columns = (VisibleButtonCount + rows - 1) / rows;
1470 }
1471 else
1472 {
1473 columns = max(size->cx / cxButton, 1);
1474 rows = (VisibleButtonCount + columns - 1) / columns;
1475 }
1476 size->cx = columns * cxButton;
1477 size->cy = rows * cyButton;
1478#endif
1479}
1480
1482{
1483 NMTBGETINFOTIPW * nmtip = (NMTBGETINFOTIPW *) hdr;
1484 GetTooltipText(nmtip->lParam, nmtip->pszText, nmtip->cchTextMax);
1485 return TRUE;
1486}
1487
1489{
1490 NMCUSTOMDRAW * cdraw = (NMCUSTOMDRAW *) hdr;
1491 switch (cdraw->dwDrawStage)
1492 {
1493 case CDDS_PREPAINT:
1494 return CDRF_NOTIFYITEMDRAW;
1495
1496 case CDDS_ITEMPREPAINT:
1498 }
1499 return TRUE;
1500}
1501
1503{
1504 bHandled = FALSE;
1505
1506 /* Handles the BN_CLICKED notifications sent by the CNotifyToolbar member */
1507 if (HIWORD(wParam) != BN_CLICKED)
1508 return 0;
1509
1510 INT iBtn = LOWORD(wParam);
1511 if (iBtn < 0)
1512 return 0;
1513
1514 InternalIconData* notifyItem = Toolbar.GetItemData(iBtn);
1515
1516 if (!::IsWindow(notifyItem->hWnd))
1517 return 0;
1518
1519 // TODO: Improve keyboard handling by looking whether one presses
1520 // on ENTER, etc..., which roughly translates into "double-clicking".
1521
1522 if (notifyItem->GetVersion() >= NOTIFYICON_VERSION)
1523 {
1524 /* Use new-style notifications if the notification icon supports them */
1525 ::SendNotifyMessage(notifyItem->hWnd,
1526 notifyItem->uCallbackMessage,
1527 notifyItem->uID,
1528 NIN_SELECT); // TODO: Distinguish with NIN_KEYSELECT
1529 }
1530 else if (lParam == -1)
1531 {
1532 /*
1533 * Otherwise, and only if the icon was selected via the keyboard,
1534 * simulate right-click mouse messages. This is not needed if the
1535 * selection was done by mouse because in this case the mouse
1536 * messages were already sent.
1537 */
1538 ::SendNotifyMessage(notifyItem->hWnd,
1539 notifyItem->uCallbackMessage,
1540 notifyItem->uID,
1541 WM_LBUTTONDOWN); // TODO: Distinguish with double-click WM_LBUTTONDBLCLK
1542 ::SendNotifyMessage(notifyItem->hWnd,
1543 notifyItem->uCallbackMessage,
1544 notifyItem->uID,
1545 WM_LBUTTONUP);
1546 }
1547
1548 return 0;
1549}
1550
1552{
1553 LRESULT Ret = TRUE;
1554 SIZE szClient;
1555 szClient.cx = LOWORD(lParam);
1556 szClient.cy = HIWORD(lParam);
1557
1558 Ret = DefWindowProc(uMsg, wParam, lParam);
1559
1560 if (Toolbar)
1561 {
1562 Toolbar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1563 Toolbar.AutoSize();
1564
1565 RECT rc;
1567
1568 SIZE szBar = { rc.right - rc.left, rc.bottom - rc.top };
1569
1570 INT xOff = (szClient.cx - szBar.cx) / 2;
1571 INT yOff = (szClient.cy - szBar.cy) / 2;
1572
1573 Toolbar.SetWindowPos(NULL, xOff, yOff, szBar.cx, szBar.cy, SWP_NOZORDER);
1575 }
1576 return Ret;
1577}
1578
1580{
1581 bHandled = TRUE;
1582 return 0;
1583}
1584
1586{
1588 bHandled = TRUE;
1589 return 0;
1590}
1591
1593{
1595 {
1596 bHandled = TRUE;
1597 }
1598
1599 return 0;
1600}
1601
1603{
1605 if (cpData->dwData == TABDMC_NOTIFY)
1606 {
1607 /* A taskbar NotifyIcon notification */
1608 PTRAYNOTIFYDATAW pData = (PTRAYNOTIFYDATAW)cpData->lpData;
1609 if (pData->dwSignature == NI_NOTIFY_SIG)
1610 return NotifyIcon(pData->dwMessage, &pData->nid);
1611 }
1612 else if (cpData->dwData == TABDMC_LOADINPROC)
1613 {
1614 FIXME("Taskbar Load In Proc\n");
1615 }
1616
1617 return FALSE;
1618}
1619
1621{
1622 if (wParam == SPI_SETNONCLIENTMETRICS)
1623 {
1625 }
1626 return 0;
1627}
1628
1630{
1632 return 0;
1633}
1634
1636{
1637 /* Create the window. The tray window is going to move it to the correct
1638 position and resize it as needed. */
1640 Create(hWndParent, 0, NULL, dwStyle);
1641 if (!m_hWnd)
1642 return E_FAIL;
1643
1644 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
1645
1646 return S_OK;
1647}
1648
1650{
1651 return ShellObjectCreatorInit<CSysPagerWnd>(hwndParent, riid, ppv);
1652}
static BOOL OnCopyData(HWND hwnd, HWND hwndSender, COPYDATASTRUCT *pCopyData)
static int state
Definition: maze.c:121
HWND hWnd
Definition: settings.c:17
const WCHAR * class
Definition: main.c:68
#define index(s, c)
Definition: various.h:29
@ Create
Definition: registry.c:563
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:380
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define NTNWM_REALIGN
Definition: precomp.h:384
static VOID OnTimer(IN HWND hwndDlg, IN PSYS_SHUTDOWN_PARAMS pShutdownParams)
Definition: shutdown.c:72
#define STDMETHODIMP
Definition: basetyps.h:43
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
HWND SetFocus()
Definition: atlwin.h:1198
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:541
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
CWindow GetParent() const
Definition: atlwin.h:700
HWND m_hWnd
Definition: atlwin.h:273
BOOL ClientToScreen(LPPOINT lpPoint) const
Definition: atlwin.h:393
BOOL IsWindow() const
Definition: atlwin.h:947
static const int MinTimeout
Definition: syspager.cpp:95
HWND m_hwndParent
Definition: syspager.cpp:120
static const int CooldownBetweenBalloons
Definition: syspager.cpp:97
CTooltips * m_tooltips
Definition: syspager.cpp:122
CNotifyToolbar * m_toolbar
Definition: syspager.cpp:126
void RemoveInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:580
void Deinit()
Definition: syspager.cpp:526
InternalIconData * m_current
Definition: syspager.cpp:128
static const int TimerInterval
Definition: syspager.cpp:93
void SetTimer(int length)
Definition: syspager.cpp:615
void UpdateInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:558
void Init(HWND hwndParent, CNotifyToolbar *toolbar, CTooltips *balloons)
Definition: syspager.cpp:519
CAtlList< Info > m_queue
Definition: syspager.cpp:124
void Show(Info &info)
Definition: syspager.cpp:620
void Close(IN OUT InternalIconData *notifyItem, IN UINT uReason)
Definition: syspager.cpp:648
void CloseCurrent()
Definition: syspager.cpp:596
static const int MaxTimeout
Definition: syspager.cpp:96
int IndexOf(InternalIconData *pdata)
Definition: syspager.cpp:604
static const int BalloonsTimerId
Definition: syspager.cpp:94
bool OnTimer(int timerId)
Definition: syspager.cpp:534
HWND m_hwndSysTray
Definition: syspager.cpp:67
bool RemoveIconFromWatcher(_In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:385
bool AddIconToWatcher(_In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:346
virtual ~CIconWatcher()
Definition: syspager.cpp:290
CRITICAL_SECTION m_ListLock
Definition: syspager.cpp:64
bool Initialize(_In_ HWND hWndParent)
Definition: syspager.cpp:301
HANDLE m_WakeUpEvent
Definition: syspager.cpp:66
IconWatcherData * GetListEntry(_In_opt_ CONST NOTIFYICONDATA *iconData, _In_opt_ HANDLE hProcess, _In_ bool Remove)
Definition: syspager.cpp:399
static UINT WINAPI WatcherThread(_In_opt_ LPVOID lpParam)
Definition: syspager.cpp:420
CAtlList< IconWatcherData * > m_WatcherList
Definition: syspager.cpp:63
void Uninitialize()
Definition: syspager.cpp:322
HANDLE m_hWatcherThread
Definition: syspager.cpp:65
BOOL RemoveButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:958
BOOL UpdateButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:853
HIMAGELIST m_ImageList
Definition: syspager.cpp:154
int GetVisibleButtonCount()
Definition: syspager.cpp:677
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1177
int FindItem(IN HWND hWnd, IN UINT uID, InternalIconData **pdata)
Definition: syspager.cpp:694
int FindExistingSharedIcon(HICON handle)
Definition: syspager.cpp:714
bool SendNotifyCallback(InternalIconData *notifyItem, UINT uMsg)
Definition: syspager.cpp:1108
BOOL AddButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:731
LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1060
virtual ~CNotifyToolbar()
Definition: syspager.cpp:673
VOID ResizeImagelist()
Definition: syspager.cpp:1015
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1049
void Initialize(HWND hWndParent, CBalloonQueue *queue)
Definition: syspager.cpp:1257
BOOL SwitchVersion(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:830
CBalloonQueue * m_BalloonQueue
Definition: syspager.cpp:157
int GetFirstVisibleIndex()
Definition: syspager.cpp:682
void RefreshToolbarMetrics(BOOL bForceRefresh)
Definition: syspager.cpp:1288
int m_VisibleButtonCount
Definition: syspager.cpp:155
VOID SendMouseEvent(IN WORD wIndex, IN UINT uMsg, IN WPARAM wParam)
Definition: syspager.cpp:1146
LRESULT OnTooltipShow(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1204
virtual ~CSysPagerWnd()
Definition: syspager.cpp:1317
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1502
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: syspager.cpp:242
void GetSize(IN BOOL IsHorizontal, IN PSIZE size)
Definition: syspager.cpp:1438
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1629
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1592
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1369
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1602
LRESULT OnCustomDraw(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1488
CNotifyToolbar Toolbar
Definition: syspager.cpp:203
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1620
BOOL NotifyIcon(DWORD dwMessage, _In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:1376
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1336
HRESULT Initialize(IN HWND hWndParent)
Definition: syspager.cpp:1635
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1551
HWND GetTrayNotifyWindow() const
Definition: syspager.cpp:211
LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1579
HWND GetTaskbarWindow() const
Definition: syspager.cpp:212
LRESULT DrawBackground(HDC hdc)
CTooltips m_Balloons
Definition: syspager.cpp:204
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1319
LRESULT OnBalloonPop(UINT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1585
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: syspager.cpp:233
LRESULT OnGetInfoTip(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1481
CBalloonQueue m_BalloonQueue
Definition: syspager.cpp:205
DWORD AddButton(TBBUTTON *btn)
Definition: rosctrls.h:327
HWND Create(HWND hWndParent, DWORD dwStyles=0, DWORD dwExStyles=0)
Definition: rosctrls.h:256
INT SetMaxTipWidth(IN OPTIONAL INT width=-1)
Definition: rosctrls.h:798
BOOL AddTool(IN CONST TTTOOLINFOW *pInfo)
Definition: rosctrls.h:642
VOID TrackDeactivate()
Definition: rosctrls.h:728
VOID UpdateTipText(IN HWND hwndToolOwner, IN UINT uId, IN PCWSTR szText, IN HINSTANCE hinstResourceOwner=NULL)
Definition: rosctrls.h:690
BOOL SetTitle(PCWSTR szTitleText, WPARAM icon=0)
Definition: rosctrls.h:715
VOID TrackActivate(IN HWND hwndToolOwner, IN UINT uId)
Definition: rosctrls.h:720
HWND Create(HWND hWndParent, DWORD dwStyles=WS_POPUP|TTS_NOPREFIX, DWORD dwExStyles=WS_EX_TOPMOST)
Definition: rosctrls.h:621
VOID TrackPosition(IN WORD x, IN WORD y)
Definition: rosctrls.h:733
static int OnCommand(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: clipbrd.c:202
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
DWORD WINAPI GetSize(LPVOID)
static HWND hwndParent
Definition: cryptui.c:299
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
ush Pos
Definition: deflate.h:92
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2628
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2839
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2055
#define CloseHandle
Definition: compat.h:739
HANDLE HWND
Definition: compat.h:19
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1274
const WCHAR * text
Definition: package.c:1794
_ACRTIMP uintptr_t __cdecl _beginthreadex(void *, unsigned int, _beginthreadex_start_routine_t, void *, unsigned int, unsigned int *)
Definition: thread.c:207
#define false
Definition: stdbool.h:25
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
BOOL WINAPI IsAppThemed(void)
Definition: system.c:620
#define pt(x, y)
Definition: drawing.c:79
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
PKSAUDIO_DEVICE_ENTRY GetListEntry(IN PLIST_ENTRY Head, IN ULONG Index)
Definition: control.c:45
@ Success
Definition: eventcreate.c:712
static VOID OnSize(HWND hDlg, PDETAILDATA pData, INT cx, INT cy)
Definition: evtdetctl.c:701
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:24
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
char hdr[14]
Definition: iptest.cpp:33
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define NOTIFY_CODE_HANDLER(cd, func)
Definition: atlwin.h:1980
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define MESSAGE_RANGE_HANDLER(msgFirst, msgLast, func)
Definition: atlwin.h:1935
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:2004
if(dx< 0)
Definition: linetemp.h:194
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
#define ZeroMemory
Definition: minwinbase.h:31
#define CopyMemory
Definition: minwinbase.h:29
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define ASSERT(a)
Definition: mode.c:44
struct task_struct * current
Definition: linux.c:32
HDC hdc
Definition: main.c:9
static BOOL Uninitialize(LPCWSTR lpDriverPath)
Definition: main.c:16
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static PROTOCOLDATA * pdata
Definition: protocol.c:163
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
LPSTR LPTSTR
Definition: ms-dtyp.idl:131
BOOL OnCreate(HWND hWnd)
Definition: msconfig.c:97
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define SYNCHRONIZE
Definition: nt_native.h:61
const GUID IID_IOleWindow
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define CONST
Definition: pedump.c:81
short WCHAR
Definition: pedump.c:58
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TB_GETTOOLTIPS
Definition: commctrl.h:1138
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TTN_POP
Definition: commctrl.h:1880
#define TTN_SHOW
Definition: commctrl.h:1879
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define TBIF_IMAGE
Definition: commctrl.h:1219
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TBBUTTONINFO
Definition: commctrl.h:1254
#define TBCDRF_NOEDGES
Definition: commctrl.h:1033
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define TBCDRF_NOOFFSET
Definition: commctrl.h:1035
#define TOOLINFOW
Definition: commctrl.h:1715
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ILC_COLOR32
Definition: commctrl.h:358
#define TTTOOLINFOW_V1_SIZE
Definition: commctrl.h:1721
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1040
#define TBSTYLE_TRANSPARENT
Definition: commctrl.h:996
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define CCS_TOP
Definition: commctrl.h:2247
#define TBMF_BUTTONSPACING
Definition: commctrl.h:1289
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TBCDRF_NOETCHEDEFFECT
Definition: commctrl.h:1037
#define TBIF_BYINDEX
Definition: commctrl.h:1226
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define CDDS_PREPAINT
Definition: commctrl.h:280
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define TBMF_PAD
Definition: commctrl.h:1287
#define ILC_MASK
Definition: commctrl.h:351
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2251
#define TTS_NOPREFIX
Definition: commctrl.h:1758
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define TBN_GETINFOTIPW
Definition: commctrl.h:1342
#define TB_GETSTATE
Definition: commctrl.h:1055
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define TBMF_BARPAD
Definition: commctrl.h:1288
#define BTNS_NOPREFIX
Definition: commctrl.h:1005
#define TTF_TRACK
Definition: commctrl.h:1768
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
#define TBIF_COMMAND
Definition: commctrl.h:1224
#define TTS_CLOSE
Definition: commctrl.h:1762
#define TBIF_STATE
Definition: commctrl.h:1221
#define TBCDRF_NOMARK
Definition: commctrl.h:1036
#define TTS_BALLOON
Definition: commctrl.h:1761
#define REFIID
Definition: guiddef.h:118
_In_ UINT uID
Definition: shlwapi.h:156
static unsigned __int64 next
Definition: rand_nt.c:6
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
@ Close
Definition: sacdrv.h:268
Entry
Definition: section.c:5216
#define NIM_DELETE
Definition: shellapi.h:96
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:732
#define NIM_MODIFY
Definition: shellapi.h:95
#define NIF_ICON
Definition: shellapi.h:106
#define NIF_MESSAGE
Definition: shellapi.h:105
#define NIM_ADD
Definition: shellapi.h:94
#define NIF_TIP
Definition: shellapi.h:107
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
#define StringCchCopy
Definition: strsafe.h:139
Info(InternalIconData *source)
Definition: syspager.cpp:108
WCHAR szInfo[256]
Definition: syspager.cpp:103
WCHAR szInfoTitle[64]
Definition: syspager.cpp:104
InternalIconData * pSource
Definition: syspager.cpp:102
IconWatcherData(CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:43
HANDLE hProcess
Definition: syspager.cpp:39
NOTIFYICONDATA IconData
Definition: syspager.cpp:41
UINT GetVersion() const
Definition: syspager.cpp:32
void SaveVersion(UINT Version)
Definition: syspager.cpp:28
void MarkAsRemoved()
Definition: syspager.cpp:34
BOOL IsRemoved() const
Definition: syspager.cpp:33
int cyButtonSpacing
Definition: commctrl.h:1299
int cxButtonSpacing
Definition: commctrl.h:1298
int cxBarPad
Definition: commctrl.h:1296
DWORD dwMask
Definition: commctrl.h:1293
int cyBarPad
Definition: commctrl.h:1297
int cyPad
Definition: commctrl.h:1295
int cxPad
Definition: commctrl.h:1294
TrayIconsMode eCompactTrayIcons
Definition: precomp.h:226
BOOL UseCompactTrayIcons()
Definition: precomp.h:232
CHAR szInfoTitle[64]
Definition: shellapi.h:245
CHAR szInfo[256]
Definition: shellapi.h:240
UINT uCallbackMessage
Definition: shellapi.h:231
DWORD dwInfoFlags
Definition: shellapi.h:246
CHAR szTip[128]
Definition: shellapi.h:237
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
Definition: queue.c:179
ULONG_PTR dwData
Definition: winuser.h:3109
RECT rcMonitor
Definition: winuser.h:3893
DWORD cbSize
Definition: winuser.h:3892
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
Definition: dhcpd.h:248
static COORD Position
Definition: mouse.c:34
#define max(a, b)
Definition: svc.c:63
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition: synch.c:151
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1649
static VOID GetTooltipText(LPARAM data, LPTSTR szTip, DWORD cchTip)
Definition: syspager.cpp:1191
#define BALLOON_MAXWIDTH
Definition: syspager.cpp:24
static const WCHAR szSysPagerWndClass[]
Definition: syspager.cpp:194
#define DWORD_PTR
Definition: treelist.c:76
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * LPCWSTR
Definition: typedefs.h:57
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
#define TABDMC_LOADINPROC
Definition: undocshell.h:1026
#define TABDMC_NOTIFY
Definition: undocshell.h:1025
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MAXIMUM_WAIT_OBJECTS
Definition: winbase.h:381
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1205
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define WAIT_FAILED
Definition: winbase.h:390
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define WINAPI
Definition: msvc.h:6
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define GetMonitorInfo
Definition: winuser.h:5957
#define SetWindowLong
Definition: winuser.h:6019
#define SWP_NOACTIVATE
Definition: winuser.h:1253
BOOL WINAPI SendNotifyMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MOUSEFIRST
Definition: winuser.h:1802
#define GA_ROOT
Definition: winuser.h:2893
#define WM_MOUSELAST
Definition: winuser.h:1829
#define WM_CREATE
Definition: winuser.h:1636
#define WM_SIZE
Definition: winuser.h:1639
#define HWND_BROADCAST
Definition: winuser.h:1215
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_RBUTTONUP
Definition: winuser.h:1808
#define SM_CYSMICON
Definition: winuser.h:1024
#define SWP_NOSIZE
Definition: winuser.h:1256
#define CS_DBLCLKS
Definition: winuser.h:659
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define WM_RBUTTONDOWN
Definition: winuser.h:1807
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
#define SM_CXSMICON
Definition: winuser.h:1023
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_TIMER
Definition: winuser.h:1770
#define WM_COPYDATA
Definition: winuser.h:1692
#define SendMessage
Definition: winuser.h:6009
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define GetWindowLong
Definition: winuser.h:5962
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define PostMessage
Definition: winuser.h:5998
#define BN_CLICKED
Definition: winuser.h:1954
#define WM_DESTROY
Definition: winuser.h:1637
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define GWL_STYLE
Definition: winuser.h:863
#define SendNotifyMessage
Definition: winuser.h:6012
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
Definition: window.c:929
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define COLOR_3DFACE
Definition: winuser.h:940
_In_ BOOLEAN Remove
Definition: psfuncs.h:111
static void Initialize()
Definition: xlate.c:212
#define const
Definition: zconf.h:233