ReactOS 0.4.16-dev-751-g45ed1a9
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 // Must keep a separate copy since the original is unioned with uTimeout.
30};
31
33{
37
40 {
42 IconData.hWnd = iconData->hWnd;
43 IconData.uID = iconData->uID;
44 IconData.guidItem = iconData->guidItem;
45 }
46
48 {
49 if (hProcess)
50 {
52 }
53 }
54};
55
57{
63 bool m_Loop;
64
65public:
67
68 virtual ~CIconWatcher();
69
71 void Uninitialize();
72
75
77
78private:
79
80 static UINT WINAPI WatcherThread(_In_opt_ LPVOID lpParam);
81};
82
83class CNotifyToolbar;
84
86{
87public:
88 static const int TimerInterval = 2000;
89 static const int BalloonsTimerId = 1;
90 static const int MinTimeout = 10000;
91 static const int MaxTimeout = 30000;
92 static const int CooldownBetweenBalloons = 2000;
93
94private:
95 struct Info
96 {
102
104 {
105 pSource = source;
108 uIcon = source->dwInfoFlags & NIIF_ICON_MASK;
109 if (source->dwInfoFlags == NIIF_USER)
110 uIcon = reinterpret_cast<WPARAM>(source->hIcon);
111 uTimeout = source->uTimeout;
112 }
113 };
114
116
118
120
122
125
127
128public:
130
131 void Init(HWND hwndParent, CNotifyToolbar * toolbar, CTooltips * balloons);
132 void Deinit();
133
134 bool OnTimer(int timerId);
135 void UpdateInfo(InternalIconData * notifyItem);
136 void RemoveInfo(InternalIconData * notifyItem);
137 void CloseCurrent();
138
139private:
140
142 void SetTimer(int length);
143 void Show(Info& info);
144 void Close(IN OUT InternalIconData * notifyItem, IN UINT uReason);
145};
146
148 public CWindowImplBaseT< CToolbar<InternalIconData>, CControlWinTraits >
149{
152
154
155public:
157 virtual ~CNotifyToolbar();
158
167 bool SendNotifyCallback(InternalIconData* notifyItem, UINT uMsg);
168 void RefreshToolbarMetrics(BOOL bForceRefresh);
169
170private:
171 LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
174 LRESULT OnTooltipShow(INT uCode, LPNMHDR hdr, BOOL& bHandled);
175
176public:
182
184};
185
186
187static const WCHAR szSysPagerWndClass[] = L"SysPager";
188
193 public IOleWindow,
194 public CIconWatcher
195{
199
200public:
201 CSysPagerWnd();
202 virtual ~CSysPagerWnd();
203
205 LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
206 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
207 LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
208 LRESULT OnGetInfoTip(INT uCode, LPNMHDR hdr, BOOL& bHandled);
209 LRESULT OnCustomDraw(INT uCode, LPNMHDR hdr, BOOL& bHandled);
210 LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
211 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
212 LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
213 LRESULT OnBalloonPop(UINT uCode, LPNMHDR hdr, BOOL& bHandled);
214 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
216 LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
217 LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
218
219public:
220 // *** IOleWindow methods ***
221
223 GetWindow(HWND* phwnd) override
224 {
225 if (!phwnd)
226 return E_INVALIDARG;
227 *phwnd = m_hWnd;
228 return S_OK;
229 }
230
232 ContextSensitiveHelp(BOOL fEnterMode) override
233 {
234 return E_NOTIMPL;
235 }
236
238
243
244 BOOL NotifyIcon(DWORD dwMessage, _In_ CONST NOTIFYICONDATA *iconData);
245 void GetSize(IN BOOL IsHorizontal, IN PSIZE size);
246
248
252 MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
258 MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChanged)
259 MESSAGE_HANDLER(TNWM_GETMINIMUMSIZE, OnGetMinimumSize)
260 NOTIFY_CODE_HANDLER(TTN_POP, OnBalloonPop)
264
266};
267
268/*
269 * IconWatcher
270 */
271
273 m_hWatcherThread(NULL),
274 m_WakeUpEvent(NULL),
275 m_hwndSysTray(NULL),
276 m_Loop(false)
277{
278}
279
281{
282 Uninitialize();
283 DeleteCriticalSection(&m_ListLock);
284
285 if (m_WakeUpEvent)
286 CloseHandle(m_WakeUpEvent);
287 if (m_hWatcherThread)
288 CloseHandle(m_hWatcherThread);
289}
290
292{
293 m_hwndSysTray = hWndParent;
294
295 InitializeCriticalSection(&m_ListLock);
296 m_WakeUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
297 if (m_WakeUpEvent == NULL)
298 return false;
299
300 m_hWatcherThread = (HANDLE)_beginthreadex(NULL,
301 0,
302 WatcherThread,
303 (LPVOID)this,
304 0,
305 NULL);
306 if (m_hWatcherThread == NULL)
307 return false;
308
309 return true;
310}
311
313{
314 m_Loop = false;
315 if (m_WakeUpEvent)
316 SetEvent(m_WakeUpEvent);
317
318 EnterCriticalSection(&m_ListLock);
319
321 for (size_t i = 0; i < m_WatcherList.GetCount(); i++)
322 {
323 Pos = m_WatcherList.FindIndex(i);
324 if (Pos)
325 {
327 Icon = m_WatcherList.GetAt(Pos);
328 delete Icon;
329 }
330 }
331 m_WatcherList.RemoveAll();
332
333 LeaveCriticalSection(&m_ListLock);
334}
335
337{
339 (void)GetWindowThreadProcessId(iconData->hWnd, &ProcessId);
340
343 if (hProcess == NULL)
344 {
345 return false;
346 }
347
348 IconWatcherData *Icon = new IconWatcherData(iconData);
349 Icon->hProcess = hProcess;
350 Icon->ProcessId = ProcessId;
351
352 bool Added = false;
353 EnterCriticalSection(&m_ListLock);
354
355 // The likelyhood of someone having more than 64 icons in their tray is
356 // pretty slim. We could spin up a new thread for each multiple of 64, but
357 // it's not worth the effort, so we just won't bother watching those icons
358 if (m_WatcherList.GetCount() < MAXIMUM_WAIT_OBJECTS)
359 {
360 m_WatcherList.AddTail(Icon);
361 SetEvent(m_WakeUpEvent);
362 Added = true;
363 }
364
365 LeaveCriticalSection(&m_ListLock);
366
367 if (!Added)
368 {
369 delete Icon;
370 }
371
372 return Added;
373}
374
376{
377 EnterCriticalSection(&m_ListLock);
378
380 Icon = GetListEntry(iconData, NULL, true);
381
382 SetEvent(m_WakeUpEvent);
383 LeaveCriticalSection(&m_ListLock);
384
385 delete Icon;
386 return true;
387}
388
390{
392 POSITION NextPosition = m_WatcherList.GetHeadPosition();
394 do
395 {
396 Position = NextPosition;
397
398 Entry = m_WatcherList.GetNext(NextPosition);
399 if (Entry)
400 {
401 if ((iconData && ((Entry->IconData.hWnd == iconData->hWnd) && (Entry->IconData.uID == iconData->uID))) ||
402 (hProcess && (Entry->hProcess == hProcess)))
403 {
404 if (Remove)
405 m_WatcherList.RemoveAt(Position);
406 break;
407 }
408 }
409 Entry = NULL;
410
411 } while (NextPosition != NULL);
412
413 return Entry;
414}
415
417{
418 CIconWatcher* This = reinterpret_cast<CIconWatcher *>(lpParam);
419 HANDLE *WatchList = NULL;
420
421 This->m_Loop = true;
422 while (This->m_Loop)
423 {
424 EnterCriticalSection(&This->m_ListLock);
425
426 DWORD Size;
427 Size = This->m_WatcherList.GetCount() + 1;
429
430 if (WatchList)
431 delete[] WatchList;
432 WatchList = new HANDLE[Size];
433 WatchList[0] = This->m_WakeUpEvent;
434
436 for (size_t i = 0; i < This->m_WatcherList.GetCount(); i++)
437 {
438 Pos = This->m_WatcherList.FindIndex(i);
439 if (Pos)
440 {
442 Icon = This->m_WatcherList.GetAt(Pos);
443 WatchList[i + 1] = Icon->hProcess;
444 }
445 }
446
447 LeaveCriticalSection(&This->m_ListLock);
448
451 WatchList,
452 FALSE,
453 INFINITE);
454 if (Status == WAIT_OBJECT_0)
455 {
456 // We've been kicked, we have updates to our list (or we're exiting the thread)
457 if (This->m_Loop)
458 TRACE("Updating watched icon list\n");
459 }
460 else if ((Status >= WAIT_OBJECT_0 + 1) && (Status < Size))
461 {
463 Icon = This->GetListEntry(NULL, WatchList[Status], false);
464
465 TRACE("Pid %lu owns a notification icon and has stopped without deleting it. We'll cleanup on its behalf\n", Icon->ProcessId);
466
467 TRAYNOTIFYDATAW tnid = {0};
468 tnid.dwSignature = NI_NOTIFY_SIG;
469 tnid.dwMessage = NIM_DELETE;
470 CopyMemory(&tnid.nid, &Icon->IconData, Icon->IconData.cbSize);
471
473 data.dwData = 1;
474 data.cbData = sizeof(tnid);
475 data.lpData = &tnid;
476
477 BOOL Success = ::SendMessage(This->m_hwndSysTray, WM_COPYDATA,
478 (WPARAM)&Icon->IconData, (LPARAM)&data);
479 if (!Success)
480 {
481 // If we failed to handle the delete message, forcibly remove it
482 This->RemoveIconFromWatcher(&Icon->IconData);
483 }
484 }
485 else
486 {
487 if (Status == WAIT_FAILED)
488 {
490 }
491 ERR("Failed to wait on process handles : %lu\n", Status);
492 This->Uninitialize();
493 }
494 }
495
496 if (WatchList)
497 delete[] WatchList;
498
499 return 0;
500}
501
502/*
503 * BalloonQueue
504 */
505
507 m_hwndParent(NULL),
508 m_tooltips(NULL),
509 m_toolbar(NULL),
510 m_current(NULL),
511 m_currentClosed(false),
512 m_timer(-1)
513{
514}
515
517{
519 m_toolbar = toolbar;
520 m_tooltips = balloons;
521}
522
524{
525 if (m_timer >= 0)
526 {
528 }
529}
530
531bool CBalloonQueue::OnTimer(int timerId)
532{
533 if (timerId != m_timer)
534 return false;
535
537 m_timer = -1;
538
540 {
541 Close(m_current, NIN_BALLOONTIMEOUT);
542 }
543 else
544 {
545 m_current = NULL;
546 m_currentClosed = false;
547 if (!m_queue.IsEmpty())
548 {
549 Info info = m_queue.RemoveHead();
550 Show(info);
551 }
552 }
553
554 return true;
555}
556
558{
559 size_t len = 0;
560 HRESULT hr = StringCchLength(notifyItem->szInfo, _countof(notifyItem->szInfo), &len);
561 if (SUCCEEDED(hr) && len > 0)
562 {
563 Info info(notifyItem);
564
565 // If m_current == notifyItem, we want to replace the previous balloon even if there is a queue.
566 if (m_current != notifyItem && (m_current != NULL || !m_queue.IsEmpty()))
567 {
568 m_queue.AddTail(info);
569 }
570 else
571 {
572 Show(info);
573 }
574 }
575 else
576 {
577 Close(notifyItem, NIN_BALLOONHIDE);
578 }
579}
580
582{
583 Close(notifyItem, NIN_BALLOONHIDE);
584
585 POSITION position = m_queue.GetHeadPosition();
586 while(position != NULL)
587 {
588 Info& info = m_queue.GetNext(position);
589 if (info.pSource == notifyItem)
590 {
591 m_queue.RemoveAt(position);
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);
630 const WORD x = (rc.left + rc.right) / 2;
631 const WORD y = (rc.top + rc.bottom) / 2;
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 && !m_currentClosed)
653 {
655
656 // Prevent Re-entry
657 m_currentClosed = true;
660 }
661}
662
663/*
664 * NotifyToolbar
665 */
666
668 m_ImageList(NULL),
669 m_VisibleButtonCount(0),
670 m_BalloonQueue(NULL)
671{
672}
673
675{
676}
677
679{
681}
682
684{
685 int count = GetButtonCount();
686
687 for (int i = 0; i < count; i++)
688 {
689 InternalIconData * data = GetItemData(i);
690
691 if (data->hWnd == hWnd &&
692 data->uID == uID)
693 {
694 if (pdata)
695 *pdata = data;
696 return i;
697 }
698 }
699
700 return -1;
701}
702
704{
705 int count = GetButtonCount();
706 for (int i = 0; i < count; i++)
707 {
708 InternalIconData * data = GetItemData(i);
709 if (data->hIcon == handle)
710 {
711 TBBUTTON btn;
712 GetButton(i, &btn);
713 return btn.iBitmap;
714 }
715 }
716
717 return -1;
718}
719
721{
722 TBBUTTON tbBtn = { 0 };
723 InternalIconData * notifyItem;
724 WCHAR text[] = L"";
725
726 TRACE("Adding icon %d from hWnd %08x flags%s%s state%s%s\n",
727 iconData->uID, iconData->hWnd,
728 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
729 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
730 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
731 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
732
733 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
734 if (index >= 0)
735 {
736 TRACE("Icon %d from hWnd %08x ALREADY EXISTS!\n", iconData->uID, iconData->hWnd);
737 return FALSE;
738 }
739
740 notifyItem = new InternalIconData();
741 ZeroMemory(notifyItem, sizeof(*notifyItem));
742
743 notifyItem->hWnd = iconData->hWnd;
744 notifyItem->uID = iconData->uID;
745
746 tbBtn.fsState = TBSTATE_ENABLED;
747 tbBtn.fsStyle = BTNS_NOPREFIX;
748 tbBtn.dwData = (DWORD_PTR)notifyItem;
749 tbBtn.iString = (INT_PTR) text;
750 tbBtn.idCommand = GetButtonCount();
751 tbBtn.iBitmap = -1;
752
753 if (iconData->uFlags & NIF_STATE)
754 {
755 notifyItem->dwState = iconData->dwState & iconData->dwStateMask;
756 }
757
758 if (iconData->uFlags & NIF_MESSAGE)
759 {
760 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
761 }
762
763 if (iconData->uFlags & NIF_ICON)
764 {
765 notifyItem->hIcon = iconData->hIcon;
766 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
767 if (hasSharedIcon)
768 {
769 INT iIcon = FindExistingSharedIcon(notifyItem->hIcon);
770 if (iIcon < 0)
771 {
772 notifyItem->hIcon = NULL;
773 TRACE("Shared icon requested, but HICON not found!!!\n");
774 }
775 tbBtn.iBitmap = iIcon;
776 }
777 else
778 {
779 tbBtn.iBitmap = ImageList_AddIcon(m_ImageList, notifyItem->hIcon);
780 }
781 }
782
783 if (iconData->uFlags & NIF_TIP)
784 {
785 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
786 }
787
788 if (iconData->uFlags & NIF_INFO)
789 {
790 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
791 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
792 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
793 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
794 notifyItem->uTimeout = iconData->uTimeout;
795 }
796
797 if (notifyItem->dwState & NIS_HIDDEN)
798 {
799 tbBtn.fsState |= TBSTATE_HIDDEN;
800 }
801 else
802 {
804 }
805
806 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
807
808 CToolbar::AddButton(&tbBtn);
810
811 if (iconData->uFlags & NIF_INFO)
812 {
813 m_BalloonQueue->UpdateInfo(notifyItem);
814 }
815
816 return TRUE;
817}
818
820{
821 InternalIconData * notifyItem;
822 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
823 if (index < 0)
824 {
825 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
826 return FALSE;
827 }
828
829 if (iconData->uVersion != 0 && iconData->uVersion != NOTIFYICON_VERSION)
830 {
831 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);
832 return FALSE;
833 }
834
835 // We can not store the version in the uVersion field, because it's union'd with uTimeout,
836 // which we also need to keep track of.
837 notifyItem->uVersionCopy = iconData->uVersion;
838
839 return TRUE;
840}
841
843{
844 InternalIconData * notifyItem;
845 TBBUTTONINFO tbbi = { 0 };
846
847 TRACE("Updating icon %d from hWnd %08x flags%s%s state%s%s\n",
848 iconData->uID, iconData->hWnd,
849 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
850 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
851 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
852 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
853
854 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
855 if (index < 0)
856 {
857 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
858 return AddButton(iconData);
859 }
860
861 TBBUTTON btn;
862 GetButton(index, &btn);
863 int oldIconIndex = btn.iBitmap;
864
865 tbbi.cbSize = sizeof(tbbi);
866 tbbi.dwMask = TBIF_BYINDEX | TBIF_COMMAND;
867 tbbi.idCommand = index;
868
869 if (iconData->uFlags & NIF_STATE)
870 {
871 if (iconData->dwStateMask & NIS_HIDDEN &&
872 (notifyItem->dwState & NIS_HIDDEN) != (iconData->dwState & NIS_HIDDEN))
873 {
874 tbbi.dwMask |= TBIF_STATE;
875 if (iconData->dwState & NIS_HIDDEN)
876 {
877 tbbi.fsState |= TBSTATE_HIDDEN;
879 }
880 else
881 {
882 tbbi.fsState &= ~TBSTATE_HIDDEN;
884 }
885 }
886
887 notifyItem->dwState &= ~iconData->dwStateMask;
888 notifyItem->dwState |= (iconData->dwState & iconData->dwStateMask);
889 }
890
891 if (iconData->uFlags & NIF_MESSAGE)
892 {
893 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
894 }
895
896 if (iconData->uFlags & NIF_ICON)
897 {
898 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
899 if (hasSharedIcon)
900 {
901 INT iIcon = FindExistingSharedIcon(iconData->hIcon);
902 if (iIcon >= 0)
903 {
904 notifyItem->hIcon = iconData->hIcon;
905 tbbi.dwMask |= TBIF_IMAGE;
906 tbbi.iImage = iIcon;
907 }
908 else
909 {
910 TRACE("Shared icon requested, but HICON not found!!! IGNORING!\n");
911 }
912 }
913 else
914 {
915 notifyItem->hIcon = iconData->hIcon;
916 tbbi.dwMask |= TBIF_IMAGE;
917 tbbi.iImage = ImageList_ReplaceIcon(m_ImageList, oldIconIndex, notifyItem->hIcon);
918 }
919 }
920
921 if (iconData->uFlags & NIF_TIP)
922 {
923 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
924 }
925
926 if (iconData->uFlags & NIF_INFO)
927 {
928 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
929 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
930 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
931 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
932 notifyItem->uTimeout = iconData->uTimeout;
933 }
934
935 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
936
937 SetButtonInfo(index, &tbbi);
938
939 if (iconData->uFlags & NIF_INFO)
940 {
941 m_BalloonQueue->UpdateInfo(notifyItem);
942 }
943
944 return TRUE;
945}
946
948{
949 InternalIconData * notifyItem;
950
951 TRACE("Removing icon %d from hWnd %08x\n", iconData->uID, iconData->hWnd);
952
953 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
954 if (index < 0)
955 {
956 TRACE("Icon %d from hWnd %08x ALREADY MISSING!\n", iconData->uID, iconData->hWnd);
957
958 return FALSE;
959 }
960
961 if (!(notifyItem->dwState & NIS_HIDDEN))
962 {
964 }
965
966 if (!(notifyItem->dwState & NIS_SHAREDICON))
967 {
968 TBBUTTON btn;
969 GetButton(index, &btn);
970 int oldIconIndex = btn.iBitmap;
971 ImageList_Remove(m_ImageList, oldIconIndex);
972
973 // Update other icons!
974 int count = GetButtonCount();
975 for (int i = 0; i < count; i++)
976 {
977 TBBUTTON btn;
978 GetButton(i, &btn);
979
980 if (btn.iBitmap > oldIconIndex)
981 {
982 TBBUTTONINFO tbbi2 = { 0 };
983 tbbi2.cbSize = sizeof(tbbi2);
984 tbbi2.dwMask = TBIF_BYINDEX | TBIF_IMAGE;
985 tbbi2.iImage = btn.iBitmap-1;
986 SetButtonInfo(i, &tbbi2);
987 }
988 }
989 }
990
991 m_BalloonQueue->RemoveInfo(notifyItem);
992
993 DeleteButton(index);
994
995 delete notifyItem;
996
997 return TRUE;
998}
999
1001{
1002 int cx, cy;
1003 HIMAGELIST iml;
1004
1006 return;
1007
1009 return;
1010
1012 if (!iml)
1013 return;
1014
1016 m_ImageList = iml;
1018
1019 int count = GetButtonCount();
1020 for (int i = 0; i < count; i++)
1021 {
1022 InternalIconData * data = GetItemData(i);
1023 BOOL hasSharedIcon = data->dwState & NIS_SHAREDICON;
1024 INT iIcon = hasSharedIcon ? FindExistingSharedIcon(data->hIcon) : -1;
1025 if (iIcon < 0)
1026 iIcon = ImageList_AddIcon(iml, data->hIcon);
1027 TBBUTTONINFO tbbi = { sizeof(tbbi), TBIF_BYINDEX | TBIF_IMAGE, 0, iIcon};
1028 SetButtonInfo(i, &tbbi);
1029 }
1030
1032}
1033
1035{
1036 bHandled = FALSE;
1037
1038 /*
1039 * WM_CONTEXTMENU message can be generated either by the mouse,
1040 * in which case lParam encodes the mouse coordinates where the
1041 * user right-clicked the mouse, or can be generated by (Shift-)F10
1042 * keyboard press, in which case lParam equals -1.
1043 */
1044 INT iBtn = GetHotItem();
1045 if (iBtn < 0)
1046 return 0;
1047
1048 InternalIconData* notifyItem = GetItemData(iBtn);
1049
1050 if (!::IsWindow(notifyItem->hWnd))
1051 return 0;
1052
1053 if (notifyItem->uVersionCopy >= NOTIFYICON_VERSION)
1054 {
1055 /* Transmit the WM_CONTEXTMENU message if the notification icon supports it */
1056 ::SendNotifyMessage(notifyItem->hWnd,
1057 notifyItem->uCallbackMessage,
1058 notifyItem->uID,
1060 }
1061 else if (lParam == -1)
1062 {
1063 /*
1064 * Otherwise, and only if the WM_CONTEXTMENU message was generated
1065 * from the keyboard, simulate right-click mouse messages. This is
1066 * not needed if the message came from the mouse because in this
1067 * case the right-click mouse messages were already sent together.
1068 */
1069 ::SendNotifyMessage(notifyItem->hWnd,
1070 notifyItem->uCallbackMessage,
1071 notifyItem->uID,
1073 ::SendNotifyMessage(notifyItem->hWnd,
1074 notifyItem->uCallbackMessage,
1075 notifyItem->uID,
1076 WM_RBUTTONUP);
1077 }
1078
1079 return 0;
1080}
1081
1083{
1084 if (!::IsWindow(notifyItem->hWnd))
1085 {
1086 // We detect and destroy icons with invalid handles only on mouse move over systray, same as MS does.
1087 // Alternatively we could search for them periodically (would waste more resources).
1088 TRACE("Destroying icon %d with invalid handle hWnd=%08x\n", notifyItem->uID, notifyItem->hWnd);
1089
1090 RemoveButton(notifyItem);
1091
1092 /* Ask the parent to resize */
1093 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
1094 GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
1095
1096 return true;
1097 }
1098
1099 DWORD pid;
1100 GetWindowThreadProcessId(notifyItem->hWnd, &pid);
1101
1102 if (pid == GetCurrentProcessId() ||
1103 (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST))
1104 {
1105 ::PostMessage(notifyItem->hWnd,
1106 notifyItem->uCallbackMessage,
1107 notifyItem->uID,
1108 uMsg);
1109 }
1110 else
1111 {
1112 ::SendMessage(notifyItem->hWnd,
1113 notifyItem->uCallbackMessage,
1114 notifyItem->uID,
1115 uMsg);
1116 }
1117 return false;
1118}
1119
1121{
1122 static LPCWSTR eventNames [] = {
1123 L"WM_MOUSEMOVE",
1124 L"WM_LBUTTONDOWN",
1125 L"WM_LBUTTONUP",
1126 L"WM_LBUTTONDBLCLK",
1127 L"WM_RBUTTONDOWN",
1128 L"WM_RBUTTONUP",
1129 L"WM_RBUTTONDBLCLK",
1130 L"WM_MBUTTONDOWN",
1131 L"WM_MBUTTONUP",
1132 L"WM_MBUTTONDBLCLK",
1133 L"WM_MOUSEWHEEL",
1134 L"WM_XBUTTONDOWN",
1135 L"WM_XBUTTONUP",
1136 L"WM_XBUTTONDBLCLK"
1137 };
1138
1139 InternalIconData * notifyItem = GetItemData(wIndex);
1140
1141 if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
1142 {
1143 TRACE("Sending message %S from button %d to %p (msg=%x, w=%x, l=%x)...\n",
1144 eventNames[uMsg - WM_MOUSEFIRST], wIndex,
1145 notifyItem->hWnd, notifyItem->uCallbackMessage, notifyItem->uID, uMsg);
1146 }
1147
1148 SendNotifyCallback(notifyItem, uMsg);
1149}
1150
1152{
1154 INT iBtn = HitTest(&pt);
1155
1156 if (iBtn >= 0)
1157 {
1158 SendMouseEvent(iBtn, uMsg, wParam);
1159 }
1160
1161 bHandled = FALSE;
1162 return FALSE;
1163}
1164
1166{
1167 InternalIconData * notifyItem = reinterpret_cast<InternalIconData *>(data);
1168 if (notifyItem)
1169 {
1170 StringCchCopy(szTip, cchTip, notifyItem->szTip);
1171 }
1172 else
1173 {
1174 StringCchCopy(szTip, cchTip, L"");
1175 }
1176}
1177
1179{
1180 RECT rcTip, rcItem;
1181 ::GetWindowRect(hdr->hwndFrom, &rcTip);
1182
1183 SIZE szTip = { rcTip.right - rcTip.left, rcTip.bottom - rcTip.top };
1184
1185 INT iBtn = GetHotItem();
1186
1187 if (iBtn >= 0)
1188 {
1189 MONITORINFO monInfo = { 0 };
1190 HMONITOR hMon = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
1191
1192 monInfo.cbSize = sizeof(monInfo);
1193
1194 if (hMon)
1195 GetMonitorInfo(hMon, &monInfo);
1196 else
1197 ::GetWindowRect(GetDesktopWindow(), &monInfo.rcMonitor);
1198
1199 GetItemRect(iBtn, &rcItem);
1200
1201 POINT ptItem = { rcItem.left, rcItem.top };
1202 SIZE szItem = { rcItem.right - rcItem.left, rcItem.bottom - rcItem.top };
1203 ClientToScreen(&ptItem);
1204
1205 ptItem.x += szItem.cx / 2;
1206 ptItem.y -= szTip.cy;
1207
1208 if (ptItem.x + szTip.cx > monInfo.rcMonitor.right)
1209 ptItem.x = monInfo.rcMonitor.right - szTip.cx;
1210
1211 if (ptItem.y + szTip.cy > monInfo.rcMonitor.bottom)
1212 ptItem.y = monInfo.rcMonitor.bottom - szTip.cy;
1213
1214 if (ptItem.x < monInfo.rcMonitor.left)
1215 ptItem.x = monInfo.rcMonitor.left;
1216
1217 if (ptItem.y < monInfo.rcMonitor.top)
1218 ptItem.y = monInfo.rcMonitor.top;
1219
1220 TRACE("ptItem { %d, %d }\n", ptItem.x, ptItem.y);
1221
1222 ::SetWindowPos(hdr->hwndFrom, NULL, ptItem.x, ptItem.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
1223
1224 return TRUE;
1225 }
1226
1227 bHandled = FALSE;
1228 return 0;
1229}
1230
1232{
1234
1235 DWORD styles =
1239
1240 // HACK & FIXME: CORE-18016
1242 m_hWnd = NULL;
1244
1245 // Force the toolbar tooltips window to always show tooltips even if not foreground
1246 HWND tooltipsWnd = (HWND)SendMessageW(TB_GETTOOLTIPS);
1247 if (tooltipsWnd)
1248 {
1249 ::SetWindowLong(tooltipsWnd, GWL_STYLE, ::GetWindowLong(tooltipsWnd, GWL_STYLE) | TTS_ALWAYSTIP);
1250 }
1251
1252 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
1253
1256
1258
1260}
1261
1263{
1264 // Toolbar metrics only needs to be refreshed for the automatic setting and first launch
1265 if (g_TaskbarSettings.eCompactTrayIcons == TrayIconsMode::TIM_Default ||
1266 bForceRefresh)
1267 {
1268 TBMETRICS tbm = {sizeof(tbm)};
1270 tbm.cxPad = 1;
1271 tbm.cyPad = 1;
1273 {
1276 }
1277 tbm.cxBarPad = 1;
1278 tbm.cyBarPad = 1;
1279 tbm.cxButtonSpacing = 1;
1280 tbm.cyButtonSpacing = 1;
1281 SetMetrics(&tbm);
1282 }
1283}
1284
1285/*
1286 * SysPagerWnd
1287 */
1288
1290
1292
1294{
1295 HDC hdc = (HDC) wParam;
1296
1297 if (!IsAppThemed())
1298 {
1299 bHandled = FALSE;
1300 return 0;
1301 }
1302
1303 RECT rect;
1306
1307 return TRUE;
1308}
1309
1311{
1314
1315 HWND hWndTop = GetAncestor(m_hWnd, GA_ROOT);
1316
1318
1319 TOOLINFOW ti = { 0 };
1320 ti.cbSize = TTTOOLINFOW_V1_SIZE;
1321 ti.uFlags = TTF_TRACK | TTF_IDISHWND;
1322 ti.uId = reinterpret_cast<UINT_PTR>(Toolbar.m_hWnd);
1323 ti.hwnd = m_hWnd;
1324 ti.lpszText = NULL;
1325 ti.lParam = NULL;
1326
1327 BOOL ret = m_Balloons.AddTool(&ti);
1328 if (!ret)
1329 {
1330 WARN("AddTool failed, LastError=%d (probably meaningless unless non-zero)\n", GetLastError());
1331 }
1332
1334
1335 // Explicitly request running applications to re-register their systray icons
1337 RegisterWindowMessageW(L"TaskbarCreated"),
1338 0, 0);
1339
1340 return TRUE;
1341}
1342
1344{
1347 return TRUE;
1348}
1349
1351{
1352 BOOL ret = FALSE;
1353
1354 int VisibleButtonCount = Toolbar.GetVisibleButtonCount();
1355
1356 TRACE("NotifyIcon received. Code=%d\n", dwMessage);
1357 switch (dwMessage)
1358 {
1359 case NIM_ADD:
1360 ret = Toolbar.AddButton(iconData);
1361 if (ret == TRUE)
1362 {
1363 (void)AddIconToWatcher(iconData);
1364 }
1365 break;
1366
1367 case NIM_MODIFY:
1368 ret = Toolbar.UpdateButton(iconData);
1369 break;
1370
1371 case NIM_DELETE:
1372 ret = Toolbar.RemoveButton(iconData);
1373 if (ret == TRUE)
1374 {
1375 (void)RemoveIconFromWatcher(iconData);
1376 }
1377 break;
1378
1379 case NIM_SETFOCUS:
1380 Toolbar.SetFocus();
1381 ret = TRUE;
1382 break;
1383
1384 case NIM_SETVERSION:
1385 ret = Toolbar.SwitchVersion(iconData);
1386 break;
1387
1388 default:
1389 TRACE("NotifyIcon received with unknown code %d.\n", dwMessage);
1390 return FALSE;
1391 }
1392
1393 if (VisibleButtonCount != Toolbar.GetVisibleButtonCount())
1394 {
1395 /* Ask the parent to resize */
1396 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
1397 GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
1398 }
1399
1400 return ret;
1401}
1402
1404{
1405 /* Get the ideal height or width */
1406#if 0
1407 /* Unfortunately this doens't work correctly in ros */
1408 Toolbar.GetIdealSize(!IsHorizontal, size);
1409
1410 /* Make the reference dimension an exact multiple of the icon size */
1411 if (IsHorizontal)
1412 size->cy -= size->cy % GetSystemMetrics(SM_CYSMICON);
1413 else
1414 size->cx -= size->cx % GetSystemMetrics(SM_CXSMICON);
1415
1416#else
1417 INT rows = 0;
1418 INT columns = 0;
1419 INT cyButton = GetSystemMetrics(SM_CYSMICON) + 2;
1420 INT cxButton = GetSystemMetrics(SM_CXSMICON) + 2;
1422 {
1423 cyButton = MulDiv(GetSystemMetrics(SM_CYSMICON), 3, 2);
1424 cxButton = MulDiv(GetSystemMetrics(SM_CXSMICON), 3, 2);
1425 }
1426 int VisibleButtonCount = Toolbar.GetVisibleButtonCount();
1427
1428 if (IsHorizontal)
1429 {
1431 rows = max(size->cy / MulDiv(cyButton, 3, 2), 1);
1432 else
1433 rows = max(size->cy / cyButton, 1);
1434 columns = (VisibleButtonCount + rows - 1) / rows;
1435 }
1436 else
1437 {
1438 columns = max(size->cx / cxButton, 1);
1439 rows = (VisibleButtonCount + columns - 1) / columns;
1440 }
1441 size->cx = columns * cxButton;
1442 size->cy = rows * cyButton;
1443#endif
1444}
1445
1447{
1448 NMTBGETINFOTIPW * nmtip = (NMTBGETINFOTIPW *) hdr;
1449 GetTooltipText(nmtip->lParam, nmtip->pszText, nmtip->cchTextMax);
1450 return TRUE;
1451}
1452
1454{
1455 NMCUSTOMDRAW * cdraw = (NMCUSTOMDRAW *) hdr;
1456 switch (cdraw->dwDrawStage)
1457 {
1458 case CDDS_PREPAINT:
1459 return CDRF_NOTIFYITEMDRAW;
1460
1461 case CDDS_ITEMPREPAINT:
1463 }
1464 return TRUE;
1465}
1466
1468{
1469 bHandled = FALSE;
1470
1471 /* Handles the BN_CLICKED notifications sent by the CNotifyToolbar member */
1472 if (HIWORD(wParam) != BN_CLICKED)
1473 return 0;
1474
1475 INT iBtn = LOWORD(wParam);
1476 if (iBtn < 0)
1477 return 0;
1478
1479 InternalIconData* notifyItem = Toolbar.GetItemData(iBtn);
1480
1481 if (!::IsWindow(notifyItem->hWnd))
1482 return 0;
1483
1484 // TODO: Improve keyboard handling by looking whether one presses
1485 // on ENTER, etc..., which roughly translates into "double-clicking".
1486
1487 if (notifyItem->uVersionCopy >= NOTIFYICON_VERSION)
1488 {
1489 /* Use new-style notifications if the notification icon supports them */
1490 ::SendNotifyMessage(notifyItem->hWnd,
1491 notifyItem->uCallbackMessage,
1492 notifyItem->uID,
1493 NIN_SELECT); // TODO: Distinguish with NIN_KEYSELECT
1494 }
1495 else if (lParam == -1)
1496 {
1497 /*
1498 * Otherwise, and only if the icon was selected via the keyboard,
1499 * simulate right-click mouse messages. This is not needed if the
1500 * selection was done by mouse because in this case the mouse
1501 * messages were already sent.
1502 */
1503 ::SendNotifyMessage(notifyItem->hWnd,
1504 notifyItem->uCallbackMessage,
1505 notifyItem->uID,
1506 WM_LBUTTONDOWN); // TODO: Distinguish with double-click WM_LBUTTONDBLCLK
1507 ::SendNotifyMessage(notifyItem->hWnd,
1508 notifyItem->uCallbackMessage,
1509 notifyItem->uID,
1510 WM_LBUTTONUP);
1511 }
1512
1513 return 0;
1514}
1515
1517{
1518 LRESULT Ret = TRUE;
1519 SIZE szClient;
1520 szClient.cx = LOWORD(lParam);
1521 szClient.cy = HIWORD(lParam);
1522
1523 Ret = DefWindowProc(uMsg, wParam, lParam);
1524
1525 if (Toolbar)
1526 {
1527 Toolbar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1528 Toolbar.AutoSize();
1529
1530 RECT rc;
1532
1533 SIZE szBar = { rc.right - rc.left, rc.bottom - rc.top };
1534
1535 INT xOff = (szClient.cx - szBar.cx) / 2;
1536 INT yOff = (szClient.cy - szBar.cy) / 2;
1537
1538 Toolbar.SetWindowPos(NULL, xOff, yOff, szBar.cx, szBar.cy, SWP_NOZORDER);
1540 }
1541 return Ret;
1542}
1543
1545{
1546 bHandled = TRUE;
1547 return 0;
1548}
1549
1551{
1553 bHandled = TRUE;
1554 return 0;
1555}
1556
1558{
1560 {
1561 bHandled = TRUE;
1562 }
1563
1564 return 0;
1565}
1566
1568{
1570 if (cpData->dwData == TABDMC_NOTIFY)
1571 {
1572 /* A taskbar NotifyIcon notification */
1573 PTRAYNOTIFYDATAW pData = (PTRAYNOTIFYDATAW)cpData->lpData;
1574 if (pData->dwSignature == NI_NOTIFY_SIG)
1575 return NotifyIcon(pData->dwMessage, &pData->nid);
1576 }
1577 else if (cpData->dwData == TABDMC_LOADINPROC)
1578 {
1579 FIXME("Taskbar Load In Proc\n");
1580 }
1581
1582 return FALSE;
1583}
1584
1586{
1587 if (wParam == SPI_SETNONCLIENTMETRICS)
1588 {
1590 }
1591 return 0;
1592}
1593
1595{
1597 return 0;
1598}
1599
1601{
1602 /* Create the window. The tray window is going to move it to the correct
1603 position and resize it as needed. */
1605 Create(hWndParent, 0, NULL, dwStyle);
1606 if (!m_hWnd)
1607 return E_FAIL;
1608
1609 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
1610
1611 return S_OK;
1612}
1613
1615{
1616 return ShellObjectCreatorInit<CSysPagerWnd>(hwndParent, riid, ppv);
1617}
static BOOL OnCopyData(HWND hwnd, HWND hwndSender, COPYDATASTRUCT *pCopyData)
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:371
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define NTNWM_REALIGN
Definition: precomp.h:375
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:90
HWND m_hwndParent
Definition: syspager.cpp:115
static const int CooldownBetweenBalloons
Definition: syspager.cpp:92
CTooltips * m_tooltips
Definition: syspager.cpp:117
CNotifyToolbar * m_toolbar
Definition: syspager.cpp:121
void RemoveInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:581
void Deinit()
Definition: syspager.cpp:523
bool m_currentClosed
Definition: syspager.cpp:124
InternalIconData * m_current
Definition: syspager.cpp:123
static const int TimerInterval
Definition: syspager.cpp:88
void SetTimer(int length)
Definition: syspager.cpp:615
void UpdateInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:557
void Init(HWND hwndParent, CNotifyToolbar *toolbar, CTooltips *balloons)
Definition: syspager.cpp:516
CAtlList< Info > m_queue
Definition: syspager.cpp:119
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:91
int IndexOf(InternalIconData *pdata)
Definition: syspager.cpp:604
static const int BalloonsTimerId
Definition: syspager.cpp:89
bool OnTimer(int timerId)
Definition: syspager.cpp:531
HWND m_hwndSysTray
Definition: syspager.cpp:62
bool RemoveIconFromWatcher(_In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:375
bool AddIconToWatcher(_In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:336
virtual ~CIconWatcher()
Definition: syspager.cpp:280
CRITICAL_SECTION m_ListLock
Definition: syspager.cpp:59
bool Initialize(_In_ HWND hWndParent)
Definition: syspager.cpp:291
HANDLE m_WakeUpEvent
Definition: syspager.cpp:61
IconWatcherData * GetListEntry(_In_opt_ CONST NOTIFYICONDATA *iconData, _In_opt_ HANDLE hProcess, _In_ bool Remove)
Definition: syspager.cpp:389
static UINT WINAPI WatcherThread(_In_opt_ LPVOID lpParam)
Definition: syspager.cpp:416
CAtlList< IconWatcherData * > m_WatcherList
Definition: syspager.cpp:58
void Uninitialize()
Definition: syspager.cpp:312
HANDLE m_hWatcherThread
Definition: syspager.cpp:60
BOOL RemoveButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:947
BOOL UpdateButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:842
HIMAGELIST m_ImageList
Definition: syspager.cpp:150
int GetVisibleButtonCount()
Definition: syspager.cpp:678
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1151
int FindItem(IN HWND hWnd, IN UINT uID, InternalIconData **pdata)
Definition: syspager.cpp:683
int FindExistingSharedIcon(HICON handle)
Definition: syspager.cpp:703
bool SendNotifyCallback(InternalIconData *notifyItem, UINT uMsg)
Definition: syspager.cpp:1082
BOOL AddButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:720
LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1034
virtual ~CNotifyToolbar()
Definition: syspager.cpp:674
VOID ResizeImagelist()
Definition: syspager.cpp:1000
void Initialize(HWND hWndParent, CBalloonQueue *queue)
Definition: syspager.cpp:1231
BOOL SwitchVersion(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:819
CBalloonQueue * m_BalloonQueue
Definition: syspager.cpp:153
void RefreshToolbarMetrics(BOOL bForceRefresh)
Definition: syspager.cpp:1262
int m_VisibleButtonCount
Definition: syspager.cpp:151
VOID SendMouseEvent(IN WORD wIndex, IN UINT uMsg, IN WPARAM wParam)
Definition: syspager.cpp:1120
LRESULT OnTooltipShow(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1178
virtual ~CSysPagerWnd()
Definition: syspager.cpp:1291
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1467
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: syspager.cpp:232
void GetSize(IN BOOL IsHorizontal, IN PSIZE size)
Definition: syspager.cpp:1403
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1594
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1557
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1343
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1567
LRESULT OnCustomDraw(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1453
CNotifyToolbar Toolbar
Definition: syspager.cpp:196
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1585
BOOL NotifyIcon(DWORD dwMessage, _In_ CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:1350
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1310
HRESULT Initialize(IN HWND hWndParent)
Definition: syspager.cpp:1600
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1516
LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1544
LRESULT DrawBackground(HDC hdc)
CTooltips m_Balloons
Definition: syspager.cpp:197
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: syspager.cpp:1293
LRESULT OnBalloonPop(UINT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1550
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: syspager.cpp:223
LRESULT OnGetInfoTip(INT uCode, LPNMHDR hdr, BOOL &bHandled)
Definition: syspager.cpp:1446
CBalloonQueue m_BalloonQueue
Definition: syspager.cpp:198
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:793
BOOL AddTool(IN CONST TTTOOLINFOW *pInfo)
Definition: rosctrls.h:637
VOID TrackDeactivate()
Definition: rosctrls.h:723
VOID UpdateTipText(IN HWND hwndToolOwner, IN UINT uId, IN PCWSTR szText, IN HINSTANCE hinstResourceOwner=NULL)
Definition: rosctrls.h:685
BOOL SetTitle(PCWSTR szTitleText, WPARAM icon=0)
Definition: rosctrls.h:710
VOID TrackActivate(IN HWND hwndToolOwner, IN UINT uId)
Definition: rosctrls.h:715
HWND Create(HWND hWndParent, DWORD dwStyles=WS_POPUP|TTS_NOPREFIX, DWORD dwExStyles=WS_EX_TOPMOST)
Definition: rosctrls.h:616
VOID TrackPosition(IN WORD x, IN WORD y)
Definition: rosctrls.h:728
Definition: _queue.h:67
static int OnCommand(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: clipbrd.c:202
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
DWORD WINAPI GetSize(LPVOID)
static HWND hwndParent
Definition: cryptui.c:300
#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:2604
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2815
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:935
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:808
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2044
#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:1227
const WCHAR * text
Definition: package.c:1794
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
BOOL WINAPI IsAppThemed(void)
Definition: system.c:611
#define pt(x, y)
Definition: drawing.c:79
#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:470
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
Status
Definition: gdiplustypes.h:25
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
GLenum GLsizei len
Definition: glext.h:6722
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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
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 ASSERT(a)
Definition: mode.c:44
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:158
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
BOOL OnCreate(HWND hWnd)
Definition: msconfig.c:83
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)
unsigned int UINT
Definition: ndis.h:50
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define SYNCHRONIZE
Definition: nt_native.h:61
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IOleWindow
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define CONST
Definition: pedump.c:81
#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 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
#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
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
#define NIM_DELETE
Definition: shellapi.h:97
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:702
#define NIM_MODIFY
Definition: shellapi.h:96
#define NIF_ICON
Definition: shellapi.h:107
#define NIF_MESSAGE
Definition: shellapi.h:106
#define NIM_ADD
Definition: shellapi.h:95
#define NIF_TIP
Definition: shellapi.h:108
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
#define false
Definition: stdbool.h:37
#define StringCchCopy
Definition: strsafe.h:139
#define StringCchLength
Definition: strsafe.h:829
Info(InternalIconData *source)
Definition: syspager.cpp:103
WCHAR szInfo[256]
Definition: syspager.cpp:98
WCHAR szInfoTitle[64]
Definition: syspager.cpp:99
InternalIconData * pSource
Definition: syspager.cpp:97
base of all file and directory entries
Definition: entries.h:83
IconWatcherData(CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:38
HANDLE hProcess
Definition: syspager.cpp:34
NOTIFYICONDATA IconData
Definition: syspager.cpp:36
Definition: globals.h:96
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:224
BOOL UseCompactTrayIcons()
Definition: precomp.h:230
CHAR szInfoTitle[64]
Definition: shellapi.h:246
CHAR szInfo[256]
Definition: shellapi.h:241
UINT uCallbackMessage
Definition: shellapi.h:232
DWORD dwInfoFlags
Definition: shellapi.h:247
CHAR szTip[128]
Definition: shellapi.h:238
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
ULONG_PTR dwData
Definition: winuser.h:3004
RECT rcMonitor
Definition: winuser.h:3788
DWORD cbSize
Definition: winuser.h:3787
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
Definition: dhcpd.h:245
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:751
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1614
static VOID GetTooltipText(LPARAM data, LPTSTR szTip, DWORD cchTip)
Definition: syspager.cpp:1165
#define BALLOON_MAXWIDTH
Definition: syspager.cpp:24
static const WCHAR szSysPagerWndClass[]
Definition: syspager.cpp:187
#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
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:928
#define TABDMC_NOTIFY
Definition: undocshell.h:927
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
static LRESULT OnDestroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1552
#define ZeroMemory
Definition: winbase.h:1737
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MAXIMUM_WAIT_OBJECTS
Definition: winbase.h:430
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define CopyMemory
Definition: winbase.h:1735
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WAIT_OBJECT_0
Definition: winbase.h:432
#define WAIT_FAILED
Definition: winbase.h:439
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#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:1628
#define GetMonitorInfo
Definition: winuser.h:5803
#define SetWindowLong
Definition: winuser.h:5865
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI SendNotifyMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MOUSEFIRST
Definition: winuser.h:1777
#define GA_ROOT
Definition: winuser.h:2792
#define WM_MOUSELAST
Definition: winuser.h:1804
#define WM_CREATE
Definition: winuser.h:1611
#define WM_SIZE
Definition: winuser.h:1614
#define HWND_BROADCAST
Definition: winuser.h:1207
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define SM_CYSMICON
Definition: winuser.h:1016
#define SWP_NOSIZE
Definition: winuser.h:1248
#define CS_DBLCLKS
Definition: winuser.h:651
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define WM_RBUTTONDOWN
Definition: winuser.h:1782
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
#define SM_CXSMICON
Definition: winuser.h:1015
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_TIMER
Definition: winuser.h:1745
#define WM_COPYDATA
Definition: winuser.h:1667
#define SendMessage
Definition: winuser.h:5855
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define GetWindowLong
Definition: winuser.h:5808
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define PostMessage
Definition: winuser.h:5844
#define BN_CLICKED
Definition: winuser.h:1928
#define WM_DESTROY
Definition: winuser.h:1612
#define SWP_NOZORDER
Definition: winuser.h:1250
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define GWL_STYLE
Definition: winuser.h:855
#define SendNotifyMessage
Definition: winuser.h:5858
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define COLOR_3DFACE
Definition: winuser.h:932
_In_ BOOLEAN Remove
Definition: psfuncs.h:110
static void Initialize()
Definition: xlate.c:212
__wchar_t WCHAR
Definition: xmlstorage.h:180
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define const
Definition: zconf.h:233