ReactOS 0.4.17-dev-966-gf06eace
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
47#define IDHK_ACTIVATE_TASK 0x209
48
50
52{
55};
57
59{
60 WINDOWPOSBACKUPDATA wposdata;
61 HWND hDesk = GetDesktopWindow();
62 if (IsWindowVisible(hwnd) && !IsIconic(hwnd) && (hwnd != hDesk))
63 {
64 wposdata.hwnd = hwnd;
65 wposdata.wplt.length = sizeof(wposdata.wplt);
66 GetWindowPlacement(hwnd, &(wposdata.wplt));
67 g_WindowPosBackup.Add(wposdata);
68 }
69
70 return TRUE;
71}
72
74{
76}
77
79{
81
82 for (INT i = g_WindowPosBackup.GetSize() - 1; i >= 0; --i)
83 {
85 }
86
87 g_WindowPosBackup.RemoveAll();
88}
89
91{
94 {
96 return TRUE;
97
99 if (!(exstyle & WS_EX_TOPMOST))
100 return TRUE;
101 }
102 return FALSE;
103}
104
106{
112};
113
114static BOOL CALLBACK
116{
118
119 if (!CanBeMinimized(hwnd))
120 return TRUE; // continue
121
122 if (pei->hTrayWnd == hwnd || pei->hwndDesktop == hwnd ||
123 pei->hwndProgman == hwnd)
124 {
125 return TRUE; // continue
126 }
127
128 if (pei->bMustBeInMonitor)
129 {
130 // is the window in the nearest monitor?
131 HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
132 if (hMon)
133 {
135 ZeroMemory(&info, sizeof(info));
136 info.cbSize = sizeof(info);
137 if (GetMonitorInfoW(hMon, &info))
138 {
139 RECT rcWindow, rcMonitor, rcIntersect;
140 rcMonitor = info.rcMonitor;
141
142 GetWindowRect(hwnd, &rcWindow);
143
144 if (!IntersectRect(&rcIntersect, &rcMonitor, &rcWindow))
145 return TRUE; // continue
146 }
147 }
148 }
149
150 pei->hwndFound = hwnd;
151 return FALSE; // stop if found
152}
153
154static BOOL
156{
158 ei.hwndFound = NULL;
160 ei.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
161 ei.hwndProgman = FindWindowW(L"Progman", NULL);
162 ei.bMustBeInMonitor = bMustBeInMonitor;
163
165 return ei.hwndFound != NULL;
166}
167
168/* Minimized window position info */
170{
173};
175
176/*
177 * ITrayWindow
178 */
179
180const GUID IID_IShellDesktopTray = { 0x213e2df9, 0x9a14, 0x4328, { 0x99, 0xb1, 0x69, 0x61, 0xf9, 0x14, 0x3c, 0xe9 } };
181
183 : public CWindowImpl<CStartButton>
184{
187 HFONT m_Font;
188
189public:
191 : m_ImageList(NULL),
192 m_Font(NULL)
193 {
194 m_Size.cx = 0;
195 m_Size.cy = 0;
196 }
197
199 {
200 if (m_ImageList != NULL)
202
203 if (m_Font != NULL)
205 }
206
208 {
209 return m_Size;
210 }
211
213 {
214 SIZE Size = { 0, 0 };
215
216 if (m_ImageList == NULL ||
218 {
220 }
221
223
224 /* Save the size of the start button */
225 m_Size = Size;
226 }
227
229 {
230 /* Get the system fonts, we use the caption font, always bold, though. */
231 NONCLIENTMETRICS ncm = {sizeof(ncm)};
232 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
233 return;
234
235 if (m_Font)
237
238 ncm.lfCaptionFont.lfWeight = FW_BOLD;
239 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
240
242 }
243
245 {
246 // HACK & FIXME: CORE-18016
247 HWND hWnd = m_hWnd;
248 m_hWnd = NULL;
250
251 SetWindowTheme(m_hWnd, L"Start", NULL);
252
255 0, 0, 0,
258
261 UpdateSize();
262 }
263
265 {
266 WCHAR szStartCaption[32];
268 IDS_START,
269 szStartCaption,
270 _countof(szStartCaption)))
271 {
272 wcscpy(szStartCaption, L"Start");
273 }
274
276
277 // HACK & FIXME: CORE-18016
279 0,
280 WC_BUTTON,
281 szStartCaption,
282 dwStyle,
283 0, 0, 0, 0,
287 NULL);
288
289 if (m_hWnd)
290 Initialize();
291
292 return m_hWnd;
293 }
294
296 {
297 if (uMsg == WM_KEYUP && wParam != VK_SPACE)
298 return 0;
299
301 return 0;
302 }
303
307};
308
310 public CComCoClass<CTrayWindow>,
311 public CComObjectRootEx<CComMultiThreadModelNoCS>,
312 public CWindowImpl < CTrayWindow, CWindow, CControlWinTraits >,
313 public CAppBarManager,
314 public ITrayWindow,
315 public IShellDesktopTray,
316 public IOleWindow,
317 public IContextMenu
318{
321
324
328
329 HFONT m_Font;
330
335
337
343
346
349
353
355
357
358public:
360
361 union
362 {
364 struct
365 {
366 /* UI Status */
370 };
371 };
372
373public:
377 m_Theme(NULL),
378 m_Font(NULL),
380 m_Rebar(NULL),
383 m_Position(0),
393 Flags(0)
394 {
399 }
400
401 virtual ~CTrayWindow()
402 {
403 if (m_ShellServices != NULL)
404 {
407 }
408
409 if (m_Font != NULL)
410 {
412 m_Font = NULL;
413 }
414
415 if (m_Theme)
416 {
418 m_Theme = NULL;
419 }
420
422 }
423
424
425
426
427
428 /**********************************************************
429 * ##### command handling #####
430 */
431
433 {
434 WCHAR szCommand[256];
435 WCHAR *pszParameters;
436
438 id,
439 szCommand,
440 _countof(szCommand)))
441 {
442 return E_FAIL;
443 }
444
445 pszParameters = wcschr(szCommand, L'>');
446 if (pszParameters)
447 {
448 *pszParameters = 0;
449 pszParameters++;
450 }
451
452 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
453 return S_OK;
454 }
455
457 {
459 return;
460
462
465 }
466
468 {
469 IUnknown_Exec(m_StartMenuPopup, CLSID_MenuBand, 0x10000000, 0, NULL, NULL);
470 }
471
473 {
475 return 0;
476
477 if (GetAsyncKeyState(VK_SHIFT) < 0 ||
478 !SHGetValueW(HKEY_CURRENT_USER, REGSTR_PATH_EXPLORER L"\\Advanced", L"StartMenuForceRefresh", NULL, NULL, NULL))
479 {
481 }
482
483 SaveState();
484
485 /* Display the ReactOS Shutdown Dialog */
487
488 /*
489 * If the user presses CTRL+ALT+SHIFT while exiting
490 * the shutdown dialog, exit the shell cleanly.
491 */
492 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
493 (GetKeyState(VK_SHIFT) & 0x8000) &&
494 (GetKeyState(VK_MENU) & 0x8000))
495 {
496 PostMessage(WM_QUIT, 0, 0);
497 }
498 return 0;
499 }
500
502 {
503 HWND hwnd;
504 RECT posRect;
505
507
509 WC_STATIC,
510 NULL,
512 posRect.left,
513 posRect.top,
514 posRect.right - posRect.left,
515 posRect.bottom - posRect.top,
516 NULL,
517 NULL,
518 NULL,
519 NULL);
520
522
523 // build the default directory from two environment variables
524 CStringW strDefaultDir, strHomePath;
525 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
526 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
527 strDefaultDir += strHomePath;
528
530
533
534 return 0;
535 }
536
538 {
539 CTrayWindow * This = (CTrayWindow*) pParam;
540 return This->RunFileDlgThread();
541 }
542
544 {
545 HWND hRunDlg;
547 {
549 if (hRunDlg != NULL &&
550 hRunDlg != m_RunFileDlgOwner)
551 {
552 SetForegroundWindow(hRunDlg);
553 return;
554 }
555 }
556
558 if (hThread)
560 }
561
563 {
564 HWND hwnd;
565 RECT posRect;
566
569 WC_STATIC,
570 NULL,
572 posRect.left,
573 posRect.top,
574 posRect.right - posRect.left,
575 posRect.bottom - posRect.top,
576 NULL,
577 NULL,
578 NULL,
579 NULL);
580
582
584
587
588 return 0;
589 }
590
592 {
593 CTrayWindow *This = (CTrayWindow*) pParam;
594
595 return This->TrayPropertiesThread();
596 }
597
599 {
600 HWND hTrayProp;
601
603 {
605 if (hTrayProp != NULL &&
606 hTrayProp != m_TrayPropertiesOwner)
607 {
608 SetForegroundWindow(hTrayProp);
609 return NULL;
610 }
611 }
612
614 if (hThread)
616 return NULL;
617 }
618
620 {
621 WCHAR szDir[MAX_PATH];
622
623 if (SHGetSpecialFolderPath(hWndOwner,
624 szDir,
626 FALSE))
627 {
628 ShellExecute(hWndOwner,
629 lpOperation,
630 szDir,
631 NULL,
632 NULL,
634 }
635 }
636
638 {
639 ShellExecute(hWndOwner,
640 TEXT("open"),
641 TEXT("taskmgr.exe"),
642 NULL,
643 NULL,
645 }
646
648 {
650 {
651 ShowDesktop();
652 }
653 else
654 {
655 RestoreAll();
656 }
657 }
658
660 {
661 switch (uiCmd)
662 {
665 break;
666
669 TEXT("open"));
670 break;
671
674 TEXT("explore"));
675 break;
676
677 case ID_LOCKTASKBAR:
679 break;
680
683 break;
684
687 break;
688
690 ShowDesktop();
691 break;
692
695 if (g_Arrangement == NONE)
696 {
698 }
702 break;
703
706 if (g_Arrangement == NONE)
707 {
709 }
713 break;
714
717 if (g_Arrangement == NONE)
718 {
720 }
724 break;
725
728 break;
729
731 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
732 break;
733
735 RestoreAll();
736 break;
737
738 default:
739 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
740 return FALSE;
741 }
742
743 return TRUE;
744 }
745
747 {
748 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
749 }
750
751 VOID ShowFolder(INT csidl, BOOL bExplore)
752 {
753 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST };
754 if (bExplore)
755 sei.lpVerb = L"explore";
756 sei.nShow = SW_SHOWNORMAL;
758 if (sei.lpIDList)
759 {
760 ShellExecuteExW(&sei);
762 }
763 }
764
766 {
767 switch (id)
768 {
769 case IDHK_RUN:
772 break;
773 case IDHK_HELP:
775 break;
776 case IDHK_EXPLORE:
778 break;
779 case IDHK_FIND:
781 break;
784 break;
786 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
787 break;
788 case IDHK_NEXT_TASK:
789 break;
790 case IDHK_PREV_TASK:
791 break;
793 MinimizeAll();
794 break;
795 case IDHK_RESTORE_ALL:
796 RestoreAll();
797 break;
798 case IDHK_DESKTOP:
800 break;
801 case IDHK_PAGER:
802 break;
803 }
804
805 return 0;
806 }
807
809 {
811 return 0;
812 }
813
815 {
816 switch (uCommand)
817 {
820#if 0 // FIXME: This won't work
823#else
825#endif
826 break;
830 break;
832 SaveState();
833 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
834 break;
835 case TRAYCMD_CASCADE:
837 break;
838 case TRAYCMD_TILE_H:
840 break;
841 case TRAYCMD_TILE_V:
843 break;
846 break;
848 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
849 break;
850 case TRAYCMD_EJECT:
852 break;
855 break;
857 MinimizeAll();
858 break;
860 RestoreAll();
861 break;
863 ShowDesktop();
864 break;
867 break;
869 break;
872 {
875 }
876 break;
879 break;
883 break;
886 break;
890 break;
892 // TODO:
893 break;
895 UpdateWindow();
896 Sleep(100);
897 //DisconnectWindowsDialog(m_DesktopWnd); // FIXME: shell32
898 break;
904 break;
905 case IDM_SEARCH:
909 break;
913 break;
914 //case TRAYCMD_REFRESH_MENU: Does nothing on WinXP+
915 // break;
916 default:
917 break;
918 }
919
920 return FALSE;
921 }
922
923
925 IN HMENU hMenu,
926 IN POINT *ppt OPTIONAL,
927 IN HWND hwndExclude OPTIONAL,
928 IN BOOL TrackUp,
929 IN BOOL IsContextMenu)
930 {
931 TPMPARAMS tmp, *ptmp = NULL;
932 POINT pt;
933 UINT cmdId;
934 UINT fuFlags;
935
936 if (hwndExclude != NULL)
937 {
938 /* Get the client rectangle and map it to screen coordinates */
939 if (::GetClientRect(hwndExclude,
940 &tmp.rcExclude) &&
941 ::MapWindowPoints(hwndExclude,
942 NULL,
943 (LPPOINT) &tmp.rcExclude,
944 2) != 0)
945 {
946 ptmp = &tmp;
947 }
948 }
949
950 if (ppt == NULL)
951 {
952 if (ptmp == NULL &&
953 GetClientRect(&tmp.rcExclude) &&
955 NULL,
956 (LPPOINT) &tmp.rcExclude,
957 2) != 0)
958 {
959 ptmp = &tmp;
960 }
961
962 if (ptmp != NULL)
963 {
964 /* NOTE: TrackPopupMenuEx will eventually align the track position
965 for us, no need to take care of it here as long as the
966 coordinates are somewhere within the exclusion rectangle */
967 pt.x = ptmp->rcExclude.left;
968 pt.y = ptmp->rcExclude.top;
969 }
970 else
971 pt.x = pt.y = 0;
972 }
973 else
974 pt = *ppt;
975
976 tmp.cbSize = sizeof(tmp);
977
978 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
979 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
980 if (IsContextMenu)
981 fuFlags |= TPM_RIGHTBUTTON;
982 else
983 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
984
985 cmdId = TrackPopupMenuEx(hMenu,
986 fuFlags,
987 pt.x,
988 pt.y,
989 m_hWnd,
990 ptmp);
991
992 return cmdId;
993 }
994
996 IN IContextMenu * contextMenu,
997 IN POINT *ppt OPTIONAL,
998 IN HWND hwndExclude OPTIONAL,
999 IN BOOL TrackUp,
1001 {
1002 POINT pt;
1004 RECT rc;
1005 HRESULT hr;
1006 UINT uCommand;
1007 HMENU popup = CreatePopupMenu();
1008
1009 if (popup == NULL)
1010 return E_FAIL;
1011
1012 if (ppt)
1013 {
1014 pt = *ppt;
1015 }
1016 else
1017 {
1018 ::GetWindowRect(m_hWnd, &rc);
1019 pt.x = rc.left;
1020 pt.y = rc.top;
1021 }
1022
1023 TRACE("Before Query\n");
1024 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
1026 {
1027 TRACE("Query failed\n");
1028 DestroyMenu(popup);
1029 return hr;
1030 }
1031
1032 TRACE("Before Tracking\n");
1034 if (hwndExclude)
1035 {
1036 ::GetWindowRect(hwndExclude, &rc);
1037 ZeroMemory(&params, sizeof(params));
1038 params.cbSize = sizeof(params);
1039 params.rcExclude = rc;
1040 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
1041 }
1042 else
1043 {
1044 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
1045 }
1047
1048 if (uCommand != 0)
1049 {
1050 TRACE("Before InvokeCommand\n");
1051 CMINVOKECOMMANDINFO cmi = { 0 };
1052 cmi.cbSize = sizeof(cmi);
1053 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
1054 cmi.hwnd = m_hWnd;
1055 hr = contextMenu->InvokeCommand(&cmi);
1056 }
1057 else
1058 {
1059 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1060 hr = S_FALSE;
1061 }
1062
1063 DestroyMenu(popup);
1064 return hr;
1065 }
1066
1067
1068
1069
1070
1071 /**********************************************************
1072 * ##### moving and sizing handling #####
1073 */
1074
1076 {
1077 /* There is nothing to do if themes are enabled */
1078 if (m_Theme)
1079 return;
1080
1082
1083 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1084 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1085 {
1086 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1087 return;
1088 }
1089
1090 if (m_Font != NULL)
1092
1093 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1094 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1095 if (!m_Font)
1096 {
1097 ERR("CreateFontIndirect failed\n");
1098 return;
1099 }
1100
1104 }
1105
1107 IN OUT RECT *pRect,
1109 {
1111 HMONITOR hMon;
1112
1113 mi.cbSize = sizeof(mi);
1114 hMon = MonitorFromRect(pRect, dwFlags);
1115 if (hMon != NULL &&
1116 GetMonitorInfo(hMon, &mi))
1117 {
1118 *pRect = mi.rcMonitor;
1119 }
1120 else
1121 {
1122 pRect->left = 0;
1123 pRect->top = 0;
1124 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1125 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1126
1127 hMon = NULL;
1128 }
1129
1130 return hMon;
1131 }
1132
1134 IN const RECT *pRect)
1135 {
1136 HMONITOR hMon;
1137
1138 /* In case the monitor sizes or saved sizes differ a bit (probably
1139 not a lot, only so the tray window overlaps into another monitor
1140 now), minimize the risk that we determine a wrong monitor by
1141 using the center point of the tray window if we can't determine
1142 it using the rectangle. */
1143 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1144 if (hMon == NULL)
1145 {
1146 POINT pt;
1147
1148 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1149 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1150
1151 /* be less error-prone, find the nearest monitor */
1152 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1153 }
1154
1155 return hMon;
1156 }
1157
1159 IN HMONITOR hMonitor,
1160 IN OUT RECT *pRect)
1161 {
1162 HMONITOR hMon = NULL;
1163
1164 if (hMonitor != NULL)
1165 {
1167
1168 mi.cbSize = sizeof(mi);
1169 if (!GetMonitorInfo(hMonitor, &mi))
1170 {
1171 /* Hm, the monitor is gone? Try to find a monitor where it
1172 could be located now */
1173 hMon = GetMonitorFromRect(pRect);
1174 if (hMon == NULL ||
1175 !GetMonitorInfo(hMon, &mi))
1176 {
1177 hMon = NULL;
1178 goto GetPrimaryRect;
1179 }
1180 }
1181
1182 *pRect = mi.rcMonitor;
1183 }
1184 else
1185 {
1186GetPrimaryRect:
1187 pRect->left = 0;
1188 pRect->top = 0;
1189 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1190 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1191 }
1192
1193 return hMon;
1194 }
1195
1197 {
1199 SIZE size;
1200
1201 if (pos > ABE_BOTTOM)
1202 pos = ABE_BOTTOM;
1203
1204 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1206 return;
1207
1208 switch (pos)
1209 {
1210 case ABE_TOP:
1211 rc->bottom -= size.cy;
1212 break;
1213 case ABE_BOTTOM:
1214 rc->top += size.cy;
1215 break;
1216 case ABE_LEFT:
1217 rc->right -= size.cx;
1218 break;
1219 case ABE_RIGHT:
1220 rc->left += size.cx;
1221 break;
1222 }
1223 }
1224
1226 IN const SIZE *pTraySize,
1227 IN OUT RECT *pRect)
1228 {
1229 switch (Position)
1230 {
1231 case ABE_LEFT:
1232 pRect->right = pRect->left + pTraySize->cx;
1233 break;
1234
1235 case ABE_TOP:
1236 pRect->bottom = pRect->top + pTraySize->cy;
1237 break;
1238
1239 case ABE_RIGHT:
1240 pRect->left = pRect->right - pTraySize->cx;
1241 break;
1242
1243 case ABE_BOTTOM:
1244 default:
1245 pRect->top = pRect->bottom - pTraySize->cy;
1246 break;
1247 }
1248 }
1249
1251 IN const RECT *pScreen,
1252 IN const SIZE *pTraySize OPTIONAL,
1253 OUT RECT *pRect)
1254 {
1255 if (pTraySize == NULL)
1256 pTraySize = &m_TraySize;
1257
1258 *pRect = *pScreen;
1259
1260 if(!m_Theme)
1261 {
1262 /* Move the border outside of the screen */
1263 InflateRect(pRect,
1266 }
1267
1268 MakeTrayRectWithSize(Position, pTraySize, pRect);
1269 }
1270
1272 {
1273 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1274 }
1275
1278 IN OUT RECT *pRect)
1279 {
1280 RECT rcScreen;
1281 //BOOL Horizontal;
1282 HMONITOR hMon;
1283 SIZE szMax, szWnd;
1284
1285 //Horizontal = IsPosHorizontal();
1286
1287 szWnd.cx = pRect->right - pRect->left;
1288 szWnd.cy = pRect->bottom - pRect->top;
1289
1290 rcScreen = *pRect;
1291 hMon = GetScreenRectFromRect(
1292 &rcScreen,
1293 MONITOR_DEFAULTTONEAREST);
1294
1295 /* Calculate the maximum size of the tray window and limit the window
1296 size to half of the screen's size. */
1297 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1298 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1299 if (szWnd.cx > szMax.cx)
1300 szWnd.cx = szMax.cx;
1301 if (szWnd.cy > szMax.cy)
1302 szWnd.cy = szMax.cy;
1303
1304 /* FIXME - calculate */
1305
1307 &rcScreen,
1308 &szWnd,
1309 pRect);
1310
1311 return hMon;
1312 }
1313
1314#if 0
1315 VOID
1316 GetMinimumWindowSize(
1317 OUT RECT *pRect)
1318 {
1319 RECT rcMin = {0};
1320
1321 AdjustWindowRectEx(&rcMin,
1323 GWL_STYLE),
1324 FALSE,
1326 GWL_EXSTYLE));
1327
1328 *pRect = rcMin;
1329 }
1330#endif
1331
1332
1334 IN POINT pt,
1335 OUT RECT *pRect,
1336 OUT HMONITOR *phMonitor)
1337 {
1338 HMONITOR hMon, hMonNew;
1339 DWORD PosH, PosV, Pos;
1340 SIZE DeltaPt, ScreenOffset;
1341 RECT rcScreen;
1342
1343 rcScreen.left = 0;
1344 rcScreen.top = 0;
1345
1346 /* Determine the screen rectangle */
1347 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1348 if (hMon != NULL)
1349 {
1351
1352 mi.cbSize = sizeof(mi);
1353 if (!GetMonitorInfo(hMon, &mi))
1354 {
1355 hMon = NULL;
1356 goto GetPrimaryScreenRect;
1357 }
1358
1359 /* make left top corner of the screen zero based to
1360 make calculations easier */
1361 pt.x -= mi.rcMonitor.left;
1362 pt.y -= mi.rcMonitor.top;
1363
1364 ScreenOffset.cx = mi.rcMonitor.left;
1365 ScreenOffset.cy = mi.rcMonitor.top;
1366 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1367 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1368 }
1369 else
1370 {
1371GetPrimaryScreenRect:
1372 ScreenOffset.cx = 0;
1373 ScreenOffset.cy = 0;
1376 }
1377
1378 /* Calculate the nearest screen border */
1379 if (pt.x < rcScreen.right / 2)
1380 {
1381 DeltaPt.cx = pt.x;
1382 PosH = ABE_LEFT;
1383 }
1384 else
1385 {
1386 DeltaPt.cx = rcScreen.right - pt.x;
1387 PosH = ABE_RIGHT;
1388 }
1389
1390 if (pt.y < rcScreen.bottom / 2)
1391 {
1392 DeltaPt.cy = pt.y;
1393 PosV = ABE_TOP;
1394 }
1395 else
1396 {
1397 DeltaPt.cy = rcScreen.bottom - pt.y;
1398 PosV = ABE_BOTTOM;
1399 }
1400
1401 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1402
1403 /* Fix the screen origin to be relative to the primary monitor again */
1404 OffsetRect(&rcScreen,
1405 ScreenOffset.cx,
1406 ScreenOffset.cy);
1407
1408 RECT rcPos = m_TrayRects[Pos];
1409
1410 hMonNew = GetMonitorFromRect(&rcPos);
1411 if (hMon != hMonNew)
1412 {
1413 SIZE szTray;
1414
1415 /* Recalculate the rectangle, we're dragging to another monitor.
1416 We don't need to recalculate the rect on single monitor systems. */
1417 szTray.cx = rcPos.right - rcPos.left;
1418 szTray.cy = rcPos.bottom - rcPos.top;
1419
1420 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1421 hMon = hMonNew;
1422 }
1423 else
1424 {
1425 /* The user is dragging the tray window on the same monitor. We don't need
1426 to recalculate the rectangle */
1427 *pRect = rcPos;
1428 }
1429
1430 *phMonitor = hMon;
1431
1432 return Pos;
1433 }
1434
1436 IN OUT RECT *pRect,
1437 OUT HMONITOR *phMonitor)
1438 {
1439 POINT pt;
1440
1441 /* Calculate the center of the rectangle. We call
1442 GetDraggingRectFromPt to calculate a valid
1443 dragging rectangle */
1444 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1445 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1446
1447 return GetDraggingRectFromPt(
1448 pt,
1449 pRect,
1450 phMonitor);
1451 }
1452
1454 {
1455 RECT rcTray;
1456
1457 if (IsDragging)
1458 {
1459 rcTray.left = pwp->x;
1460 rcTray.top = pwp->y;
1461 rcTray.right = rcTray.left + pwp->cx;
1462 rcTray.bottom = rcTray.top + pwp->cy;
1463
1464 if (!EqualRect(&rcTray,
1466 {
1467 /* Recalculate the rectangle, the user dragged the tray
1468 window to another monitor or the window was somehow else
1469 moved or resized */
1471 &rcTray,
1473 //m_TrayRects[DraggingPosition] = rcTray;
1474 }
1475
1476 //Monitor = CalculateValidSize(DraggingPosition,
1477 // &rcTray);
1478
1483 IsDragging = FALSE;
1484
1485 m_TrayRects[m_Position] = rcTray;
1486 goto ChangePos;
1487 }
1488 else if (GetWindowRect(&rcTray))
1489 {
1490 if (InSizeMove)
1491 {
1492 if (!(pwp->flags & SWP_NOMOVE))
1493 {
1494 rcTray.left = pwp->x;
1495 rcTray.top = pwp->y;
1496 }
1497
1498 if (!(pwp->flags & SWP_NOSIZE))
1499 {
1500 rcTray.right = rcTray.left + pwp->cx;
1501 rcTray.bottom = rcTray.top + pwp->cy;
1502 }
1503
1505
1506 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1507 {
1508 SIZE szWnd;
1509
1510 szWnd.cx = pwp->cx;
1511 szWnd.cy = pwp->cy;
1512
1513 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1514 }
1515
1516 m_TrayRects[m_Position] = rcTray;
1517 }
1518 else if (m_Position != (DWORD)-1)
1519 {
1520 /* If the user isn't resizing the tray window we need to make sure the
1521 new size or position is valid. this is to prevent changes to the window
1522 without user interaction. */
1523 rcTray = m_TrayRects[m_Position];
1524
1525 if (IsAutoHideState())
1526 {
1527 rcTray.left += m_AutoHideOffset.cx;
1528 rcTray.right += m_AutoHideOffset.cx;
1529 rcTray.top += m_AutoHideOffset.cy;
1530 rcTray.bottom += m_AutoHideOffset.cy;
1531 }
1532 }
1533
1534ChangePos:
1535 m_TraySize.cx = rcTray.right - rcTray.left;
1536 m_TraySize.cy = rcTray.bottom - rcTray.top;
1537
1538 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1539 pwp->x = rcTray.left;
1540 pwp->y = rcTray.top;
1541 pwp->cx = m_TraySize.cx;
1542 pwp->cy = m_TraySize.cy;
1543 }
1544 }
1545
1547 {
1548 RECT rcClip, rcWindow;
1549 HRGN hClipRgn;
1550
1551 if (GetWindowRect(&rcWindow))
1552 {
1553 /* Disable clipping on systems with only one monitor */
1555 Clip = FALSE;
1556
1557 if (Clip)
1558 {
1559 rcClip = rcWindow;
1560
1561 GetScreenRect(m_Monitor, &rcClip);
1562
1563 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1564 {
1565 rcClip = rcWindow;
1566 }
1567
1568 OffsetRect(&rcClip,
1569 -rcWindow.left,
1570 -rcWindow.top);
1571
1572 hClipRgn = CreateRectRgnIndirect(&rcClip);
1573 }
1574 else
1575 hClipRgn = NULL;
1576
1577 /* Set the clipping region or make sure the window isn't clipped
1578 by disabling it explicitly. */
1579 SetWindowRgn(hClipRgn, TRUE);
1580 }
1581 }
1582
1584 {
1585#if !WIN7_DEBUG_MODE
1586 RECT rcTray, rcWorkArea;
1587
1588 /* If monitor has changed then fix the previous monitors work area */
1590 {
1591 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1592 SystemParametersInfoW(SPI_SETWORKAREA,
1593 1,
1594 &rcWorkArea,
1596 }
1597
1598 rcTray = m_TrayRects[m_Position];
1599
1600 GetScreenRect(m_Monitor, &rcWorkArea);
1602
1603 /* If AutoHide is false then change the workarea to exclude
1604 the area that the taskbar covers. */
1605 if (!IsAutoHideState())
1606 {
1607 switch (m_Position)
1608 {
1609 case ABE_TOP:
1610 rcWorkArea.top = rcTray.bottom;
1611 break;
1612 case ABE_LEFT:
1613 rcWorkArea.left = rcTray.right;
1614 break;
1615 case ABE_RIGHT:
1616 rcWorkArea.right = rcTray.left;
1617 break;
1618 case ABE_BOTTOM:
1619 rcWorkArea.bottom = rcTray.top;
1620 break;
1621 }
1622 }
1623
1624 /*
1625 * Resize the current monitor work area. Win32k will also send
1626 * a WM_SIZE message to automatically resize the desktop.
1627 */
1628 SystemParametersInfoW(SPI_SETWORKAREA,
1629 1,
1630 &rcWorkArea,
1632#endif
1633 }
1634
1636 {
1637 /* Force the rebar bands to resize */
1639 IID_IDeskBand,
1641 0,
1642 NULL,
1643 NULL);
1644
1645 /* Calculate the size of the taskbar based on the rebar */
1647
1648 /* Move the tray window */
1649 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1650 * and position we use here with m_TrayRects */
1655 }
1656
1658 {
1659 DWORD Pos;
1660 RECT rcScreen;
1661 SIZE WndSize, EdgeSize, DlgFrameSize;
1662 SIZE StartBtnSize = m_StartButton.GetSize();
1663
1664 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1665 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1666 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1667 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1668
1670 rcScreen = g_TaskbarSettings.sr.Rect;
1671 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1672
1674 {
1675 /* Use the minimum size of the taskbar, we'll use the start
1676 button as a minimum for now. Make sure we calculate the
1677 entire window size, not just the client size. However, we
1678 use a thinner border than a standard thick border, so that
1679 the start button and bands are not stuck to the screen border. */
1680 if(!m_Theme)
1681 {
1682 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1683 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1684 }
1685 else
1686 {
1687 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1688 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1691 }
1692 }
1693 /* Determine a minimum tray window rectangle. The "client" height is
1694 zero here since we cannot determine an optimal minimum width when
1695 loaded as a vertical tray window. We just need to make sure the values
1696 loaded from the registry are at least. The windows explorer behaves
1697 the same way, it allows the user to save a zero width vertical tray
1698 window, but not a zero height horizontal tray window. */
1699 if(!m_Theme)
1700 {
1701 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1702 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1703 }
1704 else
1705 {
1706 WndSize.cx = StartBtnSize.cx;
1707 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1708 }
1709
1710 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1711 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1712 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1713 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1714
1715 /* Save the calculated size */
1716 m_TraySize = WndSize;
1717
1718 /* Calculate all docking rectangles. We need to do this here so they're
1719 initialized and dragging the tray window to another position gives
1720 usable results */
1721 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1722 {
1724 &rcScreen,
1725 &m_TraySize,
1726 &m_TrayRects[Pos]);
1727 // 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);
1728 }
1729
1730 /* Determine which monitor we are on. It shouldn't matter which docked
1731 position rectangle we use */
1733 }
1734
1736 {
1737 RECT rcClient;
1738 SIZE TraySize, StartSize;
1739 POINT ptTrayNotify = { 0, 0 };
1740 BOOL Horizontal;
1741 HDWP dwp;
1742
1744 if (prcClient != NULL)
1745 {
1746 rcClient = *prcClient;
1747 }
1748 else
1749 {
1750 if (!GetClientRect(&rcClient))
1751 {
1752 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1753 return;
1754 }
1755 }
1756
1757 Horizontal = IsPosHorizontal();
1758
1759 /* We're about to resize/move the start button, the rebar control and
1760 the tray notification control */
1761 dwp = BeginDeferWindowPos(4);
1762 if (dwp == NULL)
1763 {
1764 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1765 return;
1766 }
1767
1768 /* Limit the Start button width to the client width, if necessary */
1769 StartSize = m_StartButton.GetSize();
1770 if (StartSize.cx > rcClient.right)
1771 StartSize.cx = rcClient.right;
1772
1773 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1774 if (hwndTaskToolbar)
1775 {
1776 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1777
1778 /* Themed button covers Edge area as well */
1779 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1780 }
1781
1782 if (m_StartButton.m_hWnd != NULL)
1783 {
1784 /* Resize and reposition the button */
1785 dwp = m_StartButton.DeferWindowPos(dwp,
1786 NULL,
1787 0,
1788 0,
1789 StartSize.cx,
1790 StartSize.cy,
1792 if (dwp == NULL)
1793 {
1794 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1795 return;
1796 }
1797 }
1798
1799 /* Determine the size that the tray notification window needs */
1800 if (Horizontal)
1801 {
1802 TraySize.cx = 0;
1803 TraySize.cy = rcClient.bottom;
1804 }
1805 else
1806 {
1807 TraySize.cx = rcClient.right;
1808 TraySize.cy = 0;
1809 }
1810
1811 if (m_TrayNotify != NULL &&
1814 (WPARAM)Horizontal,
1815 (LPARAM)&TraySize))
1816 {
1817 /* Move the tray notification window to the desired location */
1818 if (Horizontal)
1819 ptTrayNotify.x = rcClient.right - TraySize.cx;
1820 else
1821 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1822
1823 dwp = ::DeferWindowPos(dwp,
1825 NULL,
1826 ptTrayNotify.x,
1827 ptTrayNotify.y,
1828 TraySize.cx,
1829 TraySize.cy,
1831 if (dwp == NULL)
1832 {
1833 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1834 return;
1835 }
1836 }
1837
1838 /* Resize/Move the rebar control */
1839 if (m_Rebar != NULL)
1840 {
1841 POINT ptRebar = { 0, 0 };
1842 SIZE szRebar;
1843
1844 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1845
1846 if (Horizontal)
1847 {
1848 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1849 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1850 szRebar.cy = rcClient.bottom;
1851 }
1852 else
1853 {
1854 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1855 szRebar.cx = rcClient.right;
1856 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1857 }
1858
1859 dwp = ::DeferWindowPos(dwp,
1860 m_Rebar,
1861 NULL,
1862 ptRebar.x,
1863 ptRebar.y,
1864 szRebar.cx,
1865 szRebar.cy,
1867 }
1868
1869 if (dwp != NULL)
1870 EndDeferWindowPos(dwp);
1871
1872 if (m_TaskSwitch != NULL)
1873 {
1874 /* Update the task switch window configuration */
1876 }
1877 }
1878
1879 void FitToRebar(PRECT pRect)
1880 {
1881 /* Get the rect of the rebar */
1882 RECT rebarRect, taskbarRect, clientRect;
1883 ::GetWindowRect(m_Rebar, &rebarRect);
1884 ::GetWindowRect(m_hWnd, &taskbarRect);
1885 ::GetClientRect(m_hWnd, &clientRect);
1886 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1887
1888 /* Calculate the difference of size of the taskbar and the rebar */
1889 SIZE margins;
1890 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1891 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1892
1893 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1894 switch (m_Position)
1895 {
1896 case ABE_TOP:
1897 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1899 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1900 break;
1901 case ABE_BOTTOM:
1902 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1904 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1905 break;
1906 case ABE_LEFT:
1907 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1909 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1910 break;
1911 case ABE_RIGHT:
1912 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1914 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1915 break;
1916 }
1917
1919 }
1920
1922 {
1923 if (m_StartMenuPopup != NULL)
1924 {
1925 POINTL pt;
1926 RECTL rcExclude;
1927 DWORD dwFlags = 0;
1928
1929 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1930 {
1931 switch (m_Position)
1932 {
1933 case ABE_BOTTOM:
1934 pt.x = rcExclude.left;
1935 pt.y = rcExclude.top;
1936 dwFlags |= MPPF_TOP;
1937 break;
1938 case ABE_TOP:
1939 pt.x = rcExclude.left;
1940 pt.y = rcExclude.bottom;
1941 dwFlags |= MPPF_BOTTOM;
1942 break;
1943 case ABE_LEFT:
1944 pt.x = rcExclude.right;
1945 pt.y = rcExclude.top;
1946 dwFlags |= MPPF_RIGHT;
1947 break;
1948 case ABE_RIGHT:
1949 pt.x = rcExclude.left;
1950 pt.y = rcExclude.top;
1951 dwFlags |= MPPF_LEFT;
1952 break;
1953 }
1954
1955 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1956
1957 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1958 }
1959 }
1960 }
1961
1963 {
1964 POINT pt;
1965 GetCursorPos(&pt);
1966
1967 RECT rcCurrent;
1968 GetWindowRect(&rcCurrent);
1969
1970 BOOL over = PtInRect(&rcCurrent, pt);
1972 over = TRUE;
1973
1975 if (over)
1976 {
1977 if (state == AUTOHIDE_HIDING)
1978 {
1979 TRACE("AutoHide cancelling hide.\n");
1982 }
1983 else if (state == AUTOHIDE_HIDDEN)
1984 {
1985 TRACE("AutoHide starting show.\n");
1988 }
1989 }
1990 else
1991 {
1992 if (state == AUTOHIDE_SHOWING)
1993 {
1994 TRACE("AutoHide cancelling show.\n");
1997 }
1998 else if (state == AUTOHIDE_SHOWN)
1999 {
2000 TRACE("AutoHide starting hide.\n");
2003 }
2004
2006 }
2007 }
2008
2010 {
2013
2014 switch (m_AutoHideState)
2015 {
2016 case AUTOHIDE_HIDING:
2017 switch (m_Position)
2018 {
2019 case ABE_LEFT:
2020 m_AutoHideOffset.cy = 0;
2022 if (m_AutoHideOffset.cx < -w)
2024 break;
2025 case ABE_TOP:
2026 m_AutoHideOffset.cx = 0;
2028 if (m_AutoHideOffset.cy < -h)
2030 break;
2031 case ABE_RIGHT:
2032 m_AutoHideOffset.cy = 0;
2034 if (m_AutoHideOffset.cx > w)
2036 break;
2037 case ABE_BOTTOM:
2038 m_AutoHideOffset.cx = 0;
2040 if (m_AutoHideOffset.cy > h)
2042 break;
2043 }
2044
2046 {
2048 break;
2049 }
2050
2051 /* fallthrough */
2052 case AUTOHIDE_HIDDEN:
2053 switch (m_Position)
2054 {
2055 case ABE_LEFT:
2057 m_AutoHideOffset.cy = 0;
2058 break;
2059 case ABE_TOP:
2060 m_AutoHideOffset.cx = 0;
2062 break;
2063 case ABE_RIGHT:
2065 m_AutoHideOffset.cy = 0;
2066 break;
2067 case ABE_BOTTOM:
2068 m_AutoHideOffset.cx = 0;
2070 break;
2071 }
2072
2075 break;
2076
2077 case AUTOHIDE_SHOWING:
2079 {
2081 }
2083 {
2085 }
2086 else
2087 {
2088 m_AutoHideOffset.cx = 0;
2089 }
2090
2092 {
2094 }
2096 {
2098 }
2099 else
2100 {
2101 m_AutoHideOffset.cy = 0;
2102 }
2103
2104 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2105 {
2107 break;
2108 }
2109
2110 /* fallthrough */
2111 case AUTOHIDE_SHOWN:
2114 break;
2115 }
2116
2118 }
2119
2120 /**********************************************************
2121 * ##### taskbar drawing #####
2122 */
2123
2125 {
2126 RECT rect;
2128
2130
2131 if (m_Theme)
2132 {
2134 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2135 }
2136
2137 return 0;
2138 }
2139
2141 {
2142 HDC hdc;
2143 RECT rect;
2145 SIZE size;
2146
2148
2151 return 0;
2152
2155
2156 hdc = GetWindowDC();
2157
2158 switch (m_Position)
2159 {
2160 case ABE_LEFT:
2161 rect.left = rect.right - size.cx;
2162 break;
2163 case ABE_TOP:
2164 rect.top = rect.bottom - size.cy;
2165 break;
2166 case ABE_RIGHT:
2167 rect.right = rect.left + size.cx;
2168 break;
2169 case ABE_BOTTOM:
2170 default:
2171 rect.bottom = rect.top + size.cy;
2172 break;
2173 }
2174
2175 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2176
2177 ReleaseDC(hdc);
2178 return 0;
2179 }
2180
2181 /*
2182 * ITrayWindow
2183 */
2185 {
2186 RECT rcWnd;
2187
2188 /* Check if there's already a window created and try to show it.
2189 If it was somehow destroyed just create a new tray window. */
2190 if (m_hWnd != NULL && IsWindow())
2191 {
2192 return S_OK;
2193 }
2194
2197 dwExStyle |= WS_EX_TOPMOST;
2198
2200 if(!m_Theme)
2201 {
2202 dwStyle |= WS_THICKFRAME | WS_BORDER;
2203 }
2204
2205 ZeroMemory(&rcWnd, sizeof(rcWnd));
2206 if (m_Position != (DWORD) -1)
2207 rcWnd = m_TrayRects[m_Position];
2208
2209 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2210 return E_FAIL;
2211
2212 /* Align all controls on the tray window */
2214
2215 /* Move the tray window to the right position and resize it if necessary */
2217
2218 return S_OK;
2219 }
2220
2222 {
2223 if (m_hWnd != NULL)
2224 {
2227 0,
2228 0);
2229 }
2230
2231 return S_OK;
2232 }
2233
2235 {
2236 return m_hWnd;
2237 }
2238
2240 {
2241 return (m_hWnd == hWnd ||
2243 }
2244
2246 {
2247 return IsPosHorizontal();
2248 }
2249
2251 {
2252 BOOL bPrevLock = g_TaskbarSettings.bLock;
2253
2254 if (g_TaskbarSettings.bLock != bLock)
2255 {
2256 g_TaskbarSettings.bLock = bLock;
2257
2258 if (m_TrayBandSite != NULL)
2259 {
2260 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2261 {
2262 /* Reset?? */
2263 g_TaskbarSettings.bLock = bPrevLock;
2264 return bPrevLock;
2265 }
2266 }
2267
2268 if (m_Theme)
2269 {
2270 /* Update cached tray sizes */
2271 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2272 {
2273 RECT rcGripper = {0};
2274 AdjustSizerRect(&rcGripper, Pos);
2275
2277 {
2278 m_TrayRects[Pos].top += rcGripper.top;
2279 m_TrayRects[Pos].left += rcGripper.left;
2280 m_TrayRects[Pos].bottom += rcGripper.bottom;
2281 m_TrayRects[Pos].right += rcGripper.right;
2282 }
2283 else
2284 {
2285 m_TrayRects[Pos].top -= rcGripper.top;
2286 m_TrayRects[Pos].left -= rcGripper.left;
2287 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2288 m_TrayRects[Pos].right -= rcGripper.right;
2289 }
2290 }
2291 }
2295 }
2296
2297 return bPrevLock;
2298 }
2299
2300 /* The task window is visible and non-WS_EX_TOOLWINDOW and
2301 { has WS_EX_APPWINDOW style or has no owner } and is none of explorer's
2302 special windows (such as the desktop or the tray window) */
2304 {
2306 {
2308 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2309 !(exStyle & WS_EX_TOOLWINDOW))
2310 {
2311 return TRUE;
2312 }
2313 }
2314 return FALSE;
2315 }
2316
2317 /*
2318 * IContextMenu
2319 */
2321 UINT indexMenu,
2322 UINT idCmdFirst,
2323 UINT idCmdLast,
2324 UINT uFlags)
2325 {
2326 if (!m_ContextMenu)
2327 {
2330 return hr;
2331 }
2332
2333 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2334 }
2335
2337 {
2338 if (!m_ContextMenu)
2339 return E_INVALIDARG;
2340
2341 return m_ContextMenu->InvokeCommand(lpici);
2342 }
2343
2345 UINT uType,
2346 UINT *pwReserved,
2347 LPSTR pszName,
2348 UINT cchMax)
2349 {
2350 if (!m_ContextMenu)
2351 return E_INVALIDARG;
2352
2353 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2354 }
2355
2356 /**********************************************************
2357 * ##### message handling #####
2358 */
2359
2361 {
2362 HRESULT hRet;
2363
2364 ((ITrayWindow*)this)->AddRef();
2365
2366 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2367
2368 /* Create the Start button */
2370
2371 /* Load the saved tray window settings */
2373
2374 /* Create and initialize the start menu */
2378
2379 /* Create the task band */
2381 if (FAILED_UNEXPECTEDLY(hRet))
2382 return FALSE;
2383
2384 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2386 if (FAILED_UNEXPECTEDLY(hRet))
2387 return FALSE;
2388
2389 /* Create the tray notification window */
2391 if (FAILED_UNEXPECTEDLY(hRet))
2392 return FALSE;
2393
2394 /* Get the hwnd of the rebar */
2396 if (FAILED_UNEXPECTEDLY(hRet))
2397 return FALSE;
2398
2399 /* Get the hwnd of the tasks toolbar */
2401 if (FAILED_UNEXPECTEDLY(hRet))
2402 return FALSE;
2403
2404 /* Get the hwnd of the tray notification window */
2406 if (FAILED_UNEXPECTEDLY(hRet))
2407 return FALSE;
2408
2411 return FALSE;
2412
2413 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2414
2415 UpdateFonts();
2416
2418
2419 if (IsAutoHideState())
2420 {
2423 }
2424
2425 /* Set the initial lock state in the band site */
2427
2428 static const UINT winkeys[] =
2429 {
2442
2453
2464
2475
2486
2497 };
2499 {
2500 for (UINT i = 0; i < _countof(winkeys); ++i)
2501 {
2502 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2503 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2504 }
2505 }
2506
2507 m_WinMMDevChgMsg = RegisterWindowMessageW(L"winmm_devicechange");
2508
2509 return TRUE;
2510 }
2511
2513 {
2514 return 0;
2515 }
2516
2518 {
2519 if (wParam)
2520 SaveState();
2521 return 0;
2522 }
2523
2525 {
2526 if (m_Theme)
2528
2529 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2530
2531 if (m_Theme)
2532 {
2534 }
2535 else
2536 {
2538 }
2540
2541 return TRUE;
2542 }
2543
2545 {
2546 if (wParam == SPI_SETNONCLIENTMETRICS)
2547 {
2550 UpdateFonts();
2553 }
2554
2555 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2556 if (m_DesktopWnd)
2558
2559 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2560 {
2561 HideStartMenu();
2562
2564#if 1 // FIXME: Please re-use the start menu
2565 /* Re-create the start menu */
2569 FIXME("Use UpdateStartMenu\n");
2570#else
2571 // Update the start menu
2574#endif
2575 }
2576
2577 return 0;
2578 }
2579
2581 {
2582 HDC hdc = (HDC) wParam;
2583
2584 if (!m_Theme)
2585 {
2586 bHandled = FALSE;
2587 return 0;
2588 }
2589
2591 }
2592
2594 {
2595 /* Refresh workareas */
2597
2598 /* Load the saved tray window settings */
2600
2601 /* Move the tray window to the right position and resize it if necessary */
2603
2604 return TRUE;
2605 }
2606
2608 {
2610 if (!pCopyData)
2611 return FALSE;
2612
2613 switch (pCopyData->dwData)
2614 {
2615 case TABDMC_APPBAR:
2616 return OnAppBarMessage(pCopyData);
2617 case TABDMC_NOTIFY:
2618 case TABDMC_LOADINPROC:
2619 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2620 }
2621 return FALSE;
2622 }
2623
2624 // We have to draw non-client area because the 'Show Desktop' button is beyond client area.
2626 {
2627 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2628 return;
2630 }
2631
2633 {
2634 DefWindowProc(uMsg, wParam, lParam);
2635 bHandled = TRUE;
2636
2638 {
2639 DrawShowDesktopButton(); // We have to draw non-client area
2640 return 0;
2641 }
2642
2643 DrawSizerWithTheme((HRGN) wParam);
2644 DrawShowDesktopButton(); // We have to draw non-client area
2645 return 0;
2646 }
2647
2649 {
2652 }
2653
2655 {
2656 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2657 }
2658
2660 {
2661 RECT rcClient;
2662 POINT pt;
2663
2665 {
2666 /* The user may not be able to resize the tray window.
2667 Pretend like the window is not sizeable when the user
2668 clicks on the border. */
2669 return HTBORDER;
2670 }
2671
2673 if (GetClientRect(&rcClient) &&
2674 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2675 {
2676 pt.x = GET_X_LPARAM(lParam);
2677 pt.y = GET_Y_LPARAM(lParam);
2678
2680 return HTBORDER;
2681
2682 if (PtInRect(&rcClient, pt))
2683 {
2684 /* The user is trying to drag the tray window */
2685 return HTCAPTION;
2686 }
2687
2688 /* Depending on the position of the tray window, allow only
2689 changing the border next to the monitor working area */
2690 switch (m_Position)
2691 {
2692 case ABE_TOP:
2693 if (pt.y > rcClient.bottom)
2694 return HTBOTTOM;
2695 break;
2696 case ABE_LEFT:
2697 if (pt.x > rcClient.right)
2698 return HTRIGHT;
2699 break;
2700 case ABE_RIGHT:
2701 if (pt.x < rcClient.left)
2702 return HTLEFT;
2703 break;
2704 case ABE_BOTTOM:
2705 default:
2706 if (pt.y < rcClient.top)
2707 return HTTOP;
2708 break;
2709 }
2710 }
2711 return HTBORDER;
2712 }
2713
2715 {
2716 POINT ptCursor;
2717 PRECT pRect = (PRECT) lParam;
2718
2719 /* We need to ensure that an application can not accidently
2720 move the tray window (using SetWindowPos). However, we still
2721 need to be able to move the window in case the user wants to
2722 drag the tray window to another position or in case the user
2723 wants to resize the tray window. */
2724 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2725 {
2726 IsDragging = TRUE;
2728 }
2729 else
2730 {
2731 *pRect = m_TrayRects[m_Position];
2732 }
2733 return TRUE;
2734 }
2735
2737 {
2738 PRECT pRect = (PRECT) lParam;
2739
2741 {
2742 FitToRebar(pRect);
2743 }
2744 else
2745 {
2746 *pRect = m_TrayRects[m_Position];
2747 }
2748 return TRUE;
2749 }
2750
2752 {
2754 return TRUE;
2755 }
2756
2758 {
2759 RECT rcClient;
2760 if (wParam == SIZE_RESTORED && lParam == 0)
2761 {
2763 /* Clip the tray window on multi monitor systems so the edges can't
2764 overlap into another monitor */
2766
2767 if (!GetClientRect(&rcClient))
2768 {
2769 return FALSE;
2770 }
2771 }
2772 else
2773 {
2774 rcClient.left = rcClient.top = 0;
2775 rcClient.right = LOWORD(lParam);
2776 rcClient.bottom = HIWORD(lParam);
2777 }
2778
2779 AlignControls(&rcClient);
2780 return TRUE;
2781 }
2782
2784 {
2785 InSizeMove = TRUE;
2786 IsDragging = FALSE;
2788 {
2789 /* Remove the clipping on multi monitor systems while dragging around */
2791 }
2793 return TRUE;
2794 }
2795
2797 {
2798 InSizeMove = FALSE;
2800 {
2802
2803 /* Apply clipping */
2805 }
2806 return TRUE;
2807 }
2808
2810 {
2811 switch (wParam)
2812 {
2813 case TEXT(' '):
2814 {
2815 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2816 The tray window needs to handle this specially, since it normally doesn't have
2817 a system menu. */
2818
2819 static const UINT uidDisableItem [] = {
2820 SC_RESTORE,
2821 SC_MOVE,
2822 SC_SIZE,
2825 };
2826 HMENU hSysMenu;
2827 UINT i, uId;
2828
2829 /* temporarily enable the system menu */
2831
2832 hSysMenu = GetSystemMenu(FALSE);
2833 if (hSysMenu != NULL)
2834 {
2835 /* Disable all items that are not relevant */
2836 for (i = 0; i < _countof(uidDisableItem); i++)
2837 {
2838 EnableMenuItem(hSysMenu,
2839 uidDisableItem[i],
2841 }
2842
2843 EnableMenuItem(hSysMenu,
2844 SC_CLOSE,
2845 MF_BYCOMMAND |
2847
2848 /* Display the system menu */
2849 uId = TrackMenu(
2850 hSysMenu,
2851 NULL,
2854 FALSE);
2855 if (uId != 0)
2856 {
2858 }
2859 }
2860
2861 /* revert the system menu window style */
2863 break;
2864 }
2865
2866 default:
2867 bHandled = FALSE;
2868 }
2869 return TRUE;
2870 }
2871
2873 {
2874 if (!ppt || !prcStartBtn || !pwi)
2875 return FALSE;
2876
2877 switch (m_Position)
2878 {
2879 case ABE_TOP:
2880 case ABE_LEFT:
2881 {
2882 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2883 return FALSE;
2884 break;
2885 }
2886 case ABE_RIGHT:
2887 {
2888 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2889 return FALSE;
2890
2891 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2892 ppt->x > prcStartBtn->right)
2893 {
2894 return FALSE;
2895 }
2896 break;
2897 }
2898 case ABE_BOTTOM:
2899 {
2900 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2901 return FALSE;
2902
2903 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2904 ppt->y > prcStartBtn->bottom)
2905 {
2906 return FALSE;
2907 }
2908
2909 break;
2910 }
2911 }
2912 return TRUE;
2913 }
2914
2916 {
2917 if (!ppt || !prcShowDesktopBtn)
2918 return FALSE;
2920
2921 switch (m_Position)
2922 {
2923 case ABE_LEFT:
2924 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2925 case ABE_TOP:
2926 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2927 case ABE_RIGHT:
2928 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2929 case ABE_BOTTOM:
2930 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2931 }
2932 return FALSE;
2933 }
2934
2940 {
2942 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2943
2944 bHandled = FALSE;
2945
2946 RECT rcStartBtn;
2947 m_StartButton.GetWindowRect(&rcStartBtn);
2948 GetWindowInfo(m_hWnd, &wi);
2949
2950 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2951 {
2952 bHandled = TRUE;
2954 return 0;
2955 }
2956
2959
2960 return 0;
2961 }
2962
2964 {
2965 /* We want the user to be able to get a context menu even on the nonclient
2966 area (including the sizing border)! */
2967 uMsg = WM_CONTEXTMENU;
2968 wParam = (WPARAM) m_hWnd;
2969
2970 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2971 }
2972
2974 {
2975 LRESULT Ret = FALSE;
2976 POINT pt, *ppt = NULL;
2977 HWND hWndExclude = NULL;
2978
2979 /* Check if the administrator has forbidden access to context menus */
2981 return FALSE;
2982
2983 pt.x = (SHORT) LOWORD(lParam);
2984 pt.y = (SHORT) HIWORD(lParam);
2985
2986 if (pt.x != -1 || pt.y != -1)
2987 ppt = &pt;
2988 else
2989 hWndExclude = m_StartButton.m_hWnd;
2990
2992 {
2993 /* Make sure we can't track the context menu if the start
2994 menu is currently being shown */
2996 {
2997 CComPtr<IContextMenu> ctxMenu;
2999 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
3000 }
3001 }
3002 else
3003 {
3004 /* See if the context menu should be handled by the task band site */
3005 if (ppt != NULL && m_TrayBandSite != NULL)
3006 {
3007 HWND hWndAtPt;
3008 POINT ptClient = *ppt;
3009
3010 /* Convert the coordinates to client-coordinates */
3011 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
3012
3013 hWndAtPt = ChildWindowFromPoint(ptClient);
3014 if (hWndAtPt != NULL &&
3015 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
3016 {
3017 /* Check if the user clicked on the task switch window */
3018 ptClient = *ppt;
3019 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
3020
3022 if (hWndAtPt == m_TaskSwitch)
3023 goto HandleTrayContextMenu;
3024
3025 /* Forward the message to the task band site */
3026 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
3027 }
3028 else
3029 goto HandleTrayContextMenu;
3030 }
3031 else
3032 {
3033HandleTrayContextMenu:
3034 /* Tray the default tray window context menu */
3035 TrackCtxMenu(this, ppt, NULL, FALSE, this);
3036 }
3037 }
3038 return Ret;
3039 }
3040
3042 {
3043 LRESULT Ret = FALSE;
3044 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
3045 the rebar control! But we shouldn't forward messages that the band
3046 site doesn't handle, such as other controls (start button, tray window) */
3047
3048 HRESULT hr = E_FAIL;
3049
3050 if (m_TrayBandSite)
3051 {
3052 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
3053 if (SUCCEEDED(hr))
3054 return Ret;
3055 }
3056
3057 if (m_TrayBandSite == NULL || FAILED(hr))
3058 {
3059 const NMHDR *nmh = (const NMHDR *) lParam;
3060
3061 if (nmh->hwndFrom == m_TrayNotify)
3062 {
3063 switch (nmh->code)
3064 {
3065 case NTNWM_REALIGN:
3066 /* Cause all controls to be aligned */
3068 break;
3069 }
3070 }
3071 }
3072 return Ret;
3073 }
3074
3076 {
3077 /* Let the clock handle the double-click */
3079
3080 /* We "handle" this message so users can't cause a weird maximize/restore
3081 window animation when double-clicking the tray window! */
3082 return TRUE;
3083 }
3084
3086 {
3087 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
3088 {
3091 bHandled = TRUE;
3092 }
3093
3094 return FALSE;
3095 }
3096
3098 {
3100 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
3101 return FALSE;
3102 }
3103
3105 {
3106 DestroyWindow();
3107 return TRUE;
3108 }
3109
3111 {
3112 HWND hwndStartMenu;
3113 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3115 return FALSE;
3116
3117 if (::IsWindowVisible(hwndStartMenu))
3118 HideStartMenu();
3119 else
3121
3122 return TRUE;
3123 }
3124
3126 {
3127 /*
3128 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3129 * to show the shutdown dialog. Also a WM_CLOSE message sent
3130 * by apps should show the dialog.
3131 */
3132 return DoExitWindows();
3133 }
3134
3136 {
3137 if (wParam == SC_CLOSE)
3138 {
3139 return DoExitWindows();
3140 }
3141
3142 bHandled = FALSE;
3143 return TRUE;
3144 }
3145
3147 {
3148 bHandled = TRUE;
3149 return (LRESULT)m_TaskSwitch;
3150 }
3151
3152 // TWM_SETZORDER
3154 {
3155 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3157 }
3158
3159 STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
3160 {
3161 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3162 return S_OK;
3163 }
3164
3166 {
3168 {
3169 // Map the ('1'-'9','0') hotkey to a zero-based task index
3170 DWORD iTask = (HIWORD(lParam) - '0' + 9) % 10;
3171 // Request the task switcher to perform the switch
3173 }
3174 return HandleHotKey(wParam);
3175 }
3176
3178 {
3184 };
3185
3187 {
3188 WCHAR szClass[32];
3189 GetClassNameW(hwnd, szClass, _countof(szClass));
3190 return wcscmp(szClass, L"#32770") == 0;
3191 }
3192
3194 {
3196 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3197 return TRUE; // Ignore special windows
3198
3199 if (!info->bShowDesktop)
3200 {
3202 return TRUE;
3203 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3204 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3205 return TRUE;
3206 }
3207
3208 if (CanBeMinimized(hwnd))
3209 {
3210 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3211 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3213 {
3214 info->pMinimizedAll->Add(mwp);
3215 }
3216 }
3217
3218 return TRUE;
3219 }
3220
3221 VOID MinimizeAll(BOOL bShowDesktop = FALSE)
3222 {
3224 info.hwndDesktop = GetDesktopWindow();;
3225 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3226 info.hwndProgman = FindWindowW(L"Progman", NULL);
3227 info.pMinimizedAll = &g_MinimizedAll;
3228 info.bShowDesktop = bShowDesktop;
3230
3233 }
3234
3236 {
3238 }
3239
3241 {
3242 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3243 {
3244 HWND hwnd = g_MinimizedAll[i].hwnd;
3247 }
3248
3250 }
3251
3253 {
3254 LRESULT Ret = FALSE;
3255
3257 {
3258 return FALSE;
3259 }
3260
3261 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3262 {
3263 return HandleCommand(LOWORD(wParam));
3264 }
3265 return Ret;
3266 }
3267
3269 {
3271
3272 if (IsAutoHideState())
3273 {
3275 }
3276
3277 return TRUE;
3278 }
3279
3281 {
3282 switch (wParam)
3283 {
3286 break;
3287 case TIMER_ID_AUTOHIDE:
3289 break;
3290 default:
3291 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3292 bHandled = FALSE;
3293 break;
3294 }
3295 return 0;
3296 }
3297
3299 {
3301 DrawShowDesktopButton(); // We have to draw non-client area
3302 bHandled = TRUE;
3303 return ret;
3304 }
3305
3307 {
3308 RECT *rc = NULL;
3309 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3311 {
3312 bHandled = FALSE;
3313 return 0;
3314 }
3315 if(!wParam)
3316 {
3317 rc = (RECT*)wParam;
3318 }
3319 else
3320 {
3322 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3323 {
3324 bHandled = FALSE;
3325 return 0;
3326 }
3327 rc = &prms->rgrc[0];
3328 }
3329
3331
3332 return 0;
3333 }
3334
3336 {
3337 HMENU hMenu = (HMENU)wParam;
3339 {
3343 if (g_Arrangement != NONE)
3344 {
3347 MENUITEMINFOW mii = { sizeof(mii) };
3349 mii.fMask = MIIM_TYPE;
3350 mii.fType = MFT_STRING;
3351 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3353 }
3354 else
3355 {
3357 }
3358 }
3359 else
3360 {
3366 g_WindowPosBackup.RemoveAll();
3367 }
3368 return 0;
3369 }
3370
3371 // WM_ACTIVATE
3373 {
3375 if (!wParam) // !(Activate || Minimized)
3376 {
3377 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3379 }
3380 return 0;
3381 }
3382
3383 // WM_SETFOCUS
3385 {
3387 return 0;
3388 }
3389
3390 // WM_GETMINMAXINFO
3392 {
3394 SIZE StartSize = m_StartButton.GetSize();
3395 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3396 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3397 return 0;
3398 }
3399
3401 {
3402#if 0
3403 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3404
3405 if (!as->fChanged)
3406 return 0;
3407
3408 RECT rc;
3409 ::GetWindowRect(m_hWnd, &rc);
3410
3411 SIZE szWindow = {
3412 rc.right - rc.left,
3413 rc.bottom - rc.top };
3414 SIZE szTarget = {
3415 as->rcTarget.right - as->rcTarget.left,
3416 as->rcTarget.bottom - as->rcTarget.top };
3417 SIZE szActual = {
3418 as->rcActual.right - as->rcActual.left,
3419 as->rcActual.bottom - as->rcActual.top };
3420
3421 SIZE borders = {
3422 szWindow.cx - szTarget.cx,
3423 szWindow.cy - szTarget.cx,
3424 };
3425
3426 switch (m_Position)
3427 {
3428 case ABE_LEFT:
3429 szWindow.cx = szActual.cx + borders.cx;
3430 break;
3431 case ABE_TOP:
3432 szWindow.cy = szActual.cy + borders.cy;
3433 break;
3434 case ABE_RIGHT:
3435 szWindow.cx = szActual.cx + borders.cx;
3436 rc.left = rc.right - szWindow.cy;
3437 break;
3438 case ABE_BOTTOM:
3439 szWindow.cy = szActual.cy + borders.cy;
3440 rc.top = rc.bottom - szWindow.cy;
3441 break;
3442 }
3443
3444 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3445#else
3446 bHandled = FALSE;
3447#endif
3448 return 0;
3449 }
3450
3452 {
3453 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3454
3455 /* Propagate the new settings to the children */
3458
3459 /* Toggle autohide */
3460 SetAutoHideState(newSettings->sr.AutoHide);
3461
3462 /* Toggle lock state */
3463 Lock(newSettings->bLock);
3464
3465 /* Toggle OnTop state */
3466 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3467
3468 /* Adjust taskbar size */
3470
3472 return 0;
3473 }
3474
3476
3479 {
3480 MSG Msg;
3481 LRESULT lRet;
3482
3483 Msg.hwnd = m_hWnd;
3484 Msg.message = uMsg;
3485 Msg.wParam = wParam;
3486 Msg.lParam = lParam;
3487
3488 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3489 {
3490 return lRet;
3491 }
3492
3493 wParam = Msg.wParam;
3494 lParam = Msg.lParam;
3495 }
3496 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
3498 NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnRebarAutoSize) // Doesn't quite work ;P
3510 MESSAGE_HANDLER(WM_DISPLAYCHANGE, OnDisplayChange)
3543 ALT_MSG_MAP(1)
3544 END_MSG_MAP()
3545
3546 /*****************************************************************************/
3547
3549 {
3550 /* CTaskSwitchWnd does not receive this message directly */
3552 return TRUE;
3553 }
3554
3556 {
3557 MSG Msg;
3558
3559 /* FIXME: We should keep a reference here... */
3560
3561 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3562 {
3563 if (Msg.message == WM_QUIT)
3564 break;
3565
3566 if (m_StartMenuBand == NULL ||
3567 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3568 {
3571 }
3572 }
3573 }
3574
3576 {
3577 MSG Msg;
3578 BOOL Ret;
3579
3580 /* FIXME: We should keep a reference here... */
3581
3582 while (true)
3583 {
3584 Ret = GetMessage(&Msg, NULL, 0, 0);
3585
3586 if (!Ret || Ret == -1)
3587 break;
3588
3589 if (m_StartMenuBand == NULL ||
3590 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3591 {
3594 }
3595 }
3596 }
3597
3598 /*
3599 * IShellDesktopTray
3600 *
3601 * NOTE: this is a very windows-specific COM interface used by SHCreateDesktop()!
3602 * These are the calls I observed, it may be wrong/incomplete/buggy!!!
3603 * The reason we implement it is because we have to use SHCreateDesktop() so
3604 * that the shell provides the desktop window and all the features that come
3605 * with it (especially positioning of desktop icons)
3606 */
3607
3609 GetState() override
3610 {
3611 /* FIXME: Return ABS_ flags? */
3612 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3613 return 0;
3614 }
3615
3617 GetTrayWindow(OUT HWND *phWndTray) override
3618 {
3619 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3620 *phWndTray = m_hWnd;
3621 return S_OK;
3622 }
3623
3625 RegisterDesktopWindow(IN HWND hWndDesktop) override
3626 {
3627 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3628
3629 m_DesktopWnd = hWndDesktop;
3630 return S_OK;
3631 }
3632
3634 Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
3635 {
3636 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3637 return S_OK;
3638 }
3639
3641 {
3642 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3643 return S_OK;
3644 }
3645
3646 // *** IOleWindow methods ***
3647
3649 GetWindow(HWND* phwnd) override
3650 {
3651 if (!phwnd)
3652 return E_INVALIDARG;
3653 *phwnd = m_hWnd;
3654 return S_OK;
3655 }
3656
3658 ContextSensitiveHelp(BOOL fEnterMode) override
3659 {
3660 return E_NOTIMPL;
3661 }
3662
3663 void _Init()
3664 {
3665 m_Position = (DWORD) -1;
3666 }
3667
3669
3672 /*COM_INTERFACE_ENTRY_IID(IID_ITrayWindow, ITrayWindow)*/
3675 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3676 END_COM_MAP()
3677
3678protected:
3680 // AppBar section
3681 //
3682 // See also: appbar.cpp
3683 // TODO: freedesktop _NET_WM_STRUT integration
3684 // TODO: find when a fullscreen app is in the foreground and send FULLSCREENAPP notifications
3685 // TODO: multiple monitor support
3686
3687 BOOL IsAutoHideState() const override { return g_TaskbarSettings.sr.AutoHide; }
3688 BOOL IsHidingState() const override { return m_AutoHideState == AUTOHIDE_HIDING; }
3690 HMONITOR& GetMonitor() override { return m_Monitor; }
3692 INT GetPosition() const override { return m_Position; }
3693 const RECT* GetTrayRect() override { return &m_TrayRects[m_Position]; }
3694 HWND GetTrayWnd() const override { return m_hWnd; }
3695 HWND GetDesktopWnd() const override { return m_DesktopWnd; }
3696
3697 void SetAutoHideState(_In_ BOOL bAutoHide) override
3698 {
3699 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3701
3703 if (bAutoHide)
3705 else
3707 }
3708
3709 void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
3710 {
3711 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3712 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3713 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3714 }
3715};
3716
3718 public CComCoClass<CTrayWindowCtxMenu>,
3719 public CComObjectRootEx<CComMultiThreadModelNoCS>,
3720 public IContextMenu
3721{
3726
3727public:
3728 HRESULT Initialize(ITrayWindow * pTrayWnd, IN HWND hWndOwner)
3729 {
3730 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3731 this->hWndOwner = hWndOwner;
3732 this->m_idCmdCmFirst = 0;
3733 return S_OK;
3734 }
3735
3738 UINT indexMenu,
3739 UINT idCmdFirst,
3740 UINT idCmdLast,
3741 UINT uFlags) override
3742 {
3743 HMENU hMenuBase;
3744
3746 if (!hMenuBase)
3748
3750 {
3752 MENUITEMINFOW mii = { sizeof(mii) };
3753 mii.fMask = MIIM_ID | MIIM_TYPE;
3755 mii.fType = MFT_STRING;
3756 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3758 }
3759
3761 {
3762 DeleteMenu(hPopup,
3764 MF_BYCOMMAND);
3765 }
3766
3767 CheckMenuItem(hMenuBase,
3770
3771 UINT idCmdNext;
3772 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3773 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3774
3775 ::DestroyMenu(hMenuBase);
3776
3777 if (TrayWnd->m_TrayBandSite != NULL)
3778 {
3779 pcm.Release();
3780 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3781 hPopup,
3782 indexMenu,
3783 idCmdNext,
3784 idCmdLast,
3785 CMF_NORMAL,
3786 &pcm)))
3787 {
3788 WARN("AddContextMenus failed.\n");
3789 pcm.Release();
3790 }
3791 }
3792
3793 return S_OK;
3794 }
3795
3798 {
3799 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3800 if (uiCmdId != 0)
3801 {
3802 if (uiCmdId >= m_idCmdCmFirst)
3803 {
3804 CMINVOKECOMMANDINFO cmici = { 0 };
3805
3806 if (pcm != NULL)
3807 {
3808 /* Setup and invoke the shell command */
3809 cmici.cbSize = sizeof(cmici);
3810 cmici.hwnd = hWndOwner;
3811 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3812 cmici.nShow = SW_NORMAL;
3813
3814 pcm->InvokeCommand(&cmici);
3815 }
3816 }
3817 else
3818 {
3819 TrayWnd->ExecContextMenuCmd(uiCmdId);
3820 }
3821 }
3822
3823 return S_OK;
3824 }
3825
3828 UINT_PTR idCmd,
3829 UINT uType,
3830 UINT *pwReserved,
3831 LPSTR pszName,
3832 UINT cchMax) override
3833 {
3834 return E_NOTIMPL;
3835 }
3836
3838 {
3839 }
3840
3842 {
3843 }
3844
3846 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3847 END_COM_MAP()
3848};
3849
3850HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu)
3851{
3853 mnu->Initialize(TrayWnd, hWndOwner);
3854 *ppCtxMenu = mnu;
3855 return S_OK;
3856}
3857
3858HRESULT CreateTrayWindow(ITrayWindow ** ppTray)
3859{
3861 if (Tray == NULL)
3862 return E_OUTOFMEMORY;
3863
3864 Tray->_Init();
3865 Tray->Open();
3866
3867 *ppTray = (ITrayWindow *) Tray;
3868
3869 return S_OK;
3870}
3871
3872HRESULT
3874{
3875 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3876 return TrayWindow->RaiseStartButton();
3877}
3878
3879VOID TrayProcessMessages(ITrayWindow *Tray)
3880{
3881 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3882 TrayWindow->TrayProcessMessages();
3883}
3884
3885VOID TrayMessageLoop(ITrayWindow *Tray)
3886{
3887 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3888 TrayWindow->TrayMessageLoop();
3889}
#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
#define TSWM_ACTIVATETASKINDEX
Definition: precomp.h:398
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:185
VOID Initialize()
Definition: traywnd.cpp:244
VOID UpdateFont()
Definition: traywnd.cpp:228
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:295
SIZE GetSize()
Definition: traywnd.cpp:207
VOID UpdateSize()
Definition: traywnd.cpp:212
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:264
HFONT m_Font
Definition: traywnd.cpp:187
virtual ~CStartButton()
Definition: traywnd.cpp:198
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:3728
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
Definition: traywnd.cpp:3797
STDMETHODIMP QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition: traywnd.cpp:3737
virtual ~CTrayWindowCtxMenu()
Definition: traywnd.cpp:3841
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3723
STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
Definition: traywnd.cpp:3827
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3724
LRESULT OnHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3165
LRESULT OnEnterSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2783
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:637
DWORD m_DraggingPosition
Definition: traywnd.cpp:341
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2544
HWND m_TaskSwitch
Definition: traywnd.cpp:333
LRESULT OnSysColorChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2654
VOID ResizeWorkArea()
Definition: traywnd.cpp:1583
VOID ToggleDesktop()
Definition: traywnd.cpp:647
DWORD Flags
Definition: traywnd.cpp:363
BOOL IsHidingState() const override
Definition: traywnd.cpp:3688
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3697
LRESULT OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2796
LRESULT OnSetZOrder(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3153
LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2524
HWND m_Rebar
Definition: traywnd.cpp:332
VOID ShowDesktop()
Definition: traywnd.cpp:3235
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2632
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3451
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1333
HMONITOR m_Monitor
Definition: traywnd.cpp:339
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3268
CStartButton m_StartButton
Definition: traywnd.cpp:319
LRESULT OnDoExitWindows(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3125
HWND STDMETHODCALLTYPE GetHWND()
Definition: traywnd.cpp:2234
HMONITOR & GetPreviousMonitor() override
Definition: traywnd.cpp:3691
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1879
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:814
VOID RestoreAll()
Definition: traywnd.cpp:3240
LRESULT OnCtlColorBtn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2648
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:359
VOID ShowFolder(INT csidl, BOOL bExplore)
Definition: traywnd.cpp:751
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2140
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1106
LRESULT OnWinMMDeviceChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3548
DWORD m_Position
Definition: traywnd.cpp:338
const RECT * GetTrayRect() override
Definition: traywnd.cpp:3693
HTHEME m_Theme
Definition: traywnd.cpp:327
BOOL STDMETHODCALLTYPE IsHorizontal()
Definition: traywnd.cpp:2245
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:352
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:325
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:340
HDPA m_ShellServices
Definition: traywnd.cpp:354
LRESULT OnInitMenuPopup(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3335
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2580
DWORD WINAPI TrayPropertiesThread()
Definition: traywnd.cpp:562
SIZE m_TraySize
Definition: traywnd.cpp:345
LRESULT OnNcCalcSize(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3306
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1158
DWORD InSizeMove
Definition: traywnd.cpp:367
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3041
RECT m_TrayRects[4]
Definition: traywnd.cpp:344
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2607
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:537
GetState() override
Definition: traywnd.cpp:3609
VOID RegLoadSettings()
Definition: traywnd.cpp:1657
LRESULT OnNcRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2963
VOID TrayProcessMessages()
Definition: traywnd.cpp:3555
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:342
HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: traywnd.cpp:2344
LRESULT OnEndSession(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2517
BOOL STDMETHODCALLTYPE IsTaskWnd(HWND hWnd)
Definition: traywnd.cpp:2303
BOOL IsPointWithinShowDesktopButton(LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2915
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1271
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2124
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:323
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:598
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1196
STDMETHODIMP GetTrayWindow(OUT HWND *phWndTray) override
Definition: traywnd.cpp:3617
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1276
void ProcessMouseTracking()
Definition: traywnd.cpp:1962
INT GetPosition() const override
Definition: traywnd.cpp:3692
LRESULT OnNcLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3075
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2939
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2512
BOOL STDMETHODCALLTYPE Lock(IN BOOL bLock)
Definition: traywnd.cpp:2250
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1546
void RefreshStartMenuSettings()
Definition: traywnd.cpp:467
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2973
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3193
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3709
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3687
HRESULT STDMETHODCALLTYPE Open()
Definition: traywnd.cpp:2184
LRESULT OnGetTaskSwitch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3146
LRESULT OnSysChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2809
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3280
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:432
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:591
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:619
DWORD IsDragging
Definition: traywnd.cpp:368
UINT m_WinMMDevChgMsg
Definition: traywnd.cpp:356
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3186
HRESULT STDMETHODCALLTYPE Close()
Definition: traywnd.cpp:2221
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1635
LRESULT OnNcLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3085
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3135
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:336
UINT m_AutoHideState
Definition: traywnd.cpp:350
LRESULT OnMoving(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2714
void PopupStartMenu()
Definition: traywnd.cpp:1921
LRESULT OnSetFocus(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3384
LRESULT OnGetMinMaxInfo(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3391
void UpdateFonts()
Definition: traywnd.cpp:1075
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:765
STDMETHODIMP RegisterDesktopWindow(IN HWND hWndDesktop) override
Definition: traywnd.cpp:3625
HMONITOR & GetMonitor() override
Definition: traywnd.cpp:3690
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2736
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:320
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1735
LRESULT OnOpenStartMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3110
static DWORD CALLBACK EjectThreadProc(LPVOID arg)
Definition: traywnd.cpp:808
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:347
void DrawShowDesktopButton()
Definition: traywnd.cpp:2625
SIZE m_AutoHideOffset
Definition: traywnd.cpp:351
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2757
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3252
LRESULT OnAppTrayDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3104
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1225
HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: traywnd.cpp:2336
STDMETHODIMP Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
Definition: traywnd.cpp:3634
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: traywnd.cpp:3658
LRESULT OnActivate(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3372
BOOL IsAlwaysOnTop() const override
Definition: traywnd.cpp:3689
VOID HideStartMenu()
Definition: traywnd.cpp:746
VOID TrayMessageLoop()
Definition: traywnd.cpp:3575
HWND GetTrayWnd() const override
Definition: traywnd.cpp:3694
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1435
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2239
virtual ~CTrayWindow()
Definition: traywnd.cpp:401
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:348
HWND GetDesktopWnd() const override
Definition: traywnd.cpp:3695
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2659
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3221
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3649
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1250
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3097
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3640
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1133
LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3298
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:924
DWORD WINAPI RunFileDlgThread()
Definition: traywnd.cpp:501
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2360
DWORD NewPosSize
Definition: traywnd.cpp:369
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:995
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2593
void _Init()
Definition: traywnd.cpp:3663
LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2751
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2872
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:322
HFONT m_Font
Definition: traywnd.cpp:329
LRESULT DoExitWindows()
Definition: traywnd.cpp:472
void ProcessAutoHide()
Definition: traywnd.cpp:2009
HWND m_DesktopWnd
Definition: traywnd.cpp:331
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1453
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:326
void SaveState()
Definition: traywnd.cpp:456
HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: traywnd.cpp:2320
LRESULT OnRebarAutoSize(INT code, LPNMHDR nmhdr, BOOL &bHandled)
Definition: traywnd.cpp:3400
STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
Definition: traywnd.cpp:3159
BOOL STDMETHODCALLTYPE ExecContextMenuCmd(IN UINT uiCmd)
Definition: traywnd.cpp:659
void DisplayRunFileDlg()
Definition: traywnd.cpp:543
HWND m_TrayNotify
Definition: traywnd.cpp:334
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1887 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:1277
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_ALT
Definition: imm.h:184
#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 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
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
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
#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:2576
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:3182
HWND hwndDesktop
Definition: traywnd.cpp:108
HWND hwndProgman
Definition: traywnd.cpp:109
BOOL bMustBeInMonitor
Definition: traywnd.cpp:111
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:172
HWND hwnd
Definition: traywnd.cpp:171
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
TW_STRUCKRECTS2 sr
Definition: precomp.h:228
WINDOWPLACEMENT wplt
Definition: traywnd.cpp:54
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:180
#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:58
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:56
VOID TrayProcessMessages(ITrayWindow *Tray)
Definition: traywnd.cpp:3879
#define IDHK_RUN
Definition: traywnd.cpp:34
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:27
enum @125 g_Arrangement
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:17
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:174
VOID TrayMessageLoop(ITrayWindow *Tray)
Definition: traywnd.cpp:3885
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:26
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3873
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:30
HRESULT CreateTrayWindow(ITrayWindow **ppTray)
Definition: traywnd.cpp:3858
#define IDHK_DESKTOP
Definition: traywnd.cpp:44
@ TILED
Definition: traywnd.cpp:49
@ NONE
Definition: traywnd.cpp:49
@ CASCADED
Definition: traywnd.cpp:49
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:90
#define IDHK_EXPLORE
Definition: traywnd.cpp:38
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:155
#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:115
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:29
VOID RestoreWindowPos()
Definition: traywnd.cpp:78
#define IDHK_ACTIVATE_TASK
Definition: traywnd.cpp:47
#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:73
#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:3850
#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