ReactOS 0.4.17-dev-804-g023d8af
traywnd.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Explorer
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Tray window implementation
5 * COPYRIGHT: Copyright 2006-2007 Thomas Weidenmueller <w3seek@reactos.org>
6 * Copyright 2018-2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 */
8
9#include "precomp.h"
10#include <commoncontrols.h>
11#include <cfgmgr32.h>
12#include <regstr.h>
13#include "appbar.h"
14
15HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
16
17#define WM_APP_TRAYDESTROY (WM_APP + 0x100)
18
19#define TIMER_ID_AUTOHIDE 1
20#define TIMER_ID_MOUSETRACK 2
21#define MOUSETRACK_INTERVAL 100
22#define AUTOHIDE_DELAY_HIDE 2000
23#define AUTOHIDE_DELAY_SHOW 50
24#define AUTOHIDE_INTERVAL_ANIMATING 10
25
26#define AUTOHIDE_SPEED_SHOW 10
27#define AUTOHIDE_SPEED_HIDE 1
28
29#define AUTOHIDE_HIDDEN 0
30#define AUTOHIDE_SHOWING 1
31#define AUTOHIDE_SHOWN 2
32#define AUTOHIDE_HIDING 3
33
34#define IDHK_RUN 0x1f4
35#define IDHK_MINIMIZE_ALL 0x1f5
36#define IDHK_RESTORE_ALL 0x1f6
37#define IDHK_HELP 0x1f7
38#define IDHK_EXPLORE 0x1f8
39#define IDHK_FIND 0x1f9
40#define IDHK_FIND_COMPUTER 0x1fa
41#define IDHK_NEXT_TASK 0x1fb
42#define IDHK_PREV_TASK 0x1fc
43#define IDHK_SYS_PROPERTIES 0x1fd
44#define IDHK_DESKTOP 0x1fe
45#define IDHK_PAGER 0x1ff
46
48
50{
53};
55
57{
58 WINDOWPOSBACKUPDATA wposdata;
59 HWND hDesk = GetDesktopWindow();
60 if (IsWindowVisible(hwnd) && !IsIconic(hwnd) && (hwnd != hDesk))
61 {
62 wposdata.hwnd = hwnd;
63 wposdata.wplt.length = sizeof(wposdata.wplt);
64 GetWindowPlacement(hwnd, &(wposdata.wplt));
65 g_WindowPosBackup.Add(wposdata);
66 }
67
68 return TRUE;
69}
70
72{
74}
75
77{
79
80 for (INT i = g_WindowPosBackup.GetSize() - 1; i >= 0; --i)
81 {
83 }
84
85 g_WindowPosBackup.RemoveAll();
86}
87
89{
92 {
94 return TRUE;
95
97 if (!(exstyle & WS_EX_TOPMOST))
98 return TRUE;
99 }
100 return FALSE;
101}
102
104{
110};
111
112static BOOL CALLBACK
114{
116
117 if (!CanBeMinimized(hwnd))
118 return TRUE; // continue
119
120 if (pei->hTrayWnd == hwnd || pei->hwndDesktop == hwnd ||
121 pei->hwndProgman == hwnd)
122 {
123 return TRUE; // continue
124 }
125
126 if (pei->bMustBeInMonitor)
127 {
128 // is the window in the nearest monitor?
129 HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
130 if (hMon)
131 {
133 ZeroMemory(&info, sizeof(info));
134 info.cbSize = sizeof(info);
135 if (GetMonitorInfoW(hMon, &info))
136 {
137 RECT rcWindow, rcMonitor, rcIntersect;
138 rcMonitor = info.rcMonitor;
139
140 GetWindowRect(hwnd, &rcWindow);
141
142 if (!IntersectRect(&rcIntersect, &rcMonitor, &rcWindow))
143 return TRUE; // continue
144 }
145 }
146 }
147
148 pei->hwndFound = hwnd;
149 return FALSE; // stop if found
150}
151
152static BOOL
154{
156 ei.hwndFound = NULL;
158 ei.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
159 ei.hwndProgman = FindWindowW(L"Progman", NULL);
160 ei.bMustBeInMonitor = bMustBeInMonitor;
161
163 return ei.hwndFound != NULL;
164}
165
166/* Minimized window position info */
168{
171};
173
174/*
175 * ITrayWindow
176 */
177
178const GUID IID_IShellDesktopTray = { 0x213e2df9, 0x9a14, 0x4328, { 0x99, 0xb1, 0x69, 0x61, 0xf9, 0x14, 0x3c, 0xe9 } };
179
181 : public CWindowImpl<CStartButton>
182{
185 HFONT m_Font;
186
187public:
189 : m_ImageList(NULL),
190 m_Font(NULL)
191 {
192 m_Size.cx = 0;
193 m_Size.cy = 0;
194 }
195
197 {
198 if (m_ImageList != NULL)
200
201 if (m_Font != NULL)
203 }
204
206 {
207 return m_Size;
208 }
209
211 {
212 SIZE Size = { 0, 0 };
213
214 if (m_ImageList == NULL ||
216 {
218 }
219
221
222 /* Save the size of the start button */
223 m_Size = Size;
224 }
225
227 {
228 /* Get the system fonts, we use the caption font, always bold, though. */
229 NONCLIENTMETRICS ncm = {sizeof(ncm)};
230 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
231 return;
232
233 if (m_Font)
235
236 ncm.lfCaptionFont.lfWeight = FW_BOLD;
237 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
238
240 }
241
243 {
244 // HACK & FIXME: CORE-18016
245 HWND hWnd = m_hWnd;
246 m_hWnd = NULL;
248
249 SetWindowTheme(m_hWnd, L"Start", NULL);
250
253 0, 0, 0,
256
259 UpdateSize();
260 }
261
263 {
264 WCHAR szStartCaption[32];
266 IDS_START,
267 szStartCaption,
268 _countof(szStartCaption)))
269 {
270 wcscpy(szStartCaption, L"Start");
271 }
272
274
275 // HACK & FIXME: CORE-18016
277 0,
278 WC_BUTTON,
279 szStartCaption,
280 dwStyle,
281 0, 0, 0, 0,
285 NULL);
286
287 if (m_hWnd)
288 Initialize();
289
290 return m_hWnd;
291 }
292
294 {
295 if (uMsg == WM_KEYUP && wParam != VK_SPACE)
296 return 0;
297
299 return 0;
300 }
301
305};
306
308 public CComCoClass<CTrayWindow>,
309 public CComObjectRootEx<CComMultiThreadModelNoCS>,
310 public CWindowImpl < CTrayWindow, CWindow, CControlWinTraits >,
311 public CAppBarManager,
312 public ITrayWindow,
313 public IShellDesktopTray,
314 public IOleWindow,
315 public IContextMenu
316{
319
322
326
327 HFONT m_Font;
328
333
335
341
344
347
351
353
355
356public:
358
359 union
360 {
362 struct
363 {
364 /* UI Status */
368 };
369 };
370
371public:
375 m_Theme(NULL),
376 m_Font(NULL),
378 m_Rebar(NULL),
381 m_Position(0),
391 Flags(0)
392 {
397 }
398
399 virtual ~CTrayWindow()
400 {
401 if (m_ShellServices != NULL)
402 {
405 }
406
407 if (m_Font != NULL)
408 {
410 m_Font = NULL;
411 }
412
413 if (m_Theme)
414 {
416 m_Theme = NULL;
417 }
418
420 }
421
422
423
424
425
426 /**********************************************************
427 * ##### command handling #####
428 */
429
431 {
432 WCHAR szCommand[256];
433 WCHAR *pszParameters;
434
436 id,
437 szCommand,
438 _countof(szCommand)))
439 {
440 return E_FAIL;
441 }
442
443 pszParameters = wcschr(szCommand, L'>');
444 if (pszParameters)
445 {
446 *pszParameters = 0;
447 pszParameters++;
448 }
449
450 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
451 return S_OK;
452 }
453
455 {
457 return;
458
460
463 }
464
466 {
467 IUnknown_Exec(m_StartMenuPopup, CLSID_MenuBand, 0x10000000, 0, NULL, NULL);
468 }
469
471 {
473 return 0;
474
475 if (GetAsyncKeyState(VK_SHIFT) < 0 ||
476 !SHGetValueW(HKEY_CURRENT_USER, REGSTR_PATH_EXPLORER L"\\Advanced", L"StartMenuForceRefresh", NULL, NULL, NULL))
477 {
479 }
480
481 SaveState();
482
483 /* Display the ReactOS Shutdown Dialog */
485
486 /*
487 * If the user presses CTRL+ALT+SHIFT while exiting
488 * the shutdown dialog, exit the shell cleanly.
489 */
490 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
491 (GetKeyState(VK_SHIFT) & 0x8000) &&
492 (GetKeyState(VK_MENU) & 0x8000))
493 {
494 PostMessage(WM_QUIT, 0, 0);
495 }
496 return 0;
497 }
498
500 {
501 HWND hwnd;
502 RECT posRect;
503
505
507 WC_STATIC,
508 NULL,
510 posRect.left,
511 posRect.top,
512 posRect.right - posRect.left,
513 posRect.bottom - posRect.top,
514 NULL,
515 NULL,
516 NULL,
517 NULL);
518
520
521 // build the default directory from two environment variables
522 CStringW strDefaultDir, strHomePath;
523 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
524 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
525 strDefaultDir += strHomePath;
526
528
531
532 return 0;
533 }
534
536 {
537 CTrayWindow * This = (CTrayWindow*) pParam;
538 return This->RunFileDlgThread();
539 }
540
542 {
543 HWND hRunDlg;
545 {
547 if (hRunDlg != NULL &&
548 hRunDlg != m_RunFileDlgOwner)
549 {
550 SetForegroundWindow(hRunDlg);
551 return;
552 }
553 }
554
556 if (hThread)
558 }
559
561 {
562 HWND hwnd;
563 RECT posRect;
564
567 WC_STATIC,
568 NULL,
570 posRect.left,
571 posRect.top,
572 posRect.right - posRect.left,
573 posRect.bottom - posRect.top,
574 NULL,
575 NULL,
576 NULL,
577 NULL);
578
580
582
585
586 return 0;
587 }
588
590 {
591 CTrayWindow *This = (CTrayWindow*) pParam;
592
593 return This->TrayPropertiesThread();
594 }
595
597 {
598 HWND hTrayProp;
599
601 {
603 if (hTrayProp != NULL &&
604 hTrayProp != m_TrayPropertiesOwner)
605 {
606 SetForegroundWindow(hTrayProp);
607 return NULL;
608 }
609 }
610
612 if (hThread)
614 return NULL;
615 }
616
618 {
619 WCHAR szDir[MAX_PATH];
620
621 if (SHGetSpecialFolderPath(hWndOwner,
622 szDir,
624 FALSE))
625 {
626 ShellExecute(hWndOwner,
627 lpOperation,
628 szDir,
629 NULL,
630 NULL,
632 }
633 }
634
636 {
637 ShellExecute(hWndOwner,
638 TEXT("open"),
639 TEXT("taskmgr.exe"),
640 NULL,
641 NULL,
643 }
644
646 {
648 {
649 ShowDesktop();
650 }
651 else
652 {
653 RestoreAll();
654 }
655 }
656
658 {
659 switch (uiCmd)
660 {
663 break;
664
667 TEXT("open"));
668 break;
669
672 TEXT("explore"));
673 break;
674
675 case ID_LOCKTASKBAR:
677 break;
678
681 break;
682
685 break;
686
688 ShowDesktop();
689 break;
690
693 if (g_Arrangement == NONE)
694 {
696 }
700 break;
701
704 if (g_Arrangement == NONE)
705 {
707 }
711 break;
712
715 if (g_Arrangement == NONE)
716 {
718 }
722 break;
723
726 break;
727
729 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
730 break;
731
733 RestoreAll();
734 break;
735
736 default:
737 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
738 return FALSE;
739 }
740
741 return TRUE;
742 }
743
745 {
746 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
747 }
748
749 VOID ShowFolder(INT csidl, BOOL bExplore)
750 {
751 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST };
752 if (bExplore)
753 sei.lpVerb = L"explore";
754 sei.nShow = SW_SHOWNORMAL;
756 if (sei.lpIDList)
757 {
758 ShellExecuteExW(&sei);
760 }
761 }
762
764 {
765 switch (id)
766 {
767 case IDHK_RUN:
770 break;
771 case IDHK_HELP:
773 break;
774 case IDHK_EXPLORE:
776 break;
777 case IDHK_FIND:
779 break;
782 break;
784 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
785 break;
786 case IDHK_NEXT_TASK:
787 break;
788 case IDHK_PREV_TASK:
789 break;
791 MinimizeAll();
792 break;
793 case IDHK_RESTORE_ALL:
794 RestoreAll();
795 break;
796 case IDHK_DESKTOP:
798 break;
799 case IDHK_PAGER:
800 break;
801 }
802
803 return 0;
804 }
805
807 {
809 return 0;
810 }
811
813 {
814 switch (uCommand)
815 {
818#if 0 // FIXME: This won't work
821#else
823#endif
824 break;
828 break;
830 SaveState();
831 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
832 break;
833 case TRAYCMD_CASCADE:
835 break;
836 case TRAYCMD_TILE_H:
838 break;
839 case TRAYCMD_TILE_V:
841 break;
844 break;
846 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
847 break;
848 case TRAYCMD_EJECT:
850 break;
853 break;
855 MinimizeAll();
856 break;
858 RestoreAll();
859 break;
861 ShowDesktop();
862 break;
865 break;
867 break;
870 {
873 }
874 break;
877 break;
881 break;
884 break;
888 break;
890 // TODO:
891 break;
893 UpdateWindow();
894 Sleep(100);
895 //DisconnectWindowsDialog(m_DesktopWnd); // FIXME: shell32
896 break;
902 break;
903 case IDM_SEARCH:
907 break;
911 break;
912 //case TRAYCMD_REFRESH_MENU: Does nothing on WinXP+
913 // break;
914 default:
915 break;
916 }
917
918 return FALSE;
919 }
920
921
923 IN HMENU hMenu,
924 IN POINT *ppt OPTIONAL,
925 IN HWND hwndExclude OPTIONAL,
926 IN BOOL TrackUp,
927 IN BOOL IsContextMenu)
928 {
929 TPMPARAMS tmp, *ptmp = NULL;
930 POINT pt;
931 UINT cmdId;
932 UINT fuFlags;
933
934 if (hwndExclude != NULL)
935 {
936 /* Get the client rectangle and map it to screen coordinates */
937 if (::GetClientRect(hwndExclude,
938 &tmp.rcExclude) &&
939 ::MapWindowPoints(hwndExclude,
940 NULL,
941 (LPPOINT) &tmp.rcExclude,
942 2) != 0)
943 {
944 ptmp = &tmp;
945 }
946 }
947
948 if (ppt == NULL)
949 {
950 if (ptmp == NULL &&
951 GetClientRect(&tmp.rcExclude) &&
953 NULL,
954 (LPPOINT) &tmp.rcExclude,
955 2) != 0)
956 {
957 ptmp = &tmp;
958 }
959
960 if (ptmp != NULL)
961 {
962 /* NOTE: TrackPopupMenuEx will eventually align the track position
963 for us, no need to take care of it here as long as the
964 coordinates are somewhere within the exclusion rectangle */
965 pt.x = ptmp->rcExclude.left;
966 pt.y = ptmp->rcExclude.top;
967 }
968 else
969 pt.x = pt.y = 0;
970 }
971 else
972 pt = *ppt;
973
974 tmp.cbSize = sizeof(tmp);
975
976 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
977 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
978 if (IsContextMenu)
979 fuFlags |= TPM_RIGHTBUTTON;
980 else
981 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
982
983 cmdId = TrackPopupMenuEx(hMenu,
984 fuFlags,
985 pt.x,
986 pt.y,
987 m_hWnd,
988 ptmp);
989
990 return cmdId;
991 }
992
994 IN IContextMenu * contextMenu,
995 IN POINT *ppt OPTIONAL,
996 IN HWND hwndExclude OPTIONAL,
997 IN BOOL TrackUp,
999 {
1000 POINT pt;
1002 RECT rc;
1003 HRESULT hr;
1004 UINT uCommand;
1005 HMENU popup = CreatePopupMenu();
1006
1007 if (popup == NULL)
1008 return E_FAIL;
1009
1010 if (ppt)
1011 {
1012 pt = *ppt;
1013 }
1014 else
1015 {
1016 ::GetWindowRect(m_hWnd, &rc);
1017 pt.x = rc.left;
1018 pt.y = rc.top;
1019 }
1020
1021 TRACE("Before Query\n");
1022 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
1024 {
1025 TRACE("Query failed\n");
1026 DestroyMenu(popup);
1027 return hr;
1028 }
1029
1030 TRACE("Before Tracking\n");
1032 if (hwndExclude)
1033 {
1034 ::GetWindowRect(hwndExclude, &rc);
1035 ZeroMemory(&params, sizeof(params));
1036 params.cbSize = sizeof(params);
1037 params.rcExclude = rc;
1038 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
1039 }
1040 else
1041 {
1042 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
1043 }
1045
1046 if (uCommand != 0)
1047 {
1048 TRACE("Before InvokeCommand\n");
1049 CMINVOKECOMMANDINFO cmi = { 0 };
1050 cmi.cbSize = sizeof(cmi);
1051 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
1052 cmi.hwnd = m_hWnd;
1053 hr = contextMenu->InvokeCommand(&cmi);
1054 }
1055 else
1056 {
1057 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1058 hr = S_FALSE;
1059 }
1060
1061 DestroyMenu(popup);
1062 return hr;
1063 }
1064
1065
1066
1067
1068
1069 /**********************************************************
1070 * ##### moving and sizing handling #####
1071 */
1072
1074 {
1075 /* There is nothing to do if themes are enabled */
1076 if (m_Theme)
1077 return;
1078
1080
1081 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1082 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1083 {
1084 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1085 return;
1086 }
1087
1088 if (m_Font != NULL)
1090
1091 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1092 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1093 if (!m_Font)
1094 {
1095 ERR("CreateFontIndirect failed\n");
1096 return;
1097 }
1098
1102 }
1103
1105 IN OUT RECT *pRect,
1107 {
1109 HMONITOR hMon;
1110
1111 mi.cbSize = sizeof(mi);
1112 hMon = MonitorFromRect(pRect, dwFlags);
1113 if (hMon != NULL &&
1114 GetMonitorInfo(hMon, &mi))
1115 {
1116 *pRect = mi.rcMonitor;
1117 }
1118 else
1119 {
1120 pRect->left = 0;
1121 pRect->top = 0;
1122 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1123 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1124
1125 hMon = NULL;
1126 }
1127
1128 return hMon;
1129 }
1130
1132 IN const RECT *pRect)
1133 {
1134 HMONITOR hMon;
1135
1136 /* In case the monitor sizes or saved sizes differ a bit (probably
1137 not a lot, only so the tray window overlaps into another monitor
1138 now), minimize the risk that we determine a wrong monitor by
1139 using the center point of the tray window if we can't determine
1140 it using the rectangle. */
1141 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1142 if (hMon == NULL)
1143 {
1144 POINT pt;
1145
1146 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1147 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1148
1149 /* be less error-prone, find the nearest monitor */
1150 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1151 }
1152
1153 return hMon;
1154 }
1155
1157 IN HMONITOR hMonitor,
1158 IN OUT RECT *pRect)
1159 {
1160 HMONITOR hMon = NULL;
1161
1162 if (hMonitor != NULL)
1163 {
1165
1166 mi.cbSize = sizeof(mi);
1167 if (!GetMonitorInfo(hMonitor, &mi))
1168 {
1169 /* Hm, the monitor is gone? Try to find a monitor where it
1170 could be located now */
1171 hMon = GetMonitorFromRect(pRect);
1172 if (hMon == NULL ||
1173 !GetMonitorInfo(hMon, &mi))
1174 {
1175 hMon = NULL;
1176 goto GetPrimaryRect;
1177 }
1178 }
1179
1180 *pRect = mi.rcMonitor;
1181 }
1182 else
1183 {
1184GetPrimaryRect:
1185 pRect->left = 0;
1186 pRect->top = 0;
1187 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1188 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1189 }
1190
1191 return hMon;
1192 }
1193
1195 {
1197 SIZE size;
1198
1199 if (pos > ABE_BOTTOM)
1200 pos = ABE_BOTTOM;
1201
1202 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1204 return;
1205
1206 switch (pos)
1207 {
1208 case ABE_TOP:
1209 rc->bottom -= size.cy;
1210 break;
1211 case ABE_BOTTOM:
1212 rc->top += size.cy;
1213 break;
1214 case ABE_LEFT:
1215 rc->right -= size.cx;
1216 break;
1217 case ABE_RIGHT:
1218 rc->left += size.cx;
1219 break;
1220 }
1221 }
1222
1224 IN const SIZE *pTraySize,
1225 IN OUT RECT *pRect)
1226 {
1227 switch (Position)
1228 {
1229 case ABE_LEFT:
1230 pRect->right = pRect->left + pTraySize->cx;
1231 break;
1232
1233 case ABE_TOP:
1234 pRect->bottom = pRect->top + pTraySize->cy;
1235 break;
1236
1237 case ABE_RIGHT:
1238 pRect->left = pRect->right - pTraySize->cx;
1239 break;
1240
1241 case ABE_BOTTOM:
1242 default:
1243 pRect->top = pRect->bottom - pTraySize->cy;
1244 break;
1245 }
1246 }
1247
1249 IN const RECT *pScreen,
1250 IN const SIZE *pTraySize OPTIONAL,
1251 OUT RECT *pRect)
1252 {
1253 if (pTraySize == NULL)
1254 pTraySize = &m_TraySize;
1255
1256 *pRect = *pScreen;
1257
1258 if(!m_Theme)
1259 {
1260 /* Move the border outside of the screen */
1261 InflateRect(pRect,
1264 }
1265
1266 MakeTrayRectWithSize(Position, pTraySize, pRect);
1267 }
1268
1270 {
1271 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1272 }
1273
1276 IN OUT RECT *pRect)
1277 {
1278 RECT rcScreen;
1279 //BOOL Horizontal;
1280 HMONITOR hMon;
1281 SIZE szMax, szWnd;
1282
1283 //Horizontal = IsPosHorizontal();
1284
1285 szWnd.cx = pRect->right - pRect->left;
1286 szWnd.cy = pRect->bottom - pRect->top;
1287
1288 rcScreen = *pRect;
1289 hMon = GetScreenRectFromRect(
1290 &rcScreen,
1291 MONITOR_DEFAULTTONEAREST);
1292
1293 /* Calculate the maximum size of the tray window and limit the window
1294 size to half of the screen's size. */
1295 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1296 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1297 if (szWnd.cx > szMax.cx)
1298 szWnd.cx = szMax.cx;
1299 if (szWnd.cy > szMax.cy)
1300 szWnd.cy = szMax.cy;
1301
1302 /* FIXME - calculate */
1303
1305 &rcScreen,
1306 &szWnd,
1307 pRect);
1308
1309 return hMon;
1310 }
1311
1312#if 0
1313 VOID
1314 GetMinimumWindowSize(
1315 OUT RECT *pRect)
1316 {
1317 RECT rcMin = {0};
1318
1319 AdjustWindowRectEx(&rcMin,
1321 GWL_STYLE),
1322 FALSE,
1324 GWL_EXSTYLE));
1325
1326 *pRect = rcMin;
1327 }
1328#endif
1329
1330
1332 IN POINT pt,
1333 OUT RECT *pRect,
1334 OUT HMONITOR *phMonitor)
1335 {
1336 HMONITOR hMon, hMonNew;
1337 DWORD PosH, PosV, Pos;
1338 SIZE DeltaPt, ScreenOffset;
1339 RECT rcScreen;
1340
1341 rcScreen.left = 0;
1342 rcScreen.top = 0;
1343
1344 /* Determine the screen rectangle */
1345 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1346 if (hMon != NULL)
1347 {
1349
1350 mi.cbSize = sizeof(mi);
1351 if (!GetMonitorInfo(hMon, &mi))
1352 {
1353 hMon = NULL;
1354 goto GetPrimaryScreenRect;
1355 }
1356
1357 /* make left top corner of the screen zero based to
1358 make calculations easier */
1359 pt.x -= mi.rcMonitor.left;
1360 pt.y -= mi.rcMonitor.top;
1361
1362 ScreenOffset.cx = mi.rcMonitor.left;
1363 ScreenOffset.cy = mi.rcMonitor.top;
1364 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1365 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1366 }
1367 else
1368 {
1369GetPrimaryScreenRect:
1370 ScreenOffset.cx = 0;
1371 ScreenOffset.cy = 0;
1374 }
1375
1376 /* Calculate the nearest screen border */
1377 if (pt.x < rcScreen.right / 2)
1378 {
1379 DeltaPt.cx = pt.x;
1380 PosH = ABE_LEFT;
1381 }
1382 else
1383 {
1384 DeltaPt.cx = rcScreen.right - pt.x;
1385 PosH = ABE_RIGHT;
1386 }
1387
1388 if (pt.y < rcScreen.bottom / 2)
1389 {
1390 DeltaPt.cy = pt.y;
1391 PosV = ABE_TOP;
1392 }
1393 else
1394 {
1395 DeltaPt.cy = rcScreen.bottom - pt.y;
1396 PosV = ABE_BOTTOM;
1397 }
1398
1399 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1400
1401 /* Fix the screen origin to be relative to the primary monitor again */
1402 OffsetRect(&rcScreen,
1403 ScreenOffset.cx,
1404 ScreenOffset.cy);
1405
1406 RECT rcPos = m_TrayRects[Pos];
1407
1408 hMonNew = GetMonitorFromRect(&rcPos);
1409 if (hMon != hMonNew)
1410 {
1411 SIZE szTray;
1412
1413 /* Recalculate the rectangle, we're dragging to another monitor.
1414 We don't need to recalculate the rect on single monitor systems. */
1415 szTray.cx = rcPos.right - rcPos.left;
1416 szTray.cy = rcPos.bottom - rcPos.top;
1417
1418 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1419 hMon = hMonNew;
1420 }
1421 else
1422 {
1423 /* The user is dragging the tray window on the same monitor. We don't need
1424 to recalculate the rectangle */
1425 *pRect = rcPos;
1426 }
1427
1428 *phMonitor = hMon;
1429
1430 return Pos;
1431 }
1432
1434 IN OUT RECT *pRect,
1435 OUT HMONITOR *phMonitor)
1436 {
1437 POINT pt;
1438
1439 /* Calculate the center of the rectangle. We call
1440 GetDraggingRectFromPt to calculate a valid
1441 dragging rectangle */
1442 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1443 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1444
1445 return GetDraggingRectFromPt(
1446 pt,
1447 pRect,
1448 phMonitor);
1449 }
1450
1452 {
1453 RECT rcTray;
1454
1455 if (IsDragging)
1456 {
1457 rcTray.left = pwp->x;
1458 rcTray.top = pwp->y;
1459 rcTray.right = rcTray.left + pwp->cx;
1460 rcTray.bottom = rcTray.top + pwp->cy;
1461
1462 if (!EqualRect(&rcTray,
1464 {
1465 /* Recalculate the rectangle, the user dragged the tray
1466 window to another monitor or the window was somehow else
1467 moved or resized */
1469 &rcTray,
1471 //m_TrayRects[DraggingPosition] = rcTray;
1472 }
1473
1474 //Monitor = CalculateValidSize(DraggingPosition,
1475 // &rcTray);
1476
1481 IsDragging = FALSE;
1482
1483 m_TrayRects[m_Position] = rcTray;
1484 goto ChangePos;
1485 }
1486 else if (GetWindowRect(&rcTray))
1487 {
1488 if (InSizeMove)
1489 {
1490 if (!(pwp->flags & SWP_NOMOVE))
1491 {
1492 rcTray.left = pwp->x;
1493 rcTray.top = pwp->y;
1494 }
1495
1496 if (!(pwp->flags & SWP_NOSIZE))
1497 {
1498 rcTray.right = rcTray.left + pwp->cx;
1499 rcTray.bottom = rcTray.top + pwp->cy;
1500 }
1501
1503
1504 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1505 {
1506 SIZE szWnd;
1507
1508 szWnd.cx = pwp->cx;
1509 szWnd.cy = pwp->cy;
1510
1511 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1512 }
1513
1514 m_TrayRects[m_Position] = rcTray;
1515 }
1516 else if (m_Position != (DWORD)-1)
1517 {
1518 /* If the user isn't resizing the tray window we need to make sure the
1519 new size or position is valid. this is to prevent changes to the window
1520 without user interaction. */
1521 rcTray = m_TrayRects[m_Position];
1522
1523 if (IsAutoHideState())
1524 {
1525 rcTray.left += m_AutoHideOffset.cx;
1526 rcTray.right += m_AutoHideOffset.cx;
1527 rcTray.top += m_AutoHideOffset.cy;
1528 rcTray.bottom += m_AutoHideOffset.cy;
1529 }
1530 }
1531
1532ChangePos:
1533 m_TraySize.cx = rcTray.right - rcTray.left;
1534 m_TraySize.cy = rcTray.bottom - rcTray.top;
1535
1536 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1537 pwp->x = rcTray.left;
1538 pwp->y = rcTray.top;
1539 pwp->cx = m_TraySize.cx;
1540 pwp->cy = m_TraySize.cy;
1541 }
1542 }
1543
1545 {
1546 RECT rcClip, rcWindow;
1547 HRGN hClipRgn;
1548
1549 if (GetWindowRect(&rcWindow))
1550 {
1551 /* Disable clipping on systems with only one monitor */
1553 Clip = FALSE;
1554
1555 if (Clip)
1556 {
1557 rcClip = rcWindow;
1558
1559 GetScreenRect(m_Monitor, &rcClip);
1560
1561 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1562 {
1563 rcClip = rcWindow;
1564 }
1565
1566 OffsetRect(&rcClip,
1567 -rcWindow.left,
1568 -rcWindow.top);
1569
1570 hClipRgn = CreateRectRgnIndirect(&rcClip);
1571 }
1572 else
1573 hClipRgn = NULL;
1574
1575 /* Set the clipping region or make sure the window isn't clipped
1576 by disabling it explicitly. */
1577 SetWindowRgn(hClipRgn, TRUE);
1578 }
1579 }
1580
1582 {
1583#if !WIN7_DEBUG_MODE
1584 RECT rcTray, rcWorkArea;
1585
1586 /* If monitor has changed then fix the previous monitors work area */
1588 {
1589 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1590 SystemParametersInfoW(SPI_SETWORKAREA,
1591 1,
1592 &rcWorkArea,
1594 }
1595
1596 rcTray = m_TrayRects[m_Position];
1597
1598 GetScreenRect(m_Monitor, &rcWorkArea);
1600
1601 /* If AutoHide is false then change the workarea to exclude
1602 the area that the taskbar covers. */
1603 if (!IsAutoHideState())
1604 {
1605 switch (m_Position)
1606 {
1607 case ABE_TOP:
1608 rcWorkArea.top = rcTray.bottom;
1609 break;
1610 case ABE_LEFT:
1611 rcWorkArea.left = rcTray.right;
1612 break;
1613 case ABE_RIGHT:
1614 rcWorkArea.right = rcTray.left;
1615 break;
1616 case ABE_BOTTOM:
1617 rcWorkArea.bottom = rcTray.top;
1618 break;
1619 }
1620 }
1621
1622 /*
1623 * Resize the current monitor work area. Win32k will also send
1624 * a WM_SIZE message to automatically resize the desktop.
1625 */
1626 SystemParametersInfoW(SPI_SETWORKAREA,
1627 1,
1628 &rcWorkArea,
1630#endif
1631 }
1632
1634 {
1635 /* Force the rebar bands to resize */
1637 IID_IDeskBand,
1639 0,
1640 NULL,
1641 NULL);
1642
1643 /* Calculate the size of the taskbar based on the rebar */
1645
1646 /* Move the tray window */
1647 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1648 * and position we use here with m_TrayRects */
1653 }
1654
1656 {
1657 DWORD Pos;
1658 RECT rcScreen;
1659 SIZE WndSize, EdgeSize, DlgFrameSize;
1660 SIZE StartBtnSize = m_StartButton.GetSize();
1661
1662 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1663 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1664 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1665 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1666
1668 rcScreen = g_TaskbarSettings.sr.Rect;
1669 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1670
1672 {
1673 /* Use the minimum size of the taskbar, we'll use the start
1674 button as a minimum for now. Make sure we calculate the
1675 entire window size, not just the client size. However, we
1676 use a thinner border than a standard thick border, so that
1677 the start button and bands are not stuck to the screen border. */
1678 if(!m_Theme)
1679 {
1680 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1681 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1682 }
1683 else
1684 {
1685 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1686 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1689 }
1690 }
1691 /* Determine a minimum tray window rectangle. The "client" height is
1692 zero here since we cannot determine an optimal minimum width when
1693 loaded as a vertical tray window. We just need to make sure the values
1694 loaded from the registry are at least. The windows explorer behaves
1695 the same way, it allows the user to save a zero width vertical tray
1696 window, but not a zero height horizontal tray window. */
1697 if(!m_Theme)
1698 {
1699 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1700 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1701 }
1702 else
1703 {
1704 WndSize.cx = StartBtnSize.cx;
1705 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1706 }
1707
1708 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1709 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1710 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1711 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1712
1713 /* Save the calculated size */
1714 m_TraySize = WndSize;
1715
1716 /* Calculate all docking rectangles. We need to do this here so they're
1717 initialized and dragging the tray window to another position gives
1718 usable results */
1719 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1720 {
1722 &rcScreen,
1723 &m_TraySize,
1724 &m_TrayRects[Pos]);
1725 // TRACE("m_TrayRects[%d(%d)]: %d,%d,%d,%d\n", Pos, Position, m_TrayRects[Pos].left, m_TrayRects[Pos].top, m_TrayRects[Pos].right, m_TrayRects[Pos].bottom);
1726 }
1727
1728 /* Determine which monitor we are on. It shouldn't matter which docked
1729 position rectangle we use */
1731 }
1732
1734 {
1735 RECT rcClient;
1736 SIZE TraySize, StartSize;
1737 POINT ptTrayNotify = { 0, 0 };
1738 BOOL Horizontal;
1739 HDWP dwp;
1740
1742 if (prcClient != NULL)
1743 {
1744 rcClient = *prcClient;
1745 }
1746 else
1747 {
1748 if (!GetClientRect(&rcClient))
1749 {
1750 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1751 return;
1752 }
1753 }
1754
1755 Horizontal = IsPosHorizontal();
1756
1757 /* We're about to resize/move the start button, the rebar control and
1758 the tray notification control */
1759 dwp = BeginDeferWindowPos(4);
1760 if (dwp == NULL)
1761 {
1762 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1763 return;
1764 }
1765
1766 /* Limit the Start button width to the client width, if necessary */
1767 StartSize = m_StartButton.GetSize();
1768 if (StartSize.cx > rcClient.right)
1769 StartSize.cx = rcClient.right;
1770
1771 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1772 if (hwndTaskToolbar)
1773 {
1774 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1775
1776 /* Themed button covers Edge area as well */
1777 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1778 }
1779
1780 if (m_StartButton.m_hWnd != NULL)
1781 {
1782 /* Resize and reposition the button */
1783 dwp = m_StartButton.DeferWindowPos(dwp,
1784 NULL,
1785 0,
1786 0,
1787 StartSize.cx,
1788 StartSize.cy,
1790 if (dwp == NULL)
1791 {
1792 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1793 return;
1794 }
1795 }
1796
1797 /* Determine the size that the tray notification window needs */
1798 if (Horizontal)
1799 {
1800 TraySize.cx = 0;
1801 TraySize.cy = rcClient.bottom;
1802 }
1803 else
1804 {
1805 TraySize.cx = rcClient.right;
1806 TraySize.cy = 0;
1807 }
1808
1809 if (m_TrayNotify != NULL &&
1812 (WPARAM)Horizontal,
1813 (LPARAM)&TraySize))
1814 {
1815 /* Move the tray notification window to the desired location */
1816 if (Horizontal)
1817 ptTrayNotify.x = rcClient.right - TraySize.cx;
1818 else
1819 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1820
1821 dwp = ::DeferWindowPos(dwp,
1823 NULL,
1824 ptTrayNotify.x,
1825 ptTrayNotify.y,
1826 TraySize.cx,
1827 TraySize.cy,
1829 if (dwp == NULL)
1830 {
1831 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1832 return;
1833 }
1834 }
1835
1836 /* Resize/Move the rebar control */
1837 if (m_Rebar != NULL)
1838 {
1839 POINT ptRebar = { 0, 0 };
1840 SIZE szRebar;
1841
1842 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1843
1844 if (Horizontal)
1845 {
1846 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1847 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1848 szRebar.cy = rcClient.bottom;
1849 }
1850 else
1851 {
1852 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1853 szRebar.cx = rcClient.right;
1854 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1855 }
1856
1857 dwp = ::DeferWindowPos(dwp,
1858 m_Rebar,
1859 NULL,
1860 ptRebar.x,
1861 ptRebar.y,
1862 szRebar.cx,
1863 szRebar.cy,
1865 }
1866
1867 if (dwp != NULL)
1868 EndDeferWindowPos(dwp);
1869
1870 if (m_TaskSwitch != NULL)
1871 {
1872 /* Update the task switch window configuration */
1874 }
1875 }
1876
1877 void FitToRebar(PRECT pRect)
1878 {
1879 /* Get the rect of the rebar */
1880 RECT rebarRect, taskbarRect, clientRect;
1881 ::GetWindowRect(m_Rebar, &rebarRect);
1882 ::GetWindowRect(m_hWnd, &taskbarRect);
1883 ::GetClientRect(m_hWnd, &clientRect);
1884 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1885
1886 /* Calculate the difference of size of the taskbar and the rebar */
1887 SIZE margins;
1888 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1889 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1890
1891 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1892 switch (m_Position)
1893 {
1894 case ABE_TOP:
1895 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1897 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1898 break;
1899 case ABE_BOTTOM:
1900 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1902 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1903 break;
1904 case ABE_LEFT:
1905 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1907 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1908 break;
1909 case ABE_RIGHT:
1910 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1912 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1913 break;
1914 }
1915
1917 }
1918
1920 {
1921 if (m_StartMenuPopup != NULL)
1922 {
1923 POINTL pt;
1924 RECTL rcExclude;
1925 DWORD dwFlags = 0;
1926
1927 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1928 {
1929 switch (m_Position)
1930 {
1931 case ABE_BOTTOM:
1932 pt.x = rcExclude.left;
1933 pt.y = rcExclude.top;
1934 dwFlags |= MPPF_TOP;
1935 break;
1936 case ABE_TOP:
1937 pt.x = rcExclude.left;
1938 pt.y = rcExclude.bottom;
1939 dwFlags |= MPPF_BOTTOM;
1940 break;
1941 case ABE_LEFT:
1942 pt.x = rcExclude.right;
1943 pt.y = rcExclude.top;
1944 dwFlags |= MPPF_RIGHT;
1945 break;
1946 case ABE_RIGHT:
1947 pt.x = rcExclude.left;
1948 pt.y = rcExclude.top;
1949 dwFlags |= MPPF_LEFT;
1950 break;
1951 }
1952
1953 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1954
1955 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1956 }
1957 }
1958 }
1959
1961 {
1962 POINT pt;
1963 GetCursorPos(&pt);
1964
1965 RECT rcCurrent;
1966 GetWindowRect(&rcCurrent);
1967
1968 BOOL over = PtInRect(&rcCurrent, pt);
1970 over = TRUE;
1971
1973 if (over)
1974 {
1975 if (state == AUTOHIDE_HIDING)
1976 {
1977 TRACE("AutoHide cancelling hide.\n");
1980 }
1981 else if (state == AUTOHIDE_HIDDEN)
1982 {
1983 TRACE("AutoHide starting show.\n");
1986 }
1987 }
1988 else
1989 {
1990 if (state == AUTOHIDE_SHOWING)
1991 {
1992 TRACE("AutoHide cancelling show.\n");
1995 }
1996 else if (state == AUTOHIDE_SHOWN)
1997 {
1998 TRACE("AutoHide starting hide.\n");
2001 }
2002
2004 }
2005 }
2006
2008 {
2011
2012 switch (m_AutoHideState)
2013 {
2014 case AUTOHIDE_HIDING:
2015 switch (m_Position)
2016 {
2017 case ABE_LEFT:
2018 m_AutoHideOffset.cy = 0;
2020 if (m_AutoHideOffset.cx < -w)
2022 break;
2023 case ABE_TOP:
2024 m_AutoHideOffset.cx = 0;
2026 if (m_AutoHideOffset.cy < -h)
2028 break;
2029 case ABE_RIGHT:
2030 m_AutoHideOffset.cy = 0;
2032 if (m_AutoHideOffset.cx > w)
2034 break;
2035 case ABE_BOTTOM:
2036 m_AutoHideOffset.cx = 0;
2038 if (m_AutoHideOffset.cy > h)
2040 break;
2041 }
2042
2044 {
2046 break;
2047 }
2048
2049 /* fallthrough */
2050 case AUTOHIDE_HIDDEN:
2051 switch (m_Position)
2052 {
2053 case ABE_LEFT:
2055 m_AutoHideOffset.cy = 0;
2056 break;
2057 case ABE_TOP:
2058 m_AutoHideOffset.cx = 0;
2060 break;
2061 case ABE_RIGHT:
2063 m_AutoHideOffset.cy = 0;
2064 break;
2065 case ABE_BOTTOM:
2066 m_AutoHideOffset.cx = 0;
2068 break;
2069 }
2070
2073 break;
2074
2075 case AUTOHIDE_SHOWING:
2077 {
2079 }
2081 {
2083 }
2084 else
2085 {
2086 m_AutoHideOffset.cx = 0;
2087 }
2088
2090 {
2092 }
2094 {
2096 }
2097 else
2098 {
2099 m_AutoHideOffset.cy = 0;
2100 }
2101
2102 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2103 {
2105 break;
2106 }
2107
2108 /* fallthrough */
2109 case AUTOHIDE_SHOWN:
2112 break;
2113 }
2114
2116 }
2117
2118 /**********************************************************
2119 * ##### taskbar drawing #####
2120 */
2121
2123 {
2124 RECT rect;
2126
2128
2129 if (m_Theme)
2130 {
2132 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2133 }
2134
2135 return 0;
2136 }
2137
2139 {
2140 HDC hdc;
2141 RECT rect;
2143 SIZE size;
2144
2146
2149 return 0;
2150
2153
2154 hdc = GetWindowDC();
2155
2156 switch (m_Position)
2157 {
2158 case ABE_LEFT:
2159 rect.left = rect.right - size.cx;
2160 break;
2161 case ABE_TOP:
2162 rect.top = rect.bottom - size.cy;
2163 break;
2164 case ABE_RIGHT:
2165 rect.right = rect.left + size.cx;
2166 break;
2167 case ABE_BOTTOM:
2168 default:
2169 rect.bottom = rect.top + size.cy;
2170 break;
2171 }
2172
2173 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2174
2175 ReleaseDC(hdc);
2176 return 0;
2177 }
2178
2179 /*
2180 * ITrayWindow
2181 */
2183 {
2184 RECT rcWnd;
2185
2186 /* Check if there's already a window created and try to show it.
2187 If it was somehow destroyed just create a new tray window. */
2188 if (m_hWnd != NULL && IsWindow())
2189 {
2190 return S_OK;
2191 }
2192
2195 dwExStyle |= WS_EX_TOPMOST;
2196
2198 if(!m_Theme)
2199 {
2200 dwStyle |= WS_THICKFRAME | WS_BORDER;
2201 }
2202
2203 ZeroMemory(&rcWnd, sizeof(rcWnd));
2204 if (m_Position != (DWORD) -1)
2205 rcWnd = m_TrayRects[m_Position];
2206
2207 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2208 return E_FAIL;
2209
2210 /* Align all controls on the tray window */
2212
2213 /* Move the tray window to the right position and resize it if necessary */
2215
2216 return S_OK;
2217 }
2218
2220 {
2221 if (m_hWnd != NULL)
2222 {
2225 0,
2226 0);
2227 }
2228
2229 return S_OK;
2230 }
2231
2233 {
2234 return m_hWnd;
2235 }
2236
2238 {
2239 return (m_hWnd == hWnd ||
2241 }
2242
2244 {
2245 return IsPosHorizontal();
2246 }
2247
2249 {
2250 BOOL bPrevLock = g_TaskbarSettings.bLock;
2251
2252 if (g_TaskbarSettings.bLock != bLock)
2253 {
2254 g_TaskbarSettings.bLock = bLock;
2255
2256 if (m_TrayBandSite != NULL)
2257 {
2258 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2259 {
2260 /* Reset?? */
2261 g_TaskbarSettings.bLock = bPrevLock;
2262 return bPrevLock;
2263 }
2264 }
2265
2266 if (m_Theme)
2267 {
2268 /* Update cached tray sizes */
2269 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2270 {
2271 RECT rcGripper = {0};
2272 AdjustSizerRect(&rcGripper, Pos);
2273
2275 {
2276 m_TrayRects[Pos].top += rcGripper.top;
2277 m_TrayRects[Pos].left += rcGripper.left;
2278 m_TrayRects[Pos].bottom += rcGripper.bottom;
2279 m_TrayRects[Pos].right += rcGripper.right;
2280 }
2281 else
2282 {
2283 m_TrayRects[Pos].top -= rcGripper.top;
2284 m_TrayRects[Pos].left -= rcGripper.left;
2285 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2286 m_TrayRects[Pos].right -= rcGripper.right;
2287 }
2288 }
2289 }
2293 }
2294
2295 return bPrevLock;
2296 }
2297
2298 /* The task window is visible and non-WS_EX_TOOLWINDOW and
2299 { has WS_EX_APPWINDOW style or has no owner } and is none of explorer's
2300 special windows (such as the desktop or the tray window) */
2302 {
2304 {
2306 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2307 !(exStyle & WS_EX_TOOLWINDOW))
2308 {
2309 return TRUE;
2310 }
2311 }
2312 return FALSE;
2313 }
2314
2315 /*
2316 * IContextMenu
2317 */
2319 UINT indexMenu,
2320 UINT idCmdFirst,
2321 UINT idCmdLast,
2322 UINT uFlags)
2323 {
2324 if (!m_ContextMenu)
2325 {
2328 return hr;
2329 }
2330
2331 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2332 }
2333
2335 {
2336 if (!m_ContextMenu)
2337 return E_INVALIDARG;
2338
2339 return m_ContextMenu->InvokeCommand(lpici);
2340 }
2341
2343 UINT uType,
2344 UINT *pwReserved,
2345 LPSTR pszName,
2346 UINT cchMax)
2347 {
2348 if (!m_ContextMenu)
2349 return E_INVALIDARG;
2350
2351 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2352 }
2353
2354 /**********************************************************
2355 * ##### message handling #####
2356 */
2357
2359 {
2360 HRESULT hRet;
2361
2362 ((ITrayWindow*)this)->AddRef();
2363
2364 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2365
2366 /* Create the Start button */
2368
2369 /* Load the saved tray window settings */
2371
2372 /* Create and initialize the start menu */
2376
2377 /* Create the task band */
2379 if (FAILED_UNEXPECTEDLY(hRet))
2380 return FALSE;
2381
2382 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2384 if (FAILED_UNEXPECTEDLY(hRet))
2385 return FALSE;
2386
2387 /* Create the tray notification window */
2389 if (FAILED_UNEXPECTEDLY(hRet))
2390 return FALSE;
2391
2392 /* Get the hwnd of the rebar */
2394 if (FAILED_UNEXPECTEDLY(hRet))
2395 return FALSE;
2396
2397 /* Get the hwnd of the tasks toolbar */
2399 if (FAILED_UNEXPECTEDLY(hRet))
2400 return FALSE;
2401
2402 /* Get the hwnd of the tray notification window */
2404 if (FAILED_UNEXPECTEDLY(hRet))
2405 return FALSE;
2406
2409 return FALSE;
2410
2411 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2412
2413 UpdateFonts();
2414
2416
2417 if (IsAutoHideState())
2418 {
2421 }
2422
2423 /* Set the initial lock state in the band site */
2425
2426 static const UINT winkeys[] =
2427 {
2440 };
2442 {
2443 for (UINT i = 0; i < _countof(winkeys); ++i)
2444 {
2445 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2446 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2447 }
2448 }
2449
2450 m_WinMMDevChgMsg = RegisterWindowMessageW(L"winmm_devicechange");
2451
2452 return TRUE;
2453 }
2454
2456 {
2457 return 0;
2458 }
2459
2461 {
2462 if (wParam)
2463 SaveState();
2464 return 0;
2465 }
2466
2468 {
2469 if (m_Theme)
2471
2472 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2473
2474 if (m_Theme)
2475 {
2477 }
2478 else
2479 {
2481 }
2483
2484 return TRUE;
2485 }
2486
2488 {
2489 if (wParam == SPI_SETNONCLIENTMETRICS)
2490 {
2493 UpdateFonts();
2496 }
2497
2498 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2499 if (m_DesktopWnd)
2501
2502 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2503 {
2504 HideStartMenu();
2505
2507#if 1 // FIXME: Please re-use the start menu
2508 /* Re-create the start menu */
2512 FIXME("Use UpdateStartMenu\n");
2513#else
2514 // Update the start menu
2517#endif
2518 }
2519
2520 return 0;
2521 }
2522
2524 {
2525 HDC hdc = (HDC) wParam;
2526
2527 if (!m_Theme)
2528 {
2529 bHandled = FALSE;
2530 return 0;
2531 }
2532
2534 }
2535
2537 {
2538 /* Refresh workareas */
2540
2541 /* Load the saved tray window settings */
2543
2544 /* Move the tray window to the right position and resize it if necessary */
2546
2547 return TRUE;
2548 }
2549
2551 {
2553 if (!pCopyData)
2554 return FALSE;
2555
2556 switch (pCopyData->dwData)
2557 {
2558 case TABDMC_APPBAR:
2559 return OnAppBarMessage(pCopyData);
2560 case TABDMC_NOTIFY:
2561 case TABDMC_LOADINPROC:
2562 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2563 }
2564 return FALSE;
2565 }
2566
2567 // We have to draw non-client area because the 'Show Desktop' button is beyond client area.
2569 {
2570 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2571 return;
2573 }
2574
2576 {
2577 DefWindowProc(uMsg, wParam, lParam);
2578 bHandled = TRUE;
2579
2581 {
2582 DrawShowDesktopButton(); // We have to draw non-client area
2583 return 0;
2584 }
2585
2586 DrawSizerWithTheme((HRGN) wParam);
2587 DrawShowDesktopButton(); // We have to draw non-client area
2588 return 0;
2589 }
2590
2592 {
2595 }
2596
2598 {
2599 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2600 }
2601
2603 {
2604 RECT rcClient;
2605 POINT pt;
2606
2608 {
2609 /* The user may not be able to resize the tray window.
2610 Pretend like the window is not sizeable when the user
2611 clicks on the border. */
2612 return HTBORDER;
2613 }
2614
2616 if (GetClientRect(&rcClient) &&
2617 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2618 {
2619 pt.x = GET_X_LPARAM(lParam);
2620 pt.y = GET_Y_LPARAM(lParam);
2621
2623 return HTBORDER;
2624
2625 if (PtInRect(&rcClient, pt))
2626 {
2627 /* The user is trying to drag the tray window */
2628 return HTCAPTION;
2629 }
2630
2631 /* Depending on the position of the tray window, allow only
2632 changing the border next to the monitor working area */
2633 switch (m_Position)
2634 {
2635 case ABE_TOP:
2636 if (pt.y > rcClient.bottom)
2637 return HTBOTTOM;
2638 break;
2639 case ABE_LEFT:
2640 if (pt.x > rcClient.right)
2641 return HTRIGHT;
2642 break;
2643 case ABE_RIGHT:
2644 if (pt.x < rcClient.left)
2645 return HTLEFT;
2646 break;
2647 case ABE_BOTTOM:
2648 default:
2649 if (pt.y < rcClient.top)
2650 return HTTOP;
2651 break;
2652 }
2653 }
2654 return HTBORDER;
2655 }
2656
2658 {
2659 POINT ptCursor;
2660 PRECT pRect = (PRECT) lParam;
2661
2662 /* We need to ensure that an application can not accidently
2663 move the tray window (using SetWindowPos). However, we still
2664 need to be able to move the window in case the user wants to
2665 drag the tray window to another position or in case the user
2666 wants to resize the tray window. */
2667 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2668 {
2669 IsDragging = TRUE;
2671 }
2672 else
2673 {
2674 *pRect = m_TrayRects[m_Position];
2675 }
2676 return TRUE;
2677 }
2678
2680 {
2681 PRECT pRect = (PRECT) lParam;
2682
2684 {
2685 FitToRebar(pRect);
2686 }
2687 else
2688 {
2689 *pRect = m_TrayRects[m_Position];
2690 }
2691 return TRUE;
2692 }
2693
2695 {
2697 return TRUE;
2698 }
2699
2701 {
2702 RECT rcClient;
2703 if (wParam == SIZE_RESTORED && lParam == 0)
2704 {
2706 /* Clip the tray window on multi monitor systems so the edges can't
2707 overlap into another monitor */
2709
2710 if (!GetClientRect(&rcClient))
2711 {
2712 return FALSE;
2713 }
2714 }
2715 else
2716 {
2717 rcClient.left = rcClient.top = 0;
2718 rcClient.right = LOWORD(lParam);
2719 rcClient.bottom = HIWORD(lParam);
2720 }
2721
2722 AlignControls(&rcClient);
2723 return TRUE;
2724 }
2725
2727 {
2728 InSizeMove = TRUE;
2729 IsDragging = FALSE;
2731 {
2732 /* Remove the clipping on multi monitor systems while dragging around */
2734 }
2736 return TRUE;
2737 }
2738
2740 {
2741 InSizeMove = FALSE;
2743 {
2745
2746 /* Apply clipping */
2748 }
2749 return TRUE;
2750 }
2751
2753 {
2754 switch (wParam)
2755 {
2756 case TEXT(' '):
2757 {
2758 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2759 The tray window needs to handle this specially, since it normally doesn't have
2760 a system menu. */
2761
2762 static const UINT uidDisableItem [] = {
2763 SC_RESTORE,
2764 SC_MOVE,
2765 SC_SIZE,
2768 };
2769 HMENU hSysMenu;
2770 UINT i, uId;
2771
2772 /* temporarily enable the system menu */
2774
2775 hSysMenu = GetSystemMenu(FALSE);
2776 if (hSysMenu != NULL)
2777 {
2778 /* Disable all items that are not relevant */
2779 for (i = 0; i < _countof(uidDisableItem); i++)
2780 {
2781 EnableMenuItem(hSysMenu,
2782 uidDisableItem[i],
2784 }
2785
2786 EnableMenuItem(hSysMenu,
2787 SC_CLOSE,
2788 MF_BYCOMMAND |
2790
2791 /* Display the system menu */
2792 uId = TrackMenu(
2793 hSysMenu,
2794 NULL,
2797 FALSE);
2798 if (uId != 0)
2799 {
2801 }
2802 }
2803
2804 /* revert the system menu window style */
2806 break;
2807 }
2808
2809 default:
2810 bHandled = FALSE;
2811 }
2812 return TRUE;
2813 }
2814
2816 {
2817 if (!ppt || !prcStartBtn || !pwi)
2818 return FALSE;
2819
2820 switch (m_Position)
2821 {
2822 case ABE_TOP:
2823 case ABE_LEFT:
2824 {
2825 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2826 return FALSE;
2827 break;
2828 }
2829 case ABE_RIGHT:
2830 {
2831 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2832 return FALSE;
2833
2834 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2835 ppt->x > prcStartBtn->right)
2836 {
2837 return FALSE;
2838 }
2839 break;
2840 }
2841 case ABE_BOTTOM:
2842 {
2843 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2844 return FALSE;
2845
2846 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2847 ppt->y > prcStartBtn->bottom)
2848 {
2849 return FALSE;
2850 }
2851
2852 break;
2853 }
2854 }
2855 return TRUE;
2856 }
2857
2859 {
2860 if (!ppt || !prcShowDesktopBtn)
2861 return FALSE;
2863
2864 switch (m_Position)
2865 {
2866 case ABE_LEFT:
2867 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2868 case ABE_TOP:
2869 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2870 case ABE_RIGHT:
2871 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2872 case ABE_BOTTOM:
2873 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2874 }
2875 return FALSE;
2876 }
2877
2883 {
2885 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2886
2887 bHandled = FALSE;
2888
2889 RECT rcStartBtn;
2890 m_StartButton.GetWindowRect(&rcStartBtn);
2891 GetWindowInfo(m_hWnd, &wi);
2892
2893 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2894 {
2895 bHandled = TRUE;
2897 return 0;
2898 }
2899
2902
2903 return 0;
2904 }
2905
2907 {
2908 /* We want the user to be able to get a context menu even on the nonclient
2909 area (including the sizing border)! */
2910 uMsg = WM_CONTEXTMENU;
2911 wParam = (WPARAM) m_hWnd;
2912
2913 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2914 }
2915
2917 {
2918 LRESULT Ret = FALSE;
2919 POINT pt, *ppt = NULL;
2920 HWND hWndExclude = NULL;
2921
2922 /* Check if the administrator has forbidden access to context menus */
2924 return FALSE;
2925
2926 pt.x = (SHORT) LOWORD(lParam);
2927 pt.y = (SHORT) HIWORD(lParam);
2928
2929 if (pt.x != -1 || pt.y != -1)
2930 ppt = &pt;
2931 else
2932 hWndExclude = m_StartButton.m_hWnd;
2933
2935 {
2936 /* Make sure we can't track the context menu if the start
2937 menu is currently being shown */
2939 {
2940 CComPtr<IContextMenu> ctxMenu;
2942 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2943 }
2944 }
2945 else
2946 {
2947 /* See if the context menu should be handled by the task band site */
2948 if (ppt != NULL && m_TrayBandSite != NULL)
2949 {
2950 HWND hWndAtPt;
2951 POINT ptClient = *ppt;
2952
2953 /* Convert the coordinates to client-coordinates */
2954 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2955
2956 hWndAtPt = ChildWindowFromPoint(ptClient);
2957 if (hWndAtPt != NULL &&
2958 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2959 {
2960 /* Check if the user clicked on the task switch window */
2961 ptClient = *ppt;
2962 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2963
2965 if (hWndAtPt == m_TaskSwitch)
2966 goto HandleTrayContextMenu;
2967
2968 /* Forward the message to the task band site */
2969 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2970 }
2971 else
2972 goto HandleTrayContextMenu;
2973 }
2974 else
2975 {
2976HandleTrayContextMenu:
2977 /* Tray the default tray window context menu */
2978 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2979 }
2980 }
2981 return Ret;
2982 }
2983
2985 {
2986 LRESULT Ret = FALSE;
2987 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
2988 the rebar control! But we shouldn't forward messages that the band
2989 site doesn't handle, such as other controls (start button, tray window) */
2990
2991 HRESULT hr = E_FAIL;
2992
2993 if (m_TrayBandSite)
2994 {
2995 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2996 if (SUCCEEDED(hr))
2997 return Ret;
2998 }
2999
3000 if (m_TrayBandSite == NULL || FAILED(hr))
3001 {
3002 const NMHDR *nmh = (const NMHDR *) lParam;
3003
3004 if (nmh->hwndFrom == m_TrayNotify)
3005 {
3006 switch (nmh->code)
3007 {
3008 case NTNWM_REALIGN:
3009 /* Cause all controls to be aligned */
3011 break;
3012 }
3013 }
3014 }
3015 return Ret;
3016 }
3017
3019 {
3020 /* Let the clock handle the double-click */
3022
3023 /* We "handle" this message so users can't cause a weird maximize/restore
3024 window animation when double-clicking the tray window! */
3025 return TRUE;
3026 }
3027
3029 {
3030 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
3031 {
3034 bHandled = TRUE;
3035 }
3036
3037 return FALSE;
3038 }
3039
3041 {
3043 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
3044 return FALSE;
3045 }
3046
3048 {
3049 DestroyWindow();
3050 return TRUE;
3051 }
3052
3054 {
3055 HWND hwndStartMenu;
3056 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3058 return FALSE;
3059
3060 if (::IsWindowVisible(hwndStartMenu))
3061 HideStartMenu();
3062 else
3064
3065 return TRUE;
3066 }
3067
3069 {
3070 /*
3071 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3072 * to show the shutdown dialog. Also a WM_CLOSE message sent
3073 * by apps should show the dialog.
3074 */
3075 return DoExitWindows();
3076 }
3077
3079 {
3080 if (wParam == SC_CLOSE)
3081 {
3082 return DoExitWindows();
3083 }
3084
3085 bHandled = FALSE;
3086 return TRUE;
3087 }
3088
3090 {
3091 bHandled = TRUE;
3092 return (LRESULT)m_TaskSwitch;
3093 }
3094
3095 // TWM_SETZORDER
3097 {
3098 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3100 }
3101
3102 STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
3103 {
3104 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3105 return S_OK;
3106 }
3107
3109 {
3110 return HandleHotKey(wParam);
3111 }
3112
3114 {
3120 };
3121
3123 {
3124 WCHAR szClass[32];
3125 GetClassNameW(hwnd, szClass, _countof(szClass));
3126 return wcscmp(szClass, L"#32770") == 0;
3127 }
3128
3130 {
3132 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3133 return TRUE; // Ignore special windows
3134
3135 if (!info->bShowDesktop)
3136 {
3138 return TRUE;
3139 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3140 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3141 return TRUE;
3142 }
3143
3144 if (CanBeMinimized(hwnd))
3145 {
3146 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3147 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3149 {
3150 info->pMinimizedAll->Add(mwp);
3151 }
3152 }
3153
3154 return TRUE;
3155 }
3156
3157 VOID MinimizeAll(BOOL bShowDesktop = FALSE)
3158 {
3160 info.hwndDesktop = GetDesktopWindow();;
3161 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3162 info.hwndProgman = FindWindowW(L"Progman", NULL);
3163 info.pMinimizedAll = &g_MinimizedAll;
3164 info.bShowDesktop = bShowDesktop;
3166
3169 }
3170
3172 {
3174 }
3175
3177 {
3178 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3179 {
3180 HWND hwnd = g_MinimizedAll[i].hwnd;
3183 }
3184
3186 }
3187
3189 {
3190 LRESULT Ret = FALSE;
3191
3193 {
3194 return FALSE;
3195 }
3196
3197 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3198 {
3199 return HandleCommand(LOWORD(wParam));
3200 }
3201 return Ret;
3202 }
3203
3205 {
3207
3208 if (IsAutoHideState())
3209 {
3211 }
3212
3213 return TRUE;
3214 }
3215
3217 {
3218 switch (wParam)
3219 {
3222 break;
3223 case TIMER_ID_AUTOHIDE:
3225 break;
3226 default:
3227 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3228 bHandled = FALSE;
3229 break;
3230 }
3231 return 0;
3232 }
3233
3235 {
3237 DrawShowDesktopButton(); // We have to draw non-client area
3238 bHandled = TRUE;
3239 return ret;
3240 }
3241
3243 {
3244 RECT *rc = NULL;
3245 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3247 {
3248 bHandled = FALSE;
3249 return 0;
3250 }
3251 if(!wParam)
3252 {
3253 rc = (RECT*)wParam;
3254 }
3255 else
3256 {
3258 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3259 {
3260 bHandled = FALSE;
3261 return 0;
3262 }
3263 rc = &prms->rgrc[0];
3264 }
3265
3267
3268 return 0;
3269 }
3270
3272 {
3273 HMENU hMenu = (HMENU)wParam;
3275 {
3279 if (g_Arrangement != NONE)
3280 {
3283 MENUITEMINFOW mii = { sizeof(mii) };
3285 mii.fMask = MIIM_TYPE;
3286 mii.fType = MFT_STRING;
3287 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3289 }
3290 else
3291 {
3293 }
3294 }
3295 else
3296 {
3302 g_WindowPosBackup.RemoveAll();
3303 }
3304 return 0;
3305 }
3306
3307 // WM_ACTIVATE
3309 {
3311 if (!wParam) // !(Activate || Minimized)
3312 {
3313 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3315 }
3316 return 0;
3317 }
3318
3319 // WM_SETFOCUS
3321 {
3323 return 0;
3324 }
3325
3326 // WM_GETMINMAXINFO
3328 {
3330 SIZE StartSize = m_StartButton.GetSize();
3331 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3332 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3333 return 0;
3334 }
3335
3337 {
3338#if 0
3339 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3340
3341 if (!as->fChanged)
3342 return 0;
3343
3344 RECT rc;
3345 ::GetWindowRect(m_hWnd, &rc);
3346
3347 SIZE szWindow = {
3348 rc.right - rc.left,
3349 rc.bottom - rc.top };
3350 SIZE szTarget = {
3351 as->rcTarget.right - as->rcTarget.left,
3352 as->rcTarget.bottom - as->rcTarget.top };
3353 SIZE szActual = {
3354 as->rcActual.right - as->rcActual.left,
3355 as->rcActual.bottom - as->rcActual.top };
3356
3357 SIZE borders = {
3358 szWindow.cx - szTarget.cx,
3359 szWindow.cy - szTarget.cx,
3360 };
3361
3362 switch (m_Position)
3363 {
3364 case ABE_LEFT:
3365 szWindow.cx = szActual.cx + borders.cx;
3366 break;
3367 case ABE_TOP:
3368 szWindow.cy = szActual.cy + borders.cy;
3369 break;
3370 case ABE_RIGHT:
3371 szWindow.cx = szActual.cx + borders.cx;
3372 rc.left = rc.right - szWindow.cy;
3373 break;
3374 case ABE_BOTTOM:
3375 szWindow.cy = szActual.cy + borders.cy;
3376 rc.top = rc.bottom - szWindow.cy;
3377 break;
3378 }
3379
3380 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3381#else
3382 bHandled = FALSE;
3383#endif
3384 return 0;
3385 }
3386
3388 {
3389 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3390
3391 /* Propagate the new settings to the children */
3394
3395 /* Toggle autohide */
3396 SetAutoHideState(newSettings->sr.AutoHide);
3397
3398 /* Toggle lock state */
3399 Lock(newSettings->bLock);
3400
3401 /* Toggle OnTop state */
3402 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3403
3404 /* Adjust taskbar size */
3406
3408 return 0;
3409 }
3410
3412
3415 {
3416 MSG Msg;
3417 LRESULT lRet;
3418
3419 Msg.hwnd = m_hWnd;
3420 Msg.message = uMsg;
3421 Msg.wParam = wParam;
3422 Msg.lParam = lParam;
3423
3424 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3425 {
3426 return lRet;
3427 }
3428
3429 wParam = Msg.wParam;
3430 lParam = Msg.lParam;
3431 }
3432 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
3434 NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnRebarAutoSize) // Doesn't quite work ;P
3446 MESSAGE_HANDLER(WM_DISPLAYCHANGE, OnDisplayChange)
3479 ALT_MSG_MAP(1)
3480 END_MSG_MAP()
3481
3482 /*****************************************************************************/
3483
3485 {
3486 /* CTaskSwitchWnd does not receive this message directly */
3488 return TRUE;
3489 }
3490
3492 {
3493 MSG Msg;
3494
3495 /* FIXME: We should keep a reference here... */
3496
3497 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3498 {
3499 if (Msg.message == WM_QUIT)
3500 break;
3501
3502 if (m_StartMenuBand == NULL ||
3503 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3504 {
3507 }
3508 }
3509 }
3510
3512 {
3513 MSG Msg;
3514 BOOL Ret;
3515
3516 /* FIXME: We should keep a reference here... */
3517
3518 while (true)
3519 {
3520 Ret = GetMessage(&Msg, NULL, 0, 0);
3521
3522 if (!Ret || Ret == -1)
3523 break;
3524
3525 if (m_StartMenuBand == NULL ||
3526 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3527 {
3530 }
3531 }
3532 }
3533
3534 /*
3535 * IShellDesktopTray
3536 *
3537 * NOTE: this is a very windows-specific COM interface used by SHCreateDesktop()!
3538 * These are the calls I observed, it may be wrong/incomplete/buggy!!!
3539 * The reason we implement it is because we have to use SHCreateDesktop() so
3540 * that the shell provides the desktop window and all the features that come
3541 * with it (especially positioning of desktop icons)
3542 */
3543
3545 GetState() override
3546 {
3547 /* FIXME: Return ABS_ flags? */
3548 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3549 return 0;
3550 }
3551
3553 GetTrayWindow(OUT HWND *phWndTray) override
3554 {
3555 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3556 *phWndTray = m_hWnd;
3557 return S_OK;
3558 }
3559
3561 RegisterDesktopWindow(IN HWND hWndDesktop) override
3562 {
3563 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3564
3565 m_DesktopWnd = hWndDesktop;
3566 return S_OK;
3567 }
3568
3570 Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
3571 {
3572 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3573 return S_OK;
3574 }
3575
3577 {
3578 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3579 return S_OK;
3580 }
3581
3582 // *** IOleWindow methods ***
3583
3585 GetWindow(HWND* phwnd) override
3586 {
3587 if (!phwnd)
3588 return E_INVALIDARG;
3589 *phwnd = m_hWnd;
3590 return S_OK;
3591 }
3592
3594 ContextSensitiveHelp(BOOL fEnterMode) override
3595 {
3596 return E_NOTIMPL;
3597 }
3598
3599 void _Init()
3600 {
3601 m_Position = (DWORD) -1;
3602 }
3603
3605
3608 /*COM_INTERFACE_ENTRY_IID(IID_ITrayWindow, ITrayWindow)*/
3611 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3612 END_COM_MAP()
3613
3614protected:
3616 // AppBar section
3617 //
3618 // See also: appbar.cpp
3619 // TODO: freedesktop _NET_WM_STRUT integration
3620 // TODO: find when a fullscreen app is in the foreground and send FULLSCREENAPP notifications
3621 // TODO: multiple monitor support
3622
3623 BOOL IsAutoHideState() const override { return g_TaskbarSettings.sr.AutoHide; }
3624 BOOL IsHidingState() const override { return m_AutoHideState == AUTOHIDE_HIDING; }
3626 HMONITOR& GetMonitor() override { return m_Monitor; }
3628 INT GetPosition() const override { return m_Position; }
3629 const RECT* GetTrayRect() override { return &m_TrayRects[m_Position]; }
3630 HWND GetTrayWnd() const override { return m_hWnd; }
3631 HWND GetDesktopWnd() const override { return m_DesktopWnd; }
3632
3633 void SetAutoHideState(_In_ BOOL bAutoHide) override
3634 {
3635 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3637
3639 if (bAutoHide)
3641 else
3643 }
3644
3645 void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
3646 {
3647 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3648 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3649 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3650 }
3651};
3652
3654 public CComCoClass<CTrayWindowCtxMenu>,
3655 public CComObjectRootEx<CComMultiThreadModelNoCS>,
3656 public IContextMenu
3657{
3662
3663public:
3664 HRESULT Initialize(ITrayWindow * pTrayWnd, IN HWND hWndOwner)
3665 {
3666 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3667 this->hWndOwner = hWndOwner;
3668 this->m_idCmdCmFirst = 0;
3669 return S_OK;
3670 }
3671
3674 UINT indexMenu,
3675 UINT idCmdFirst,
3676 UINT idCmdLast,
3677 UINT uFlags) override
3678 {
3679 HMENU hMenuBase;
3680
3682 if (!hMenuBase)
3684
3686 {
3688 MENUITEMINFOW mii = { sizeof(mii) };
3689 mii.fMask = MIIM_ID | MIIM_TYPE;
3691 mii.fType = MFT_STRING;
3692 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3694 }
3695
3697 {
3698 DeleteMenu(hPopup,
3700 MF_BYCOMMAND);
3701 }
3702
3703 CheckMenuItem(hMenuBase,
3706
3707 UINT idCmdNext;
3708 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3709 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3710
3711 ::DestroyMenu(hMenuBase);
3712
3713 if (TrayWnd->m_TrayBandSite != NULL)
3714 {
3715 pcm.Release();
3716 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3717 hPopup,
3718 indexMenu,
3719 idCmdNext,
3720 idCmdLast,
3721 CMF_NORMAL,
3722 &pcm)))
3723 {
3724 WARN("AddContextMenus failed.\n");
3725 pcm.Release();
3726 }
3727 }
3728
3729 return S_OK;
3730 }
3731
3734 {
3735 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3736 if (uiCmdId != 0)
3737 {
3738 if (uiCmdId >= m_idCmdCmFirst)
3739 {
3740 CMINVOKECOMMANDINFO cmici = { 0 };
3741
3742 if (pcm != NULL)
3743 {
3744 /* Setup and invoke the shell command */
3745 cmici.cbSize = sizeof(cmici);
3746 cmici.hwnd = hWndOwner;
3747 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3748 cmici.nShow = SW_NORMAL;
3749
3750 pcm->InvokeCommand(&cmici);
3751 }
3752 }
3753 else
3754 {
3755 TrayWnd->ExecContextMenuCmd(uiCmdId);
3756 }
3757 }
3758
3759 return S_OK;
3760 }
3761
3764 UINT_PTR idCmd,
3765 UINT uType,
3766 UINT *pwReserved,
3767 LPSTR pszName,
3768 UINT cchMax) override
3769 {
3770 return E_NOTIMPL;
3771 }
3772
3774 {
3775 }
3776
3778 {
3779 }
3780
3782 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3783 END_COM_MAP()
3784};
3785
3786HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu)
3787{
3789 mnu->Initialize(TrayWnd, hWndOwner);
3790 *ppCtxMenu = mnu;
3791 return S_OK;
3792}
3793
3794HRESULT CreateTrayWindow(ITrayWindow ** ppTray)
3795{
3797 if (Tray == NULL)
3798 return E_OUTOFMEMORY;
3799
3800 Tray->_Init();
3801 Tray->Open();
3802
3803 *ppTray = (ITrayWindow *) Tray;
3804
3805 return S_OK;
3806}
3807
3808HRESULT
3810{
3811 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3812 return TrayWindow->RaiseStartButton();
3813}
3814
3815VOID TrayProcessMessages(ITrayWindow *Tray)
3816{
3817 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3818 TrayWindow->TrayProcessMessages();
3819}
3820
3821VOID TrayMessageLoop(ITrayWindow *Tray)
3822{
3823 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3824 TrayWindow->TrayMessageLoop();
3825}
#define IID_PPV_ARG(Itype, ppType)
@ TS_TRUE
std::map< E_MODULE, HMODULE > mod
Definition: LocaleTests.cpp:68
UINT cchMax
static int state
Definition: maze.c:121
HWND hWnd
Definition: settings.c:17
#define IDB_START
Definition: resource.h:75
#define IDS_START
Definition: resource.h:25
static RECT margins
Definition: print.c:55
@ 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
VOID DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar)
Definition: trayprop.cpp:363
#define TWM_OPENSTARTMENU
Definition: precomp.h:133
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
Definition: startmnu.cpp:24
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:397
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:380
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
#define TWM_GETTASKSWITCH
Definition: precomp.h:132
IMenuPopup * CreateStartMenu(IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:51
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:555
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:728
#define TWM_SETTINGSCHANGED
Definition: precomp.h:134
#define TNWM_GETSHOWDESKTOPBUTTON
Definition: precomp.h:382
static LONG SetWindowStyle(IN HWND hWnd, IN LONG dwStyleMask, IN LONG dwStyle)
Definition: precomp.h:75
#define NTNWM_REALIGN
Definition: precomp.h:384
HRESULT InitShellServices(HDPA *phdpa)
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:348
VOID ClearRecentAndMru()
HRESULT ShutdownShellServices(HDPA hdpa)
#define TWM_SETZORDER
Definition: precomp.h:135
#define IDM_SEARCH
Definition: resource.h:77
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:215
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:221
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:216
#define IDS_RESTORE_ALL
Definition: resource.h:111
#define IDM_TRAYWND
Definition: resource.h:63
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:211
#define IDB_STARTMENU
Definition: resource.h:44
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:219
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:113
#define IDC_STARTBTN
Definition: resource.h:151
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:220
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:223
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:218
#define ID_LOCKTASKBAR
Definition: resource.h:214
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:217
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:112
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:213
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:222
#define IDS_HELP_COMMAND
Definition: resource.h:109
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:212
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHODIMP_(t)
Definition: basetyps.h:44
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
CONFIGRET WINAPI CM_Request_Eject_PC(VOID)
Definition: cfgmgr.c:7767
void Release()
Definition: atlcomcli.h:170
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
Definition: cstringt.h:658
BOOL IsIconic() const
Definition: atlwin.h:932
HWND GetLastActivePopup() const
Definition: atlwin.h:676
HWND SetFocus()
Definition: atlwin.h:1198
BOOL DestroyWindow()
Definition: atlwin.h:462
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
HDC GetWindowDC()
Definition: atlwin.h:784
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:456
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
CWindow GetParent() const
Definition: atlwin.h:700
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL UpdateWindow()
Definition: atlwin.h:1345
HWND m_hWnd
Definition: atlwin.h:273
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL IsWindowEnabled() const
Definition: atlwin.h:952
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1044
void OnAppBarActivationChange2(_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
Definition: appbar.cpp:475
void OnAppBarNotifyAll(_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
Definition: appbar.cpp:207
void RecomputeAllWorkareas()
Definition: appbar.cpp:449
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
HIMAGELIST m_ImageList
Definition: traywnd.cpp:183
VOID Initialize()
Definition: traywnd.cpp:242
VOID UpdateFont()
Definition: traywnd.cpp:226
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:293
SIZE GetSize()
Definition: traywnd.cpp:205
VOID UpdateSize()
Definition: traywnd.cpp:210
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:262
HFONT m_Font
Definition: traywnd.cpp:185
virtual ~CStartButton()
Definition: traywnd.cpp:196
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
BOOL PtInButton(LPPOINT pt) const
HRESULT Initialize(ITrayWindow *pTrayWnd, IN HWND hWndOwner)
Definition: traywnd.cpp:3664
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
Definition: traywnd.cpp:3733
STDMETHODIMP QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition: traywnd.cpp:3673
virtual ~CTrayWindowCtxMenu()
Definition: traywnd.cpp:3777
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3659
STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
Definition: traywnd.cpp:3763
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3660
LRESULT OnHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3108
LRESULT OnEnterSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2726
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:635
DWORD m_DraggingPosition
Definition: traywnd.cpp:339
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2487
HWND m_TaskSwitch
Definition: traywnd.cpp:331
LRESULT OnSysColorChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2597
VOID ResizeWorkArea()
Definition: traywnd.cpp:1581
VOID ToggleDesktop()
Definition: traywnd.cpp:645
DWORD Flags
Definition: traywnd.cpp:361
BOOL IsHidingState() const override
Definition: traywnd.cpp:3624
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3633
LRESULT OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2739
LRESULT OnSetZOrder(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3096
LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2467
HWND m_Rebar
Definition: traywnd.cpp:330
VOID ShowDesktop()
Definition: traywnd.cpp:3171
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2575
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3387
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1331
HMONITOR m_Monitor
Definition: traywnd.cpp:337
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3204
CStartButton m_StartButton
Definition: traywnd.cpp:317
LRESULT OnDoExitWindows(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3068
HWND STDMETHODCALLTYPE GetHWND()
Definition: traywnd.cpp:2232
HMONITOR & GetPreviousMonitor() override
Definition: traywnd.cpp:3627
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1877
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:812
VOID RestoreAll()
Definition: traywnd.cpp:3176
LRESULT OnCtlColorBtn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2591
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:357
VOID ShowFolder(INT csidl, BOOL bExplore)
Definition: traywnd.cpp:749
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2138
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1104
LRESULT OnWinMMDeviceChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3484
DWORD m_Position
Definition: traywnd.cpp:336
const RECT * GetTrayRect() override
Definition: traywnd.cpp:3629
HTHEME m_Theme
Definition: traywnd.cpp:325
BOOL STDMETHODCALLTYPE IsHorizontal()
Definition: traywnd.cpp:2243
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:350
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:323
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:338
HDPA m_ShellServices
Definition: traywnd.cpp:352
LRESULT OnInitMenuPopup(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3271
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2523
DWORD WINAPI TrayPropertiesThread()
Definition: traywnd.cpp:560
SIZE m_TraySize
Definition: traywnd.cpp:343
LRESULT OnNcCalcSize(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3242
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1156
DWORD InSizeMove
Definition: traywnd.cpp:365
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2984
RECT m_TrayRects[4]
Definition: traywnd.cpp:342
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2550
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:535
GetState() override
Definition: traywnd.cpp:3545
VOID RegLoadSettings()
Definition: traywnd.cpp:1655
LRESULT OnNcRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2906
VOID TrayProcessMessages()
Definition: traywnd.cpp:3491
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:340
HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: traywnd.cpp:2342
LRESULT OnEndSession(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2460
BOOL STDMETHODCALLTYPE IsTaskWnd(HWND hWnd)
Definition: traywnd.cpp:2301
BOOL IsPointWithinShowDesktopButton(LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2858
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1269
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2122
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:321
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:596
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1194
STDMETHODIMP GetTrayWindow(OUT HWND *phWndTray) override
Definition: traywnd.cpp:3553
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1274
void ProcessMouseTracking()
Definition: traywnd.cpp:1960
INT GetPosition() const override
Definition: traywnd.cpp:3628
LRESULT OnNcLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3018
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2882
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2455
BOOL STDMETHODCALLTYPE Lock(IN BOOL bLock)
Definition: traywnd.cpp:2248
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1544
void RefreshStartMenuSettings()
Definition: traywnd.cpp:465
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2916
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3129
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3645
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3623
HRESULT STDMETHODCALLTYPE Open()
Definition: traywnd.cpp:2182
LRESULT OnGetTaskSwitch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3089
LRESULT OnSysChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2752
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3216
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:430
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:589
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:617
DWORD IsDragging
Definition: traywnd.cpp:366
UINT m_WinMMDevChgMsg
Definition: traywnd.cpp:354
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3122
HRESULT STDMETHODCALLTYPE Close()
Definition: traywnd.cpp:2219
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1633
LRESULT OnNcLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3028
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3078
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:334
UINT m_AutoHideState
Definition: traywnd.cpp:348
LRESULT OnMoving(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2657
void PopupStartMenu()
Definition: traywnd.cpp:1919
LRESULT OnSetFocus(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3320
LRESULT OnGetMinMaxInfo(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3327
void UpdateFonts()
Definition: traywnd.cpp:1073
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:763
STDMETHODIMP RegisterDesktopWindow(IN HWND hWndDesktop) override
Definition: traywnd.cpp:3561
HMONITOR & GetMonitor() override
Definition: traywnd.cpp:3626
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2679
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:318
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1733
LRESULT OnOpenStartMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3053
static DWORD CALLBACK EjectThreadProc(LPVOID arg)
Definition: traywnd.cpp:806
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:345
void DrawShowDesktopButton()
Definition: traywnd.cpp:2568
SIZE m_AutoHideOffset
Definition: traywnd.cpp:349
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2700
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3188
LRESULT OnAppTrayDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3047
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1223
HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: traywnd.cpp:2334
STDMETHODIMP Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
Definition: traywnd.cpp:3570
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: traywnd.cpp:3594
LRESULT OnActivate(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3308
BOOL IsAlwaysOnTop() const override
Definition: traywnd.cpp:3625
VOID HideStartMenu()
Definition: traywnd.cpp:744
VOID TrayMessageLoop()
Definition: traywnd.cpp:3511
HWND GetTrayWnd() const override
Definition: traywnd.cpp:3630
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1433
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2237
virtual ~CTrayWindow()
Definition: traywnd.cpp:399
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:346
HWND GetDesktopWnd() const override
Definition: traywnd.cpp:3631
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2602
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3157
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3585
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1248
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3040
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3576
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1131
LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3234
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:922
DWORD WINAPI RunFileDlgThread()
Definition: traywnd.cpp:499
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2358
DWORD NewPosSize
Definition: traywnd.cpp:367
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:993
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2536
void _Init()
Definition: traywnd.cpp:3599
LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2694
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2815
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:320
HFONT m_Font
Definition: traywnd.cpp:327
LRESULT DoExitWindows()
Definition: traywnd.cpp:470
void ProcessAutoHide()
Definition: traywnd.cpp:2007
HWND m_DesktopWnd
Definition: traywnd.cpp:329
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1451
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:324
void SaveState()
Definition: traywnd.cpp:454
HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: traywnd.cpp:2318
LRESULT OnRebarAutoSize(INT code, LPNMHDR nmhdr, BOOL &bHandled)
Definition: traywnd.cpp:3336
STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
Definition: traywnd.cpp:3102
BOOL STDMETHODCALLTYPE ExecContextMenuCmd(IN UINT uiCmd)
Definition: traywnd.cpp:657
void DisplayRunFileDlg()
Definition: traywnd.cpp:541
HWND m_TrayNotify
Definition: traywnd.cpp:332
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1803 Msg[]
static HWND hwndParent
Definition: cryptui.c:299
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#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
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
Definition: imagelist.c:2226
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
#define UINT_MAX
Definition: limits.h:27
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE thread_proc, void *data, DWORD flags, LPTHREAD_START_ROUTINE callback)
Definition: main.c:1628
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1541
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1604
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:400
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:1219
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1228
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:762
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:988
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1821
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890
#define pt(x, y)
Definition: drawing.c:79
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
#define PtrToUlong(u)
Definition: config.h:107
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLsizeiptr size
Definition: glext.h:5919
GLenum const GLfloat * params
Definition: glext.h:5645
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define C_ASSERT(e)
Definition: intsafe.h:73
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define TEXT(s)
Definition: k32.h:28
#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 ALT_MSG_MAP(map)
Definition: atlwin.h:1913
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:2004
if(dx< 0)
Definition: linetemp.h:194
#define HResultFromWin32
Definition: loader.cpp:14
static VOID SetFont(PMAP infoPtr, LPWSTR lpFontName)
Definition: map.c:220
#define ZeroMemory
Definition: minwinbase.h:31
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
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static BOOL protected
Definition: protectdata.c:33
static HRGN hRgn
Definition: mapping.c:32
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static MONITORINFO mi
Definition: win.c:9400
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
LPCSTR LPCTSTR
Definition: ms-dtyp.idl:130
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
HANDLE hThread
Definition: wizard.c:28
#define _In_
Definition: no_sal2.h:158
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#define DWORD
Definition: nt_native.h:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
const GUID IID_IOleWindow
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_SYSMENU
Definition: pedump.c:629
short WCHAR
Definition: pedump.c:58
#define WS_BORDER
Definition: pedump.c:625
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
short SHORT
Definition: pedump.c:59
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFT
Definition: pedump.c:692
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define WS_THICKFRAME
Definition: pedump.c:630
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwndOwner, int nFolder, BOOL fCreate)
Definition: pidl.c:446
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
#define RBSTR_CHANGERECT
Definition: commctrl.h:1596
#define BUTTON_IMAGELIST_ALIGN_LEFT
Definition: commctrl.h:4632
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
#define BCM_GETIDEALSIZE
Definition: commctrl.h:4644
#define CCS_VERT
Definition: commctrl.h:2254
#define BCM_SETIMAGELIST
Definition: commctrl.h:4647
#define RBN_AUTOSIZE
Definition: commctrl.h:1631
#define RB_SIZETORECT
Definition: commctrl.h:1598
#define WC_STATIC
Definition: commctrl.h:4687
struct tagNMRBAUTOSIZE * LPNMRBAUTOSIZE
#define WC_BUTTON
Definition: commctrl.h:4630
@ CTF_INSIST
Definition: shlwapi.h:71
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
#define RFF_CALCDIRECTORY
Definition: run.h:35
wcscpy
#define LoadStringW
Definition: utils.h:64
#define ABE_BOTTOM
Definition: shellapi.h:20
#define ShellExecute
Definition: shellapi.h:746
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_TOP
Definition: shellapi.h:18
#define ABN_FULLSCREENAPP
Definition: shellapi.h:74
#define ABE_LEFT
Definition: shellapi.h:17
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
#define ABN_WINDOWARRANGE
Definition: shellapi.h:75
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2488
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2732
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define SHGetSpecialFolderPath
Definition: shlobj.h:1547
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2212
#define CSIDL_PRINTERS
Definition: shlobj.h:2195
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2547
#define MM_ADDSEPARATOR
Definition: shlobj.h:2546
#define CSIDL_DRIVES
Definition: shlobj.h:2207
@ REST_CLASSICSHELL
Definition: shlobj.h:1697
@ REST_NOSAVESET
Definition: shlobj.h:1662
@ REST_NOSETFOLDERS
Definition: shlobj.h:1664
@ REST_NOWINKEYS
Definition: shlobj.h:1758
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1685
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1696
@ REST_NOCLOSE
Definition: shlobj.h:1661
#define CSIDL_CONTROLS
Definition: shlobj.h:2194
#define FCIDM_SHBROWSER_FINDCOMPUTER
Definition: shlobj_undoc.h:97
#define FCIDM_SHBROWSER_REFRESH
Definition: shlobj_undoc.h:93
#define FCIDM_SHBROWSER_FINDFILES
Definition: shlobj_undoc.h:96
#define FCIDM_CABINET_REFRESH
Definition: shlobj_undoc.h:102
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2593
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
_In_ PVOID Context
Definition: storport.h:2269
CSimpleArray< MINWNDPOS > * pMinimizedAll
Definition: traywnd.cpp:3118
HWND hwndDesktop
Definition: traywnd.cpp:106
HWND hwndProgman
Definition: traywnd.cpp:107
BOOL bMustBeInMonitor
Definition: traywnd.cpp:109
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:170
HWND hwnd
Definition: traywnd.cpp:169
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
TW_STRUCKRECTS2 sr
Definition: precomp.h:228
WINDOWPLACEMENT wplt
Definition: traywnd.cpp:52
Definition: dpa.c:49
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD AutoHide
Definition: precomp.h:207
DWORD AlwaysOnTop
Definition: precomp.h:208
DWORD SmSmallIcons
Definition: precomp.h:209
DWORD Position
Definition: precomp.h:213
UINT flags
Definition: winuser.h:3702
Definition: inflate.c:139
Definition: copy.c:22
ULONG_PTR dwData
Definition: winuser.h:3109
LPWSTR dwTypeData
Definition: winuser.h:3377
POINT ptMinTrackSize
Definition: winuser.h:3738
RECT rcMonitor
Definition: winuser.h:3893
DWORD cbSize
Definition: winuser.h:3892
PWINDOWPOS lppos
Definition: winuser.h:3707
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265
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
RECT rcExclude
Definition: winuser.h:3684
UINT cbSize
Definition: winuser.h:3683
UINT cxWindowBorders
Definition: winuser.h:3880
UINT cyWindowBorders
Definition: winuser.h:3881
RECT rcWindow
Definition: winuser.h:3875
static COORD Position
Definition: mouse.c:34
#define max(a, b)
Definition: svc.c:63
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:22
const GUID IID_IShellDesktopTray
Definition: traywnd.cpp:178
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:41
#define AUTOHIDE_SHOWN
Definition: traywnd.cpp:31
static BOOL CALLBACK BackupWindowsPosProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:56
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:54
VOID TrayProcessMessages(ITrayWindow *Tray)
Definition: traywnd.cpp:3815
#define IDHK_RUN
Definition: traywnd.cpp:34
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:27
@ TILED
Definition: traywnd.cpp:47
@ NONE
Definition: traywnd.cpp:47
@ CASCADED
Definition: traywnd.cpp:47
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:17
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:172
VOID TrayMessageLoop(ITrayWindow *Tray)
Definition: traywnd.cpp:3821
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:26
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3809
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:30
HRESULT CreateTrayWindow(ITrayWindow **ppTray)
Definition: traywnd.cpp:3794
#define IDHK_DESKTOP
Definition: traywnd.cpp:44
enum @123 g_Arrangement
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:88
#define IDHK_EXPLORE
Definition: traywnd.cpp:38
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:153
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:32
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:35
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:36
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:43
#define IDHK_PREV_TASK
Definition: traywnd.cpp:42
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:19
static BOOL CALLBACK FindEffectiveProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:113
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:29
VOID RestoreWindowPos()
Definition: traywnd.cpp:76
#define IDHK_FIND
Definition: traywnd.cpp:39
#define AUTOHIDE_INTERVAL_ANIMATING
Definition: traywnd.cpp:24
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:20
VOID BackupWindowPos()
Definition: traywnd.cpp:71
#define IDHK_HELP
Definition: traywnd.cpp:37
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:40
#define AUTOHIDE_DELAY_SHOW
Definition: traywnd.cpp:23
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:21
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3786
#define IDHK_PAGER
Definition: traywnd.cpp:45
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define MAKEWORD(a, b)
Definition: typedefs.h:248
uint16_t * LPWSTR
Definition: typedefs.h:56
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:1013
#define TRAYCMD_STARTMENU
Definition: undocshell.h:995
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:1016
#define TRAYCMD_REFRESH_MENU
Definition: undocshell.h:1021
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:1002
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:1020
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:1005
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:1008
#define TABDMC_APPBAR
Definition: undocshell.h:1024
#define TWM_DOEXITWINDOWS
Definition: undocshell.h:67
#define TRAYCMD_TILE_V
Definition: undocshell.h:1000
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:1011
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:1019
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:1010
#define TRAYCMD_TILE_H
Definition: undocshell.h:999
#define TRAYCMD_EJECT
Definition: undocshell.h:1004
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:1001
#define WM_PROGMAN_SAVESTATE
Definition: undocshell.h:74
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:996
#define TABDMC_LOADINPROC
Definition: undocshell.h:1026
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:997
#define TRAYCMD_CASCADE
Definition: undocshell.h:998
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:1009
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:1007
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:1014
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:1015
#define TRAYCMD_RELOAD_STARTMENUCFG
Definition: undocshell.h:1018
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:1006
#define TABDMC_NOTIFY
Definition: undocshell.h:1025
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:1017
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:1012
#define WC_DIALOG
Definition: undocuser.h:13
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
@ TBP_BACKGROUNDLEFT
Definition: vssym32.h:560
@ TBP_SIZINGBARRIGHT
Definition: vssym32.h:562
@ TBP_SIZINGBARBOTTOM
Definition: vssym32.h:561
@ TBP_BACKGROUNDRIGHT
Definition: vssym32.h:558
@ TBP_BACKGROUNDTOP
Definition: vssym32.h:559
@ TBP_SIZINGBARLEFT
Definition: vssym32.h:564
@ TBP_BACKGROUNDBOTTOM
Definition: vssym32.h:557
@ TBP_SIZINGBARTOP
Definition: vssym32.h:563
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
#define PRECT
Definition: precomp.h:27
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1869
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#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 S_FALSE
Definition: winerror.h:3451
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define TRANSPARENT
Definition: wingdi.h:950
#define HOLLOW_BRUSH
Definition: wingdi.h:899
#define FW_NORMAL
Definition: wingdi.h:373
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
#define CreateFontIndirect
Definition: wingdi.h:4890
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SW_SHOWNORMAL
Definition: winuser.h:781
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
#define GW_OWNER
Definition: winuser.h:777
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define CreateWindowEx
Definition: winuser.h:5921
#define GetMonitorInfo
Definition: winuser.h:5957
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define BM_GETSTATE
Definition: winuser.h:1949
#define WM_CLOSE
Definition: winuser.h:1649
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define MF_BYCOMMAND
Definition: winuser.h:202
#define WM_SYSCOMMAND
Definition: winuser.h:1769
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define LR_LOADTRANSPARENT
Definition: winuser.h:1104
#define VK_TAB
Definition: winuser.h:2235
#define SM_CYEDGE
Definition: winuser.h:1020
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MIIM_ID
Definition: winuser.h:733
#define WM_KEYUP
Definition: winuser.h:1744
#define SM_CYSCREEN
Definition: winuser.h:971
#define HTCAPTION
Definition: winuser.h:2512
#define HWND_TOPMOST
Definition: winuser.h:1219
#define SM_CXEDGE
Definition: winuser.h:1019
#define BST_UNCHECKED
Definition: winuser.h:199
#define MOD_WIN
Definition: winuser.h:2686
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1689
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
struct tagWINDOWINFO WINDOWINFO
#define HTBOTTOM
Definition: winuser.h:2529
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_SPACE
Definition: winuser.h:2255
#define HTBORDER
Definition: winuser.h:2533
#define WM_SIZE
Definition: winuser.h:1639
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
#define BM_SETSTATE
Definition: winuser.h:1952
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define SM_CXFRAME
Definition: winuser.h:1005
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1768
#define TPM_BOTTOMALIGN
Definition: winuser.h:2421
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define VK_CONTROL
Definition: winuser.h:2239
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
#define WM_NCHITTEST
Definition: winuser.h:1714
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define WM_SETFOCUS
Definition: winuser.h:1641
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_MOUSEMOVE
Definition: winuser.h:1803
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_ERASE
Definition: winuser.h:1222
#define CS_DBLCLKS
Definition: winuser.h:659
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1654
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
HWND WINAPI ChildWindowFromPointEx(_In_ HWND, _In_ POINT, _In_ UINT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define VK_F1
Definition: winuser.h:2291
#define VK_PAUSE
Definition: winuser.h:2241
#define SM_CYFRAME
Definition: winuser.h:1007
#define MF_UNCHECKED
Definition: winuser.h:204
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1722
#define TPM_TOPALIGN
Definition: winuser.h:2419
BOOL WINAPI IsIconic(_In_ HWND)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SC_SIZE
Definition: winuser.h:2620
#define SPIF_SENDCHANGE
Definition: winuser.h:1600
#define WM_ACTIVATE
Definition: winuser.h:1640
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
#define SC_MINIMIZE
Definition: winuser.h:2622
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
#define WM_CTLCOLORBTN
Definition: winuser.h:1797
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define GetMessage
Definition: winuser.h:5956
#define WM_NCMOUSEMOVE
Definition: winuser.h:1719
WORD WINAPI TileWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_NCACTIVATE
Definition: winuser.h:1716
#define WM_SYSCHAR
Definition: winuser.h:1749
#define CWP_SKIPDISABLED
Definition: winuser.h:209
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define WM_GETMINMAXINFO
Definition: winuser.h:1668
#define WM_EXITSIZEMOVE
Definition: winuser.h:1852
#define WM_INITMENUPOPUP
Definition: winuser.h:1774
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define BS_LEFT
Definition: winuser.h:265
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define WM_SETFONT
Definition: winuser.h:1678
#define WM_TIMER
Definition: winuser.h:1770
#define BM_CLICK
Definition: winuser.h:1946
#define BST_PUSHED
Definition: winuser.h:201
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define HTRIGHT
Definition: winuser.h:2525
#define RDW_ERASENOW
Definition: winuser.h:1230
#define RDW_FRAME
Definition: winuser.h:1223
#define WM_COPYDATA
Definition: winuser.h:1692
#define WM_NULL
Definition: winuser.h:1635
#define SendMessage
Definition: winuser.h:6009
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define PeekMessage
Definition: winuser.h:5996
#define BS_VCENTER
Definition: winuser.h:279
struct tagMINMAXINFO * PMINMAXINFO
#define TPM_VERTICAL
Definition: winuser.h:2418
#define SM_CXSIZEFRAME
Definition: winuser.h:1004
#define SC_CLOSE
Definition: winuser.h:2628
#define SC_MOVE
Definition: winuser.h:2621
#define GetWindowLong
Definition: winuser.h:5962
#define SM_CXDLGFRAME
Definition: winuser.h:977
#define WM_LBUTTONUP
Definition: winuser.h:1805
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define PostMessage
Definition: winuser.h:5998
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define GetClassLongPtrW
Definition: winuser.h:4718
#define CWP_SKIPINVISIBLE
Definition: winuser.h:208
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define WM_SIZING
Definition: winuser.h:1835
#define SIZE_RESTORED
Definition: winuser.h:2541
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define WM_NCLBUTTONUP
Definition: winuser.h:1721
#define HTTOP
Definition: winuser.h:2526
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2223
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define WM_HOTKEY
Definition: winuser.h:1907
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define VK_SHIFT
Definition: winuser.h:2238
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SM_CYDLGFRAME
Definition: winuser.h:979
#define MFT_STRING
Definition: winuser.h:757
#define MDITILE_HORIZONTAL
Definition: winuser.h:2224
#define WM_DESTROY
Definition: winuser.h:1637
#define WM_NCRBUTTONUP
Definition: winuser.h:1724
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define SM_CXSCREEN
Definition: winuser.h:970
#define DispatchMessage
Definition: winuser.h:5931
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define WM_MOVING
Definition: winuser.h:1837
#define WM_ENDSESSION
Definition: winuser.h:1655
#define GW_CHILD
Definition: winuser.h:774
#define MDITILE_VERTICAL
Definition: winuser.h:2225
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2532
#define TPM_RETURNCMD
Definition: winuser.h:2423
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define HTLEFT
Definition: winuser.h:2523
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define WM_NCCALCSIZE
Definition: winuser.h:1713
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)
#define SM_CMONITORS
Definition: winuser.h:1051
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262
#define SC_RESTORE
Definition: winuser.h:2634
#define HWND_NOTOPMOST
Definition: winuser.h:1217
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SM_CYCAPTION
Definition: winuser.h:974
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define SM_CYSIZEFRAME
Definition: winuser.h:1006
int WINAPI GetSystemMetrics(_In_ int)
#define SW_NORMAL
Definition: winuser.h:780
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:788
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1720
#define GCW_ATOM
Definition: winuser.h:669
#define MIIM_TYPE
Definition: winuser.h:736
#define RDW_INVALIDATE
Definition: winuser.h:1225
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SC_MAXIMIZE
Definition: winuser.h:2624
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2240
#define WM_NCPAINT
Definition: winuser.h:1715
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define GWL_EXSTYLE
Definition: winuser.h:862
#define MF_GRAYED
Definition: winuser.h:129
#define COLOR_3DFACE
Definition: winuser.h:940
#define WM_ENTERSIZEMOVE
Definition: winuser.h:1851