ReactOS 0.4.17-dev-243-g1369312
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 "appbar.h"
13
14HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
15
16#define WM_APP_TRAYDESTROY (WM_APP + 0x100)
17
18#define TIMER_ID_AUTOHIDE 1
19#define TIMER_ID_MOUSETRACK 2
20#define MOUSETRACK_INTERVAL 100
21#define AUTOHIDE_DELAY_HIDE 2000
22#define AUTOHIDE_DELAY_SHOW 50
23#define AUTOHIDE_INTERVAL_ANIMATING 10
24
25#define AUTOHIDE_SPEED_SHOW 10
26#define AUTOHIDE_SPEED_HIDE 1
27
28#define AUTOHIDE_HIDDEN 0
29#define AUTOHIDE_SHOWING 1
30#define AUTOHIDE_SHOWN 2
31#define AUTOHIDE_HIDING 3
32
33#define IDHK_RUN 0x1f4
34#define IDHK_MINIMIZE_ALL 0x1f5
35#define IDHK_RESTORE_ALL 0x1f6
36#define IDHK_HELP 0x1f7
37#define IDHK_EXPLORE 0x1f8
38#define IDHK_FIND 0x1f9
39#define IDHK_FIND_COMPUTER 0x1fa
40#define IDHK_NEXT_TASK 0x1fb
41#define IDHK_PREV_TASK 0x1fc
42#define IDHK_SYS_PROPERTIES 0x1fd
43#define IDHK_DESKTOP 0x1fe
44#define IDHK_PAGER 0x1ff
45
47
49{
52};
54
56{
57 WINDOWPOSBACKUPDATA wposdata;
58 HWND hDesk = GetDesktopWindow();
59 if (IsWindowVisible(hwnd) && !IsIconic(hwnd) && (hwnd != hDesk))
60 {
61 wposdata.hwnd = hwnd;
62 wposdata.wplt.length = sizeof(wposdata.wplt);
63 GetWindowPlacement(hwnd, &(wposdata.wplt));
64 g_WindowPosBackup.Add(wposdata);
65 }
66
67 return TRUE;
68}
69
71{
73}
74
76{
78
79 for (INT i = g_WindowPosBackup.GetSize() - 1; i >= 0; --i)
80 {
82 }
83
84 g_WindowPosBackup.RemoveAll();
85}
86
88{
91 {
93 return TRUE;
94
96 if (!(exstyle & WS_EX_TOPMOST))
97 return TRUE;
98 }
99 return FALSE;
100}
101
103{
109};
110
111static BOOL CALLBACK
113{
115
116 if (!CanBeMinimized(hwnd))
117 return TRUE; // continue
118
119 if (pei->hTrayWnd == hwnd || pei->hwndDesktop == hwnd ||
120 pei->hwndProgman == hwnd)
121 {
122 return TRUE; // continue
123 }
124
125 if (pei->bMustBeInMonitor)
126 {
127 // is the window in the nearest monitor?
128 HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
129 if (hMon)
130 {
132 ZeroMemory(&info, sizeof(info));
133 info.cbSize = sizeof(info);
134 if (GetMonitorInfoW(hMon, &info))
135 {
136 RECT rcWindow, rcMonitor, rcIntersect;
137 rcMonitor = info.rcMonitor;
138
139 GetWindowRect(hwnd, &rcWindow);
140
141 if (!IntersectRect(&rcIntersect, &rcMonitor, &rcWindow))
142 return TRUE; // continue
143 }
144 }
145 }
146
147 pei->hwndFound = hwnd;
148 return FALSE; // stop if found
149}
150
151static BOOL
153{
155 ei.hwndFound = NULL;
157 ei.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
158 ei.hwndProgman = FindWindowW(L"Progman", NULL);
159 ei.bMustBeInMonitor = bMustBeInMonitor;
160
162 return ei.hwndFound != NULL;
163}
164
165/* Minimized window position info */
167{
170};
172
173/*
174 * ITrayWindow
175 */
176
177const GUID IID_IShellDesktopTray = { 0x213e2df9, 0x9a14, 0x4328, { 0x99, 0xb1, 0x69, 0x61, 0xf9, 0x14, 0x3c, 0xe9 } };
178
180 : public CWindowImpl<CStartButton>
181{
184 HFONT m_Font;
185
186public:
188 : m_ImageList(NULL),
189 m_Font(NULL)
190 {
191 m_Size.cx = 0;
192 m_Size.cy = 0;
193 }
194
196 {
197 if (m_ImageList != NULL)
199
200 if (m_Font != NULL)
202 }
203
205 {
206 return m_Size;
207 }
208
210 {
211 SIZE Size = { 0, 0 };
212
213 if (m_ImageList == NULL ||
215 {
217 }
218
220
221 /* Save the size of the start button */
222 m_Size = Size;
223 }
224
226 {
227 /* Get the system fonts, we use the caption font, always bold, though. */
228 NONCLIENTMETRICS ncm = {sizeof(ncm)};
229 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
230 return;
231
232 if (m_Font)
234
235 ncm.lfCaptionFont.lfWeight = FW_BOLD;
236 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
237
239 }
240
242 {
243 // HACK & FIXME: CORE-18016
244 HWND hWnd = m_hWnd;
245 m_hWnd = NULL;
247
248 SetWindowTheme(m_hWnd, L"Start", NULL);
249
252 0, 0, 0,
255
258 UpdateSize();
259 }
260
262 {
263 WCHAR szStartCaption[32];
265 IDS_START,
266 szStartCaption,
267 _countof(szStartCaption)))
268 {
269 wcscpy(szStartCaption, L"Start");
270 }
271
273
274 // HACK & FIXME: CORE-18016
276 0,
277 WC_BUTTON,
278 szStartCaption,
279 dwStyle,
280 0, 0, 0, 0,
284 NULL);
285
286 if (m_hWnd)
287 Initialize();
288
289 return m_hWnd;
290 }
291
293 {
294 if (uMsg == WM_KEYUP && wParam != VK_SPACE)
295 return 0;
296
298 return 0;
299 }
300
304};
305
307 public CComCoClass<CTrayWindow>,
308 public CComObjectRootEx<CComMultiThreadModelNoCS>,
309 public CWindowImpl < CTrayWindow, CWindow, CControlWinTraits >,
310 public CAppBarManager,
311 public ITrayWindow,
312 public IShellDesktopTray,
313 public IOleWindow,
314 public IContextMenu
315{
318
321
325
326 HFONT m_Font;
327
332
334
340
343
346
350
352
353public:
355
356 union
357 {
359 struct
360 {
361 /* UI Status */
365 };
366 };
367
368public:
372 m_Theme(NULL),
373 m_Font(NULL),
375 m_Rebar(NULL),
378 m_Position(0),
387 Flags(0)
388 {
393 }
394
395 virtual ~CTrayWindow()
396 {
397 if (m_ShellServices != NULL)
398 {
401 }
402
403 if (m_Font != NULL)
404 {
406 m_Font = NULL;
407 }
408
409 if (m_Theme)
410 {
412 m_Theme = NULL;
413 }
414
416 }
417
418
419
420
421
422 /**********************************************************
423 * ##### command handling #####
424 */
425
427 {
428 WCHAR szCommand[256];
429 WCHAR *pszParameters;
430
432 id,
433 szCommand,
434 _countof(szCommand)))
435 {
436 return E_FAIL;
437 }
438
439 pszParameters = wcschr(szCommand, L'>');
440 if (pszParameters)
441 {
442 *pszParameters = 0;
443 pszParameters++;
444 }
445
446 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
447 return S_OK;
448 }
449
451 {
453 return;
454
456
459 }
460
462 {
464 return 0;
465
466 SaveState();
467
468 /* Display the ReactOS Shutdown Dialog */
470
471 /*
472 * If the user presses CTRL+ALT+SHIFT while exiting
473 * the shutdown dialog, exit the shell cleanly.
474 */
475 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
476 (GetKeyState(VK_SHIFT) & 0x8000) &&
477 (GetKeyState(VK_MENU) & 0x8000))
478 {
479 PostMessage(WM_QUIT, 0, 0);
480 }
481 return 0;
482 }
483
485 {
486 HWND hwnd;
487 RECT posRect;
488
490
492 WC_STATIC,
493 NULL,
495 posRect.left,
496 posRect.top,
497 posRect.right - posRect.left,
498 posRect.bottom - posRect.top,
499 NULL,
500 NULL,
501 NULL,
502 NULL);
503
505
506 // build the default directory from two environment variables
507 CStringW strDefaultDir, strHomePath;
508 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
509 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
510 strDefaultDir += strHomePath;
511
513
516
517 return 0;
518 }
519
521 {
522 CTrayWindow * This = (CTrayWindow*) pParam;
523 return This->RunFileDlgThread();
524 }
525
527 {
528 HWND hRunDlg;
530 {
532 if (hRunDlg != NULL &&
533 hRunDlg != m_RunFileDlgOwner)
534 {
535 SetForegroundWindow(hRunDlg);
536 return;
537 }
538 }
539
541 if (hThread)
543 }
544
546 {
547 HWND hwnd;
548 RECT posRect;
549
552 WC_STATIC,
553 NULL,
555 posRect.left,
556 posRect.top,
557 posRect.right - posRect.left,
558 posRect.bottom - posRect.top,
559 NULL,
560 NULL,
561 NULL,
562 NULL);
563
565
567
570
571 return 0;
572 }
573
575 {
576 CTrayWindow *This = (CTrayWindow*) pParam;
577
578 return This->TrayPropertiesThread();
579 }
580
582 {
583 HWND hTrayProp;
584
586 {
588 if (hTrayProp != NULL &&
589 hTrayProp != m_TrayPropertiesOwner)
590 {
591 SetForegroundWindow(hTrayProp);
592 return NULL;
593 }
594 }
595
597 if (hThread)
599 return NULL;
600 }
601
603 {
604 WCHAR szDir[MAX_PATH];
605
606 if (SHGetSpecialFolderPath(hWndOwner,
607 szDir,
609 FALSE))
610 {
611 ShellExecute(hWndOwner,
612 lpOperation,
613 szDir,
614 NULL,
615 NULL,
617 }
618 }
619
621 {
622 ShellExecute(hWndOwner,
623 TEXT("open"),
624 TEXT("taskmgr.exe"),
625 NULL,
626 NULL,
628 }
629
631 {
633 {
634 ShowDesktop();
635 }
636 else
637 {
638 RestoreAll();
639 }
640 }
641
643 {
644 switch (uiCmd)
645 {
648 break;
649
652 TEXT("open"));
653 break;
654
657 TEXT("explore"));
658 break;
659
660 case ID_LOCKTASKBAR:
662 break;
663
666 break;
667
670 break;
671
673 ShowDesktop();
674 break;
675
678 if (g_Arrangement == NONE)
679 {
681 }
685 break;
686
689 if (g_Arrangement == NONE)
690 {
692 }
696 break;
697
700 if (g_Arrangement == NONE)
701 {
703 }
707 break;
708
711 break;
712
714 //FIXME: Use SHRunControlPanel
715 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
716 break;
717
719 RestoreAll();
720 break;
721
722 default:
723 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
724 return FALSE;
725 }
726
727 return TRUE;
728 }
729
731 {
732 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
733 }
734
735 VOID ShowFolder(INT csidl, BOOL bExplore)
736 {
737 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST };
738 if (bExplore)
739 sei.lpVerb = L"explore";
740 sei.nShow = SW_SHOWNORMAL;
742 if (sei.lpIDList)
743 {
744 ShellExecuteExW(&sei);
746 }
747 }
748
750 {
751 switch (id)
752 {
753 case IDHK_RUN:
756 break;
757 case IDHK_HELP:
759 break;
760 case IDHK_EXPLORE:
762 break;
763 case IDHK_FIND:
765 break;
768 break;
770 //FIXME: Use SHRunControlPanel
771 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
772 break;
773 case IDHK_NEXT_TASK:
774 break;
775 case IDHK_PREV_TASK:
776 break;
778 MinimizeAll();
779 break;
780 case IDHK_RESTORE_ALL:
781 RestoreAll();
782 break;
783 case IDHK_DESKTOP:
785 break;
786 case IDHK_PAGER:
787 break;
788 }
789
790 return 0;
791 }
792
794 {
796 return 0;
797 }
798
800 {
801 switch (uCommand)
802 {
805#if 0 // FIXME: This won't work
808#else
810#endif
811 break;
815 break;
817 SaveState();
818 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
819 break;
820 case TRAYCMD_CASCADE:
822 break;
823 case TRAYCMD_TILE_H:
825 break;
826 case TRAYCMD_TILE_V:
828 break;
831 break;
833 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
834 break;
835 case TRAYCMD_EJECT:
837 break;
840 break;
842 MinimizeAll();
843 break;
845 RestoreAll();
846 break;
848 ShowDesktop();
849 break;
852 break;
854 break;
857 {
860 }
861 break;
864 break;
868 break;
871 break;
875 break;
877 // TODO:
878 break;
880 UpdateWindow();
881 Sleep(100);
882 //DisconnectWindowsDialog(m_DesktopWnd); // FIXME: shell32
883 break;
884 case IDM_SEARCH:
887 break;
890 break;
891 default:
892 break;
893 }
894
895 return FALSE;
896 }
897
898
900 IN HMENU hMenu,
901 IN POINT *ppt OPTIONAL,
902 IN HWND hwndExclude OPTIONAL,
903 IN BOOL TrackUp,
904 IN BOOL IsContextMenu)
905 {
906 TPMPARAMS tmp, *ptmp = NULL;
907 POINT pt;
908 UINT cmdId;
909 UINT fuFlags;
910
911 if (hwndExclude != NULL)
912 {
913 /* Get the client rectangle and map it to screen coordinates */
914 if (::GetClientRect(hwndExclude,
915 &tmp.rcExclude) &&
916 ::MapWindowPoints(hwndExclude,
917 NULL,
918 (LPPOINT) &tmp.rcExclude,
919 2) != 0)
920 {
921 ptmp = &tmp;
922 }
923 }
924
925 if (ppt == NULL)
926 {
927 if (ptmp == NULL &&
928 GetClientRect(&tmp.rcExclude) &&
930 NULL,
931 (LPPOINT) &tmp.rcExclude,
932 2) != 0)
933 {
934 ptmp = &tmp;
935 }
936
937 if (ptmp != NULL)
938 {
939 /* NOTE: TrackPopupMenuEx will eventually align the track position
940 for us, no need to take care of it here as long as the
941 coordinates are somewhere within the exclusion rectangle */
942 pt.x = ptmp->rcExclude.left;
943 pt.y = ptmp->rcExclude.top;
944 }
945 else
946 pt.x = pt.y = 0;
947 }
948 else
949 pt = *ppt;
950
951 tmp.cbSize = sizeof(tmp);
952
953 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
954 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
955 if (IsContextMenu)
956 fuFlags |= TPM_RIGHTBUTTON;
957 else
958 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
959
960 cmdId = TrackPopupMenuEx(hMenu,
961 fuFlags,
962 pt.x,
963 pt.y,
964 m_hWnd,
965 ptmp);
966
967 return cmdId;
968 }
969
971 IN IContextMenu * contextMenu,
972 IN POINT *ppt OPTIONAL,
973 IN HWND hwndExclude OPTIONAL,
974 IN BOOL TrackUp,
976 {
977 POINT pt;
979 RECT rc;
980 HRESULT hr;
981 UINT uCommand;
982 HMENU popup = CreatePopupMenu();
983
984 if (popup == NULL)
985 return E_FAIL;
986
987 if (ppt)
988 {
989 pt = *ppt;
990 }
991 else
992 {
994 pt.x = rc.left;
995 pt.y = rc.top;
996 }
997
998 TRACE("Before Query\n");
999 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
1001 {
1002 TRACE("Query failed\n");
1003 DestroyMenu(popup);
1004 return hr;
1005 }
1006
1007 TRACE("Before Tracking\n");
1009 if (hwndExclude)
1010 {
1011 ::GetWindowRect(hwndExclude, &rc);
1012 ZeroMemory(&params, sizeof(params));
1013 params.cbSize = sizeof(params);
1014 params.rcExclude = rc;
1015 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
1016 }
1017 else
1018 {
1019 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
1020 }
1022
1023 if (uCommand != 0)
1024 {
1025 TRACE("Before InvokeCommand\n");
1026 CMINVOKECOMMANDINFO cmi = { 0 };
1027 cmi.cbSize = sizeof(cmi);
1028 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
1029 cmi.hwnd = m_hWnd;
1030 hr = contextMenu->InvokeCommand(&cmi);
1031 }
1032 else
1033 {
1034 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1035 hr = S_FALSE;
1036 }
1037
1038 DestroyMenu(popup);
1039 return hr;
1040 }
1041
1042
1043
1044
1045
1046 /**********************************************************
1047 * ##### moving and sizing handling #####
1048 */
1049
1051 {
1052 /* There is nothing to do if themes are enabled */
1053 if (m_Theme)
1054 return;
1055
1057
1058 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1059 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1060 {
1061 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1062 return;
1063 }
1064
1065 if (m_Font != NULL)
1067
1068 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1069 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1070 if (!m_Font)
1071 {
1072 ERR("CreateFontIndirect failed\n");
1073 return;
1074 }
1075
1079 }
1080
1082 IN OUT RECT *pRect,
1084 {
1086 HMONITOR hMon;
1087
1088 mi.cbSize = sizeof(mi);
1089 hMon = MonitorFromRect(pRect, dwFlags);
1090 if (hMon != NULL &&
1091 GetMonitorInfo(hMon, &mi))
1092 {
1093 *pRect = mi.rcMonitor;
1094 }
1095 else
1096 {
1097 pRect->left = 0;
1098 pRect->top = 0;
1099 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1100 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1101
1102 hMon = NULL;
1103 }
1104
1105 return hMon;
1106 }
1107
1109 IN const RECT *pRect)
1110 {
1111 HMONITOR hMon;
1112
1113 /* In case the monitor sizes or saved sizes differ a bit (probably
1114 not a lot, only so the tray window overlaps into another monitor
1115 now), minimize the risk that we determine a wrong monitor by
1116 using the center point of the tray window if we can't determine
1117 it using the rectangle. */
1118 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1119 if (hMon == NULL)
1120 {
1121 POINT pt;
1122
1123 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1124 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1125
1126 /* be less error-prone, find the nearest monitor */
1127 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1128 }
1129
1130 return hMon;
1131 }
1132
1134 IN HMONITOR hMonitor,
1135 IN OUT RECT *pRect)
1136 {
1137 HMONITOR hMon = NULL;
1138
1139 if (hMonitor != NULL)
1140 {
1142
1143 mi.cbSize = sizeof(mi);
1144 if (!GetMonitorInfo(hMonitor, &mi))
1145 {
1146 /* Hm, the monitor is gone? Try to find a monitor where it
1147 could be located now */
1148 hMon = GetMonitorFromRect(pRect);
1149 if (hMon == NULL ||
1150 !GetMonitorInfo(hMon, &mi))
1151 {
1152 hMon = NULL;
1153 goto GetPrimaryRect;
1154 }
1155 }
1156
1157 *pRect = mi.rcMonitor;
1158 }
1159 else
1160 {
1161GetPrimaryRect:
1162 pRect->left = 0;
1163 pRect->top = 0;
1164 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1165 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1166 }
1167
1168 return hMon;
1169 }
1170
1172 {
1174 SIZE size;
1175
1176 if (pos > ABE_BOTTOM)
1177 pos = ABE_BOTTOM;
1178
1179 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1181 return;
1182
1183 switch (pos)
1184 {
1185 case ABE_TOP:
1186 rc->bottom -= size.cy;
1187 break;
1188 case ABE_BOTTOM:
1189 rc->top += size.cy;
1190 break;
1191 case ABE_LEFT:
1192 rc->right -= size.cx;
1193 break;
1194 case ABE_RIGHT:
1195 rc->left += size.cx;
1196 break;
1197 }
1198 }
1199
1201 IN const SIZE *pTraySize,
1202 IN OUT RECT *pRect)
1203 {
1204 switch (Position)
1205 {
1206 case ABE_LEFT:
1207 pRect->right = pRect->left + pTraySize->cx;
1208 break;
1209
1210 case ABE_TOP:
1211 pRect->bottom = pRect->top + pTraySize->cy;
1212 break;
1213
1214 case ABE_RIGHT:
1215 pRect->left = pRect->right - pTraySize->cx;
1216 break;
1217
1218 case ABE_BOTTOM:
1219 default:
1220 pRect->top = pRect->bottom - pTraySize->cy;
1221 break;
1222 }
1223 }
1224
1226 IN const RECT *pScreen,
1227 IN const SIZE *pTraySize OPTIONAL,
1228 OUT RECT *pRect)
1229 {
1230 if (pTraySize == NULL)
1231 pTraySize = &m_TraySize;
1232
1233 *pRect = *pScreen;
1234
1235 if(!m_Theme)
1236 {
1237 /* Move the border outside of the screen */
1238 InflateRect(pRect,
1241 }
1242
1243 MakeTrayRectWithSize(Position, pTraySize, pRect);
1244 }
1245
1247 {
1248 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1249 }
1250
1253 IN OUT RECT *pRect)
1254 {
1255 RECT rcScreen;
1256 //BOOL Horizontal;
1257 HMONITOR hMon;
1258 SIZE szMax, szWnd;
1259
1260 //Horizontal = IsPosHorizontal();
1261
1262 szWnd.cx = pRect->right - pRect->left;
1263 szWnd.cy = pRect->bottom - pRect->top;
1264
1265 rcScreen = *pRect;
1266 hMon = GetScreenRectFromRect(
1267 &rcScreen,
1268 MONITOR_DEFAULTTONEAREST);
1269
1270 /* Calculate the maximum size of the tray window and limit the window
1271 size to half of the screen's size. */
1272 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1273 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1274 if (szWnd.cx > szMax.cx)
1275 szWnd.cx = szMax.cx;
1276 if (szWnd.cy > szMax.cy)
1277 szWnd.cy = szMax.cy;
1278
1279 /* FIXME - calculate */
1280
1282 &rcScreen,
1283 &szWnd,
1284 pRect);
1285
1286 return hMon;
1287 }
1288
1289#if 0
1290 VOID
1291 GetMinimumWindowSize(
1292 OUT RECT *pRect)
1293 {
1294 RECT rcMin = {0};
1295
1296 AdjustWindowRectEx(&rcMin,
1298 GWL_STYLE),
1299 FALSE,
1301 GWL_EXSTYLE));
1302
1303 *pRect = rcMin;
1304 }
1305#endif
1306
1307
1309 IN POINT pt,
1310 OUT RECT *pRect,
1311 OUT HMONITOR *phMonitor)
1312 {
1313 HMONITOR hMon, hMonNew;
1314 DWORD PosH, PosV, Pos;
1315 SIZE DeltaPt, ScreenOffset;
1316 RECT rcScreen;
1317
1318 rcScreen.left = 0;
1319 rcScreen.top = 0;
1320
1321 /* Determine the screen rectangle */
1322 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1323 if (hMon != NULL)
1324 {
1326
1327 mi.cbSize = sizeof(mi);
1328 if (!GetMonitorInfo(hMon, &mi))
1329 {
1330 hMon = NULL;
1331 goto GetPrimaryScreenRect;
1332 }
1333
1334 /* make left top corner of the screen zero based to
1335 make calculations easier */
1336 pt.x -= mi.rcMonitor.left;
1337 pt.y -= mi.rcMonitor.top;
1338
1339 ScreenOffset.cx = mi.rcMonitor.left;
1340 ScreenOffset.cy = mi.rcMonitor.top;
1341 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1342 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1343 }
1344 else
1345 {
1346GetPrimaryScreenRect:
1347 ScreenOffset.cx = 0;
1348 ScreenOffset.cy = 0;
1351 }
1352
1353 /* Calculate the nearest screen border */
1354 if (pt.x < rcScreen.right / 2)
1355 {
1356 DeltaPt.cx = pt.x;
1357 PosH = ABE_LEFT;
1358 }
1359 else
1360 {
1361 DeltaPt.cx = rcScreen.right - pt.x;
1362 PosH = ABE_RIGHT;
1363 }
1364
1365 if (pt.y < rcScreen.bottom / 2)
1366 {
1367 DeltaPt.cy = pt.y;
1368 PosV = ABE_TOP;
1369 }
1370 else
1371 {
1372 DeltaPt.cy = rcScreen.bottom - pt.y;
1373 PosV = ABE_BOTTOM;
1374 }
1375
1376 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1377
1378 /* Fix the screen origin to be relative to the primary monitor again */
1379 OffsetRect(&rcScreen,
1380 ScreenOffset.cx,
1381 ScreenOffset.cy);
1382
1383 RECT rcPos = m_TrayRects[Pos];
1384
1385 hMonNew = GetMonitorFromRect(&rcPos);
1386 if (hMon != hMonNew)
1387 {
1388 SIZE szTray;
1389
1390 /* Recalculate the rectangle, we're dragging to another monitor.
1391 We don't need to recalculate the rect on single monitor systems. */
1392 szTray.cx = rcPos.right - rcPos.left;
1393 szTray.cy = rcPos.bottom - rcPos.top;
1394
1395 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1396 hMon = hMonNew;
1397 }
1398 else
1399 {
1400 /* The user is dragging the tray window on the same monitor. We don't need
1401 to recalculate the rectangle */
1402 *pRect = rcPos;
1403 }
1404
1405 *phMonitor = hMon;
1406
1407 return Pos;
1408 }
1409
1411 IN OUT RECT *pRect,
1412 OUT HMONITOR *phMonitor)
1413 {
1414 POINT pt;
1415
1416 /* Calculate the center of the rectangle. We call
1417 GetDraggingRectFromPt to calculate a valid
1418 dragging rectangle */
1419 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1420 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1421
1422 return GetDraggingRectFromPt(
1423 pt,
1424 pRect,
1425 phMonitor);
1426 }
1427
1429 {
1430 RECT rcTray;
1431
1432 if (IsDragging)
1433 {
1434 rcTray.left = pwp->x;
1435 rcTray.top = pwp->y;
1436 rcTray.right = rcTray.left + pwp->cx;
1437 rcTray.bottom = rcTray.top + pwp->cy;
1438
1439 if (!EqualRect(&rcTray,
1441 {
1442 /* Recalculate the rectangle, the user dragged the tray
1443 window to another monitor or the window was somehow else
1444 moved or resized */
1446 &rcTray,
1448 //m_TrayRects[DraggingPosition] = rcTray;
1449 }
1450
1451 //Monitor = CalculateValidSize(DraggingPosition,
1452 // &rcTray);
1453
1458 IsDragging = FALSE;
1459
1460 m_TrayRects[m_Position] = rcTray;
1461 goto ChangePos;
1462 }
1463 else if (GetWindowRect(&rcTray))
1464 {
1465 if (InSizeMove)
1466 {
1467 if (!(pwp->flags & SWP_NOMOVE))
1468 {
1469 rcTray.left = pwp->x;
1470 rcTray.top = pwp->y;
1471 }
1472
1473 if (!(pwp->flags & SWP_NOSIZE))
1474 {
1475 rcTray.right = rcTray.left + pwp->cx;
1476 rcTray.bottom = rcTray.top + pwp->cy;
1477 }
1478
1480
1481 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1482 {
1483 SIZE szWnd;
1484
1485 szWnd.cx = pwp->cx;
1486 szWnd.cy = pwp->cy;
1487
1488 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1489 }
1490
1491 m_TrayRects[m_Position] = rcTray;
1492 }
1493 else if (m_Position != (DWORD)-1)
1494 {
1495 /* If the user isn't resizing the tray window we need to make sure the
1496 new size or position is valid. this is to prevent changes to the window
1497 without user interaction. */
1498 rcTray = m_TrayRects[m_Position];
1499
1500 if (IsAutoHideState())
1501 {
1502 rcTray.left += m_AutoHideOffset.cx;
1503 rcTray.right += m_AutoHideOffset.cx;
1504 rcTray.top += m_AutoHideOffset.cy;
1505 rcTray.bottom += m_AutoHideOffset.cy;
1506 }
1507 }
1508
1509ChangePos:
1510 m_TraySize.cx = rcTray.right - rcTray.left;
1511 m_TraySize.cy = rcTray.bottom - rcTray.top;
1512
1513 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1514 pwp->x = rcTray.left;
1515 pwp->y = rcTray.top;
1516 pwp->cx = m_TraySize.cx;
1517 pwp->cy = m_TraySize.cy;
1518 }
1519 }
1520
1522 {
1523 RECT rcClip, rcWindow;
1524 HRGN hClipRgn;
1525
1526 if (GetWindowRect(&rcWindow))
1527 {
1528 /* Disable clipping on systems with only one monitor */
1530 Clip = FALSE;
1531
1532 if (Clip)
1533 {
1534 rcClip = rcWindow;
1535
1536 GetScreenRect(m_Monitor, &rcClip);
1537
1538 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1539 {
1540 rcClip = rcWindow;
1541 }
1542
1543 OffsetRect(&rcClip,
1544 -rcWindow.left,
1545 -rcWindow.top);
1546
1547 hClipRgn = CreateRectRgnIndirect(&rcClip);
1548 }
1549 else
1550 hClipRgn = NULL;
1551
1552 /* Set the clipping region or make sure the window isn't clipped
1553 by disabling it explicitly. */
1554 SetWindowRgn(hClipRgn, TRUE);
1555 }
1556 }
1557
1559 {
1560#if !WIN7_DEBUG_MODE
1561 RECT rcTray, rcWorkArea;
1562
1563 /* If monitor has changed then fix the previous monitors work area */
1565 {
1566 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1567 SystemParametersInfoW(SPI_SETWORKAREA,
1568 1,
1569 &rcWorkArea,
1571 }
1572
1573 rcTray = m_TrayRects[m_Position];
1574
1575 GetScreenRect(m_Monitor, &rcWorkArea);
1577
1578 /* If AutoHide is false then change the workarea to exclude
1579 the area that the taskbar covers. */
1580 if (!IsAutoHideState())
1581 {
1582 switch (m_Position)
1583 {
1584 case ABE_TOP:
1585 rcWorkArea.top = rcTray.bottom;
1586 break;
1587 case ABE_LEFT:
1588 rcWorkArea.left = rcTray.right;
1589 break;
1590 case ABE_RIGHT:
1591 rcWorkArea.right = rcTray.left;
1592 break;
1593 case ABE_BOTTOM:
1594 rcWorkArea.bottom = rcTray.top;
1595 break;
1596 }
1597 }
1598
1599 /*
1600 * Resize the current monitor work area. Win32k will also send
1601 * a WM_SIZE message to automatically resize the desktop.
1602 */
1603 SystemParametersInfoW(SPI_SETWORKAREA,
1604 1,
1605 &rcWorkArea,
1607#endif
1608 }
1609
1611 {
1612 /* Force the rebar bands to resize */
1614 IID_IDeskBand,
1616 0,
1617 NULL,
1618 NULL);
1619
1620 /* Calculate the size of the taskbar based on the rebar */
1622
1623 /* Move the tray window */
1624 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1625 * and position we use here with m_TrayRects */
1630 }
1631
1633 {
1634 DWORD Pos;
1635 RECT rcScreen;
1636 SIZE WndSize, EdgeSize, DlgFrameSize;
1637 SIZE StartBtnSize = m_StartButton.GetSize();
1638
1639 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1640 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1641 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1642 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1643
1645 rcScreen = g_TaskbarSettings.sr.Rect;
1646 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1647
1649 {
1650 /* Use the minimum size of the taskbar, we'll use the start
1651 button as a minimum for now. Make sure we calculate the
1652 entire window size, not just the client size. However, we
1653 use a thinner border than a standard thick border, so that
1654 the start button and bands are not stuck to the screen border. */
1655 if(!m_Theme)
1656 {
1657 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1658 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1659 }
1660 else
1661 {
1662 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1663 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1666 }
1667 }
1668 /* Determine a minimum tray window rectangle. The "client" height is
1669 zero here since we cannot determine an optimal minimum width when
1670 loaded as a vertical tray window. We just need to make sure the values
1671 loaded from the registry are at least. The windows explorer behaves
1672 the same way, it allows the user to save a zero width vertical tray
1673 window, but not a zero height horizontal tray window. */
1674 if(!m_Theme)
1675 {
1676 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1677 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1678 }
1679 else
1680 {
1681 WndSize.cx = StartBtnSize.cx;
1682 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1683 }
1684
1685 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1686 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1687 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1688 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1689
1690 /* Save the calculated size */
1691 m_TraySize = WndSize;
1692
1693 /* Calculate all docking rectangles. We need to do this here so they're
1694 initialized and dragging the tray window to another position gives
1695 usable results */
1696 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1697 {
1699 &rcScreen,
1700 &m_TraySize,
1701 &m_TrayRects[Pos]);
1702 // 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);
1703 }
1704
1705 /* Determine which monitor we are on. It shouldn't matter which docked
1706 position rectangle we use */
1708 }
1709
1711 {
1712 RECT rcClient;
1713 SIZE TraySize, StartSize;
1714 POINT ptTrayNotify = { 0, 0 };
1715 BOOL Horizontal;
1716 HDWP dwp;
1717
1719 if (prcClient != NULL)
1720 {
1721 rcClient = *prcClient;
1722 }
1723 else
1724 {
1725 if (!GetClientRect(&rcClient))
1726 {
1727 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1728 return;
1729 }
1730 }
1731
1732 Horizontal = IsPosHorizontal();
1733
1734 /* We're about to resize/move the start button, the rebar control and
1735 the tray notification control */
1736 dwp = BeginDeferWindowPos(4);
1737 if (dwp == NULL)
1738 {
1739 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1740 return;
1741 }
1742
1743 /* Limit the Start button width to the client width, if necessary */
1744 StartSize = m_StartButton.GetSize();
1745 if (StartSize.cx > rcClient.right)
1746 StartSize.cx = rcClient.right;
1747
1748 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1749 if (hwndTaskToolbar)
1750 {
1751 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1752
1753 /* Themed button covers Edge area as well */
1754 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1755 }
1756
1757 if (m_StartButton.m_hWnd != NULL)
1758 {
1759 /* Resize and reposition the button */
1760 dwp = m_StartButton.DeferWindowPos(dwp,
1761 NULL,
1762 0,
1763 0,
1764 StartSize.cx,
1765 StartSize.cy,
1767 if (dwp == NULL)
1768 {
1769 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1770 return;
1771 }
1772 }
1773
1774 /* Determine the size that the tray notification window needs */
1775 if (Horizontal)
1776 {
1777 TraySize.cx = 0;
1778 TraySize.cy = rcClient.bottom;
1779 }
1780 else
1781 {
1782 TraySize.cx = rcClient.right;
1783 TraySize.cy = 0;
1784 }
1785
1786 if (m_TrayNotify != NULL &&
1789 (WPARAM)Horizontal,
1790 (LPARAM)&TraySize))
1791 {
1792 /* Move the tray notification window to the desired location */
1793 if (Horizontal)
1794 ptTrayNotify.x = rcClient.right - TraySize.cx;
1795 else
1796 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1797
1798 dwp = ::DeferWindowPos(dwp,
1800 NULL,
1801 ptTrayNotify.x,
1802 ptTrayNotify.y,
1803 TraySize.cx,
1804 TraySize.cy,
1806 if (dwp == NULL)
1807 {
1808 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1809 return;
1810 }
1811 }
1812
1813 /* Resize/Move the rebar control */
1814 if (m_Rebar != NULL)
1815 {
1816 POINT ptRebar = { 0, 0 };
1817 SIZE szRebar;
1818
1819 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1820
1821 if (Horizontal)
1822 {
1823 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1824 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1825 szRebar.cy = rcClient.bottom;
1826 }
1827 else
1828 {
1829 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1830 szRebar.cx = rcClient.right;
1831 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1832 }
1833
1834 dwp = ::DeferWindowPos(dwp,
1835 m_Rebar,
1836 NULL,
1837 ptRebar.x,
1838 ptRebar.y,
1839 szRebar.cx,
1840 szRebar.cy,
1842 }
1843
1844 if (dwp != NULL)
1845 EndDeferWindowPos(dwp);
1846
1847 if (m_TaskSwitch != NULL)
1848 {
1849 /* Update the task switch window configuration */
1851 }
1852 }
1853
1854 void FitToRebar(PRECT pRect)
1855 {
1856 /* Get the rect of the rebar */
1857 RECT rebarRect, taskbarRect, clientRect;
1858 ::GetWindowRect(m_Rebar, &rebarRect);
1859 ::GetWindowRect(m_hWnd, &taskbarRect);
1860 ::GetClientRect(m_hWnd, &clientRect);
1861 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1862
1863 /* Calculate the difference of size of the taskbar and the rebar */
1864 SIZE margins;
1865 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1866 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1867
1868 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1869 switch (m_Position)
1870 {
1871 case ABE_TOP:
1872 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1874 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1875 break;
1876 case ABE_BOTTOM:
1877 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1879 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1880 break;
1881 case ABE_LEFT:
1882 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1884 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1885 break;
1886 case ABE_RIGHT:
1887 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1889 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1890 break;
1891 }
1892
1894 }
1895
1897 {
1898 if (m_StartMenuPopup != NULL)
1899 {
1900 POINTL pt;
1901 RECTL rcExclude;
1902 DWORD dwFlags = 0;
1903
1904 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1905 {
1906 switch (m_Position)
1907 {
1908 case ABE_BOTTOM:
1909 pt.x = rcExclude.left;
1910 pt.y = rcExclude.top;
1911 dwFlags |= MPPF_TOP;
1912 break;
1913 case ABE_TOP:
1914 pt.x = rcExclude.left;
1915 pt.y = rcExclude.bottom;
1916 dwFlags |= MPPF_BOTTOM;
1917 break;
1918 case ABE_LEFT:
1919 pt.x = rcExclude.right;
1920 pt.y = rcExclude.top;
1921 dwFlags |= MPPF_RIGHT;
1922 break;
1923 case ABE_RIGHT:
1924 pt.x = rcExclude.left;
1925 pt.y = rcExclude.top;
1926 dwFlags |= MPPF_LEFT;
1927 break;
1928 }
1929
1930 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1931
1932 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1933 }
1934 }
1935 }
1936
1938 {
1939 POINT pt;
1940 GetCursorPos(&pt);
1941
1942 RECT rcCurrent;
1943 GetWindowRect(&rcCurrent);
1944
1945 BOOL over = PtInRect(&rcCurrent, pt);
1947 over = TRUE;
1948
1950 if (over)
1951 {
1952 if (state == AUTOHIDE_HIDING)
1953 {
1954 TRACE("AutoHide cancelling hide.\n");
1957 }
1958 else if (state == AUTOHIDE_HIDDEN)
1959 {
1960 TRACE("AutoHide starting show.\n");
1963 }
1964 }
1965 else
1966 {
1967 if (state == AUTOHIDE_SHOWING)
1968 {
1969 TRACE("AutoHide cancelling show.\n");
1972 }
1973 else if (state == AUTOHIDE_SHOWN)
1974 {
1975 TRACE("AutoHide starting hide.\n");
1978 }
1979
1981 }
1982 }
1983
1985 {
1988
1989 switch (m_AutoHideState)
1990 {
1991 case AUTOHIDE_HIDING:
1992 switch (m_Position)
1993 {
1994 case ABE_LEFT:
1995 m_AutoHideOffset.cy = 0;
1997 if (m_AutoHideOffset.cx < -w)
1999 break;
2000 case ABE_TOP:
2001 m_AutoHideOffset.cx = 0;
2003 if (m_AutoHideOffset.cy < -h)
2005 break;
2006 case ABE_RIGHT:
2007 m_AutoHideOffset.cy = 0;
2009 if (m_AutoHideOffset.cx > w)
2011 break;
2012 case ABE_BOTTOM:
2013 m_AutoHideOffset.cx = 0;
2015 if (m_AutoHideOffset.cy > h)
2017 break;
2018 }
2019
2021 {
2023 break;
2024 }
2025
2026 /* fallthrough */
2027 case AUTOHIDE_HIDDEN:
2028 switch (m_Position)
2029 {
2030 case ABE_LEFT:
2032 m_AutoHideOffset.cy = 0;
2033 break;
2034 case ABE_TOP:
2035 m_AutoHideOffset.cx = 0;
2037 break;
2038 case ABE_RIGHT:
2040 m_AutoHideOffset.cy = 0;
2041 break;
2042 case ABE_BOTTOM:
2043 m_AutoHideOffset.cx = 0;
2045 break;
2046 }
2047
2050 break;
2051
2052 case AUTOHIDE_SHOWING:
2054 {
2056 }
2058 {
2060 }
2061 else
2062 {
2063 m_AutoHideOffset.cx = 0;
2064 }
2065
2067 {
2069 }
2071 {
2073 }
2074 else
2075 {
2076 m_AutoHideOffset.cy = 0;
2077 }
2078
2079 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2080 {
2082 break;
2083 }
2084
2085 /* fallthrough */
2086 case AUTOHIDE_SHOWN:
2089 break;
2090 }
2091
2093 }
2094
2095 /**********************************************************
2096 * ##### taskbar drawing #####
2097 */
2098
2100 {
2101 RECT rect;
2103
2105
2106 if (m_Theme)
2107 {
2109 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2110 }
2111
2112 return 0;
2113 }
2114
2116 {
2117 HDC hdc;
2118 RECT rect;
2120 SIZE size;
2121
2123
2126 return 0;
2127
2130
2131 hdc = GetWindowDC();
2132
2133 switch (m_Position)
2134 {
2135 case ABE_LEFT:
2136 rect.left = rect.right - size.cx;
2137 break;
2138 case ABE_TOP:
2139 rect.top = rect.bottom - size.cy;
2140 break;
2141 case ABE_RIGHT:
2142 rect.right = rect.left + size.cx;
2143 break;
2144 case ABE_BOTTOM:
2145 default:
2146 rect.bottom = rect.top + size.cy;
2147 break;
2148 }
2149
2150 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2151
2152 ReleaseDC(hdc);
2153 return 0;
2154 }
2155
2156 /*
2157 * ITrayWindow
2158 */
2160 {
2161 RECT rcWnd;
2162
2163 /* Check if there's already a window created and try to show it.
2164 If it was somehow destroyed just create a new tray window. */
2165 if (m_hWnd != NULL && IsWindow())
2166 {
2167 return S_OK;
2168 }
2169
2172 dwExStyle |= WS_EX_TOPMOST;
2173
2175 if(!m_Theme)
2176 {
2177 dwStyle |= WS_THICKFRAME | WS_BORDER;
2178 }
2179
2180 ZeroMemory(&rcWnd, sizeof(rcWnd));
2181 if (m_Position != (DWORD) -1)
2182 rcWnd = m_TrayRects[m_Position];
2183
2184 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2185 return E_FAIL;
2186
2187 /* Align all controls on the tray window */
2189
2190 /* Move the tray window to the right position and resize it if necessary */
2192
2193 return S_OK;
2194 }
2195
2197 {
2198 if (m_hWnd != NULL)
2199 {
2202 0,
2203 0);
2204 }
2205
2206 return S_OK;
2207 }
2208
2210 {
2211 return m_hWnd;
2212 }
2213
2215 {
2216 return (m_hWnd == hWnd ||
2218 }
2219
2221 {
2222 return IsPosHorizontal();
2223 }
2224
2226 {
2227 BOOL bPrevLock = g_TaskbarSettings.bLock;
2228
2229 if (g_TaskbarSettings.bLock != bLock)
2230 {
2231 g_TaskbarSettings.bLock = bLock;
2232
2233 if (m_TrayBandSite != NULL)
2234 {
2235 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2236 {
2237 /* Reset?? */
2238 g_TaskbarSettings.bLock = bPrevLock;
2239 return bPrevLock;
2240 }
2241 }
2242
2243 if (m_Theme)
2244 {
2245 /* Update cached tray sizes */
2246 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2247 {
2248 RECT rcGripper = {0};
2249 AdjustSizerRect(&rcGripper, Pos);
2250
2252 {
2253 m_TrayRects[Pos].top += rcGripper.top;
2254 m_TrayRects[Pos].left += rcGripper.left;
2255 m_TrayRects[Pos].bottom += rcGripper.bottom;
2256 m_TrayRects[Pos].right += rcGripper.right;
2257 }
2258 else
2259 {
2260 m_TrayRects[Pos].top -= rcGripper.top;
2261 m_TrayRects[Pos].left -= rcGripper.left;
2262 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2263 m_TrayRects[Pos].right -= rcGripper.right;
2264 }
2265 }
2266 }
2270 }
2271
2272 return bPrevLock;
2273 }
2274
2275 /* The task window is visible and non-WS_EX_TOOLWINDOW and
2276 { has WS_EX_APPWINDOW style or has no owner } and is none of explorer's
2277 special windows (such as the desktop or the tray window) */
2279 {
2281 {
2283 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2284 !(exStyle & WS_EX_TOOLWINDOW))
2285 {
2286 return TRUE;
2287 }
2288 }
2289 return FALSE;
2290 }
2291
2292 /*
2293 * IContextMenu
2294 */
2296 UINT indexMenu,
2297 UINT idCmdFirst,
2298 UINT idCmdLast,
2299 UINT uFlags)
2300 {
2301 if (!m_ContextMenu)
2302 {
2305 return hr;
2306 }
2307
2308 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2309 }
2310
2312 {
2313 if (!m_ContextMenu)
2314 return E_INVALIDARG;
2315
2316 return m_ContextMenu->InvokeCommand(lpici);
2317 }
2318
2320 UINT uType,
2321 UINT *pwReserved,
2322 LPSTR pszName,
2323 UINT cchMax)
2324 {
2325 if (!m_ContextMenu)
2326 return E_INVALIDARG;
2327
2328 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2329 }
2330
2331 /**********************************************************
2332 * ##### message handling #####
2333 */
2334
2336 {
2337 HRESULT hRet;
2338
2339 ((ITrayWindow*)this)->AddRef();
2340
2341 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2342
2343 /* Create the Start button */
2345
2346 /* Load the saved tray window settings */
2348
2349 /* Create and initialize the start menu */
2353
2354 /* Create the task band */
2356 if (FAILED_UNEXPECTEDLY(hRet))
2357 return FALSE;
2358
2359 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2361 if (FAILED_UNEXPECTEDLY(hRet))
2362 return FALSE;
2363
2364 /* Create the tray notification window */
2366 if (FAILED_UNEXPECTEDLY(hRet))
2367 return FALSE;
2368
2369 /* Get the hwnd of the rebar */
2371 if (FAILED_UNEXPECTEDLY(hRet))
2372 return FALSE;
2373
2374 /* Get the hwnd of the tasks toolbar */
2376 if (FAILED_UNEXPECTEDLY(hRet))
2377 return FALSE;
2378
2379 /* Get the hwnd of the tray notification window */
2381 if (FAILED_UNEXPECTEDLY(hRet))
2382 return FALSE;
2383
2386 return FALSE;
2387
2388 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2389
2390 UpdateFonts();
2391
2393
2394 if (IsAutoHideState())
2395 {
2398 }
2399
2400 /* Set the initial lock state in the band site */
2402
2403 static const UINT winkeys[] =
2404 {
2417 };
2419 {
2420 for (UINT i = 0; i < _countof(winkeys); ++i)
2421 {
2422 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2423 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2424 }
2425 }
2426
2427 return TRUE;
2428 }
2429
2431 {
2432 return 0;
2433 }
2434
2436 {
2437 if (wParam)
2438 SaveState();
2439 return 0;
2440 }
2441
2443 {
2444 if (m_Theme)
2446
2447 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2448
2449 if (m_Theme)
2450 {
2452 }
2453 else
2454 {
2456 }
2458
2459 return TRUE;
2460 }
2461
2463 {
2464 if (wParam == SPI_SETNONCLIENTMETRICS)
2465 {
2468 UpdateFonts();
2471 }
2472
2473 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2474 if (m_DesktopWnd)
2476
2477 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2478 {
2479 HideStartMenu();
2480
2482#if 1 // FIXME: Please re-use the start menu
2483 /* Re-create the start menu */
2487 FIXME("Use UpdateStartMenu\n");
2488#else
2489 // Update the start menu
2491#endif
2492 }
2493
2494 return 0;
2495 }
2496
2498 {
2499 HDC hdc = (HDC) wParam;
2500
2501 if (!m_Theme)
2502 {
2503 bHandled = FALSE;
2504 return 0;
2505 }
2506
2508 }
2509
2511 {
2512 /* Refresh workareas */
2514
2515 /* Load the saved tray window settings */
2517
2518 /* Move the tray window to the right position and resize it if necessary */
2520
2521 return TRUE;
2522 }
2523
2525 {
2527 if (!pCopyData)
2528 return FALSE;
2529
2530 switch (pCopyData->dwData)
2531 {
2532 case TABDMC_APPBAR:
2533 return OnAppBarMessage(pCopyData);
2534 case TABDMC_NOTIFY:
2535 case TABDMC_LOADINPROC:
2536 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2537 }
2538 return FALSE;
2539 }
2540
2541 // We have to draw non-client area because the 'Show Desktop' button is beyond client area.
2543 {
2544 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2545 return;
2547 }
2548
2550 {
2551 DefWindowProc(uMsg, wParam, lParam);
2552 bHandled = TRUE;
2553
2555 {
2556 DrawShowDesktopButton(); // We have to draw non-client area
2557 return 0;
2558 }
2559
2560 DrawSizerWithTheme((HRGN) wParam);
2561 DrawShowDesktopButton(); // We have to draw non-client area
2562 return 0;
2563 }
2564
2566 {
2569 }
2570
2572 {
2573 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2574 }
2575
2577 {
2578 RECT rcClient;
2579 POINT pt;
2580
2582 {
2583 /* The user may not be able to resize the tray window.
2584 Pretend like the window is not sizeable when the user
2585 clicks on the border. */
2586 return HTBORDER;
2587 }
2588
2590 if (GetClientRect(&rcClient) &&
2591 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2592 {
2593 pt.x = GET_X_LPARAM(lParam);
2594 pt.y = GET_Y_LPARAM(lParam);
2595
2597 return HTBORDER;
2598
2599 if (PtInRect(&rcClient, pt))
2600 {
2601 /* The user is trying to drag the tray window */
2602 return HTCAPTION;
2603 }
2604
2605 /* Depending on the position of the tray window, allow only
2606 changing the border next to the monitor working area */
2607 switch (m_Position)
2608 {
2609 case ABE_TOP:
2610 if (pt.y > rcClient.bottom)
2611 return HTBOTTOM;
2612 break;
2613 case ABE_LEFT:
2614 if (pt.x > rcClient.right)
2615 return HTRIGHT;
2616 break;
2617 case ABE_RIGHT:
2618 if (pt.x < rcClient.left)
2619 return HTLEFT;
2620 break;
2621 case ABE_BOTTOM:
2622 default:
2623 if (pt.y < rcClient.top)
2624 return HTTOP;
2625 break;
2626 }
2627 }
2628 return HTBORDER;
2629 }
2630
2632 {
2633 POINT ptCursor;
2634 PRECT pRect = (PRECT) lParam;
2635
2636 /* We need to ensure that an application can not accidently
2637 move the tray window (using SetWindowPos). However, we still
2638 need to be able to move the window in case the user wants to
2639 drag the tray window to another position or in case the user
2640 wants to resize the tray window. */
2641 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2642 {
2643 IsDragging = TRUE;
2645 }
2646 else
2647 {
2648 *pRect = m_TrayRects[m_Position];
2649 }
2650 return TRUE;
2651 }
2652
2654 {
2655 PRECT pRect = (PRECT) lParam;
2656
2658 {
2659 FitToRebar(pRect);
2660 }
2661 else
2662 {
2663 *pRect = m_TrayRects[m_Position];
2664 }
2665 return TRUE;
2666 }
2667
2669 {
2671 return TRUE;
2672 }
2673
2675 {
2676 RECT rcClient;
2677 if (wParam == SIZE_RESTORED && lParam == 0)
2678 {
2680 /* Clip the tray window on multi monitor systems so the edges can't
2681 overlap into another monitor */
2683
2684 if (!GetClientRect(&rcClient))
2685 {
2686 return FALSE;
2687 }
2688 }
2689 else
2690 {
2691 rcClient.left = rcClient.top = 0;
2692 rcClient.right = LOWORD(lParam);
2693 rcClient.bottom = HIWORD(lParam);
2694 }
2695
2696 AlignControls(&rcClient);
2697 return TRUE;
2698 }
2699
2701 {
2702 InSizeMove = TRUE;
2703 IsDragging = FALSE;
2705 {
2706 /* Remove the clipping on multi monitor systems while dragging around */
2708 }
2710 return TRUE;
2711 }
2712
2714 {
2715 InSizeMove = FALSE;
2717 {
2719
2720 /* Apply clipping */
2722 }
2723 return TRUE;
2724 }
2725
2727 {
2728 switch (wParam)
2729 {
2730 case TEXT(' '):
2731 {
2732 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2733 The tray window needs to handle this specially, since it normally doesn't have
2734 a system menu. */
2735
2736 static const UINT uidDisableItem [] = {
2737 SC_RESTORE,
2738 SC_MOVE,
2739 SC_SIZE,
2742 };
2743 HMENU hSysMenu;
2744 UINT i, uId;
2745
2746 /* temporarily enable the system menu */
2748
2749 hSysMenu = GetSystemMenu(FALSE);
2750 if (hSysMenu != NULL)
2751 {
2752 /* Disable all items that are not relevant */
2753 for (i = 0; i < _countof(uidDisableItem); i++)
2754 {
2755 EnableMenuItem(hSysMenu,
2756 uidDisableItem[i],
2758 }
2759
2760 EnableMenuItem(hSysMenu,
2761 SC_CLOSE,
2762 MF_BYCOMMAND |
2764
2765 /* Display the system menu */
2766 uId = TrackMenu(
2767 hSysMenu,
2768 NULL,
2771 FALSE);
2772 if (uId != 0)
2773 {
2775 }
2776 }
2777
2778 /* revert the system menu window style */
2780 break;
2781 }
2782
2783 default:
2784 bHandled = FALSE;
2785 }
2786 return TRUE;
2787 }
2788
2790 {
2791 if (!ppt || !prcStartBtn || !pwi)
2792 return FALSE;
2793
2794 switch (m_Position)
2795 {
2796 case ABE_TOP:
2797 case ABE_LEFT:
2798 {
2799 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2800 return FALSE;
2801 break;
2802 }
2803 case ABE_RIGHT:
2804 {
2805 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2806 return FALSE;
2807
2808 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2809 ppt->x > prcStartBtn->right)
2810 {
2811 return FALSE;
2812 }
2813 break;
2814 }
2815 case ABE_BOTTOM:
2816 {
2817 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2818 return FALSE;
2819
2820 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2821 ppt->y > prcStartBtn->bottom)
2822 {
2823 return FALSE;
2824 }
2825
2826 break;
2827 }
2828 }
2829 return TRUE;
2830 }
2831
2833 {
2834 if (!ppt || !prcShowDesktopBtn)
2835 return FALSE;
2837
2838 switch (m_Position)
2839 {
2840 case ABE_LEFT:
2841 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2842 case ABE_TOP:
2843 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2844 case ABE_RIGHT:
2845 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2846 case ABE_BOTTOM:
2847 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2848 }
2849 return FALSE;
2850 }
2851
2857 {
2859 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2860
2861 bHandled = FALSE;
2862
2863 RECT rcStartBtn;
2864 m_StartButton.GetWindowRect(&rcStartBtn);
2865 GetWindowInfo(m_hWnd, &wi);
2866
2867 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2868 {
2869 bHandled = TRUE;
2871 return 0;
2872 }
2873
2876
2877 return 0;
2878 }
2879
2881 {
2882 /* We want the user to be able to get a context menu even on the nonclient
2883 area (including the sizing border)! */
2884 uMsg = WM_CONTEXTMENU;
2885 wParam = (WPARAM) m_hWnd;
2886
2887 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2888 }
2889
2891 {
2892 LRESULT Ret = FALSE;
2893 POINT pt, *ppt = NULL;
2894 HWND hWndExclude = NULL;
2895
2896 /* Check if the administrator has forbidden access to context menus */
2898 return FALSE;
2899
2900 pt.x = (SHORT) LOWORD(lParam);
2901 pt.y = (SHORT) HIWORD(lParam);
2902
2903 if (pt.x != -1 || pt.y != -1)
2904 ppt = &pt;
2905 else
2906 hWndExclude = m_StartButton.m_hWnd;
2907
2909 {
2910 /* Make sure we can't track the context menu if the start
2911 menu is currently being shown */
2913 {
2914 CComPtr<IContextMenu> ctxMenu;
2916 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2917 }
2918 }
2919 else
2920 {
2921 /* See if the context menu should be handled by the task band site */
2922 if (ppt != NULL && m_TrayBandSite != NULL)
2923 {
2924 HWND hWndAtPt;
2925 POINT ptClient = *ppt;
2926
2927 /* Convert the coordinates to client-coordinates */
2928 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2929
2930 hWndAtPt = ChildWindowFromPoint(ptClient);
2931 if (hWndAtPt != NULL &&
2932 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2933 {
2934 /* Check if the user clicked on the task switch window */
2935 ptClient = *ppt;
2936 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2937
2939 if (hWndAtPt == m_TaskSwitch)
2940 goto HandleTrayContextMenu;
2941
2942 /* Forward the message to the task band site */
2943 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2944 }
2945 else
2946 goto HandleTrayContextMenu;
2947 }
2948 else
2949 {
2950HandleTrayContextMenu:
2951 /* Tray the default tray window context menu */
2952 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2953 }
2954 }
2955 return Ret;
2956 }
2957
2959 {
2960 LRESULT Ret = FALSE;
2961 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
2962 the rebar control! But we shouldn't forward messages that the band
2963 site doesn't handle, such as other controls (start button, tray window) */
2964
2965 HRESULT hr = E_FAIL;
2966
2967 if (m_TrayBandSite)
2968 {
2969 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2970 if (SUCCEEDED(hr))
2971 return Ret;
2972 }
2973
2974 if (m_TrayBandSite == NULL || FAILED(hr))
2975 {
2976 const NMHDR *nmh = (const NMHDR *) lParam;
2977
2978 if (nmh->hwndFrom == m_TrayNotify)
2979 {
2980 switch (nmh->code)
2981 {
2982 case NTNWM_REALIGN:
2983 /* Cause all controls to be aligned */
2985 break;
2986 }
2987 }
2988 }
2989 return Ret;
2990 }
2991
2993 {
2994 /* Let the clock handle the double-click */
2996
2997 /* We "handle" this message so users can't cause a weird maximize/restore
2998 window animation when double-clicking the tray window! */
2999 return TRUE;
3000 }
3001
3003 {
3004 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
3005 {
3008 bHandled = TRUE;
3009 }
3010
3011 return FALSE;
3012 }
3013
3015 {
3017 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
3018 return FALSE;
3019 }
3020
3022 {
3023 DestroyWindow();
3024 return TRUE;
3025 }
3026
3028 {
3029 HWND hwndStartMenu;
3030 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3032 return FALSE;
3033
3034 if (::IsWindowVisible(hwndStartMenu))
3035 HideStartMenu();
3036 else
3038
3039 return TRUE;
3040 }
3041
3043 {
3044 /*
3045 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3046 * to show the shutdown dialog. Also a WM_CLOSE message sent
3047 * by apps should show the dialog.
3048 */
3049 return DoExitWindows();
3050 }
3051
3053 {
3054 if (wParam == SC_CLOSE)
3055 {
3056 return DoExitWindows();
3057 }
3058
3059 bHandled = FALSE;
3060 return TRUE;
3061 }
3062
3064 {
3065 bHandled = TRUE;
3066 return (LRESULT)m_TaskSwitch;
3067 }
3068
3069 // TWM_SETZORDER
3071 {
3072 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3074 }
3075
3076 STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
3077 {
3078 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3079 return S_OK;
3080 }
3081
3083 {
3084 return HandleHotKey(wParam);
3085 }
3086
3088 {
3094 };
3095
3097 {
3098 WCHAR szClass[32];
3099 GetClassNameW(hwnd, szClass, _countof(szClass));
3100 return wcscmp(szClass, L"#32770") == 0;
3101 }
3102
3104 {
3106 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3107 return TRUE; // Ignore special windows
3108
3109 if (!info->bShowDesktop)
3110 {
3112 return TRUE;
3113 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3114 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3115 return TRUE;
3116 }
3117
3118 if (CanBeMinimized(hwnd))
3119 {
3120 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3121 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3123 {
3124 info->pMinimizedAll->Add(mwp);
3125 }
3126 }
3127
3128 return TRUE;
3129 }
3130
3131 VOID MinimizeAll(BOOL bShowDesktop = FALSE)
3132 {
3134 info.hwndDesktop = GetDesktopWindow();;
3135 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3136 info.hwndProgman = FindWindowW(L"Progman", NULL);
3137 info.pMinimizedAll = &g_MinimizedAll;
3138 info.bShowDesktop = bShowDesktop;
3140
3143 }
3144
3146 {
3148 }
3149
3151 {
3152 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3153 {
3154 HWND hwnd = g_MinimizedAll[i].hwnd;
3157 }
3158
3160 }
3161
3163 {
3164 LRESULT Ret = FALSE;
3165
3167 {
3168 return FALSE;
3169 }
3170
3171 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3172 {
3173 return HandleCommand(LOWORD(wParam));
3174 }
3175 return Ret;
3176 }
3177
3179 {
3181
3182 if (IsAutoHideState())
3183 {
3185 }
3186
3187 return TRUE;
3188 }
3189
3191 {
3192 switch (wParam)
3193 {
3196 break;
3197 case TIMER_ID_AUTOHIDE:
3199 break;
3200 default:
3201 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3202 bHandled = FALSE;
3203 break;
3204 }
3205 return 0;
3206 }
3207
3209 {
3211 DrawShowDesktopButton(); // We have to draw non-client area
3212 bHandled = TRUE;
3213 return ret;
3214 }
3215
3217 {
3218 RECT *rc = NULL;
3219 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3221 {
3222 bHandled = FALSE;
3223 return 0;
3224 }
3225 if(!wParam)
3226 {
3227 rc = (RECT*)wParam;
3228 }
3229 else
3230 {
3232 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3233 {
3234 bHandled = FALSE;
3235 return 0;
3236 }
3237 rc = &prms->rgrc[0];
3238 }
3239
3241
3242 return 0;
3243 }
3244
3246 {
3247 HMENU hMenu = (HMENU)wParam;
3249 {
3253 if (g_Arrangement != NONE)
3254 {
3257 MENUITEMINFOW mii = { sizeof(mii) };
3259 mii.fMask = MIIM_TYPE;
3260 mii.fType = MFT_STRING;
3261 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3263 }
3264 else
3265 {
3267 }
3268 }
3269 else
3270 {
3276 g_WindowPosBackup.RemoveAll();
3277 }
3278 return 0;
3279 }
3280
3281 // WM_ACTIVATE
3283 {
3285 if (!wParam) // !(Activate || Minimized)
3286 {
3287 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3289 }
3290 return 0;
3291 }
3292
3293 // WM_SETFOCUS
3295 {
3297 return 0;
3298 }
3299
3300 // WM_GETMINMAXINFO
3302 {
3304 SIZE StartSize = m_StartButton.GetSize();
3305 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3306 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3307 return 0;
3308 }
3309
3311 {
3312#if 0
3313 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3314
3315 if (!as->fChanged)
3316 return 0;
3317
3318 RECT rc;
3319 ::GetWindowRect(m_hWnd, &rc);
3320
3321 SIZE szWindow = {
3322 rc.right - rc.left,
3323 rc.bottom - rc.top };
3324 SIZE szTarget = {
3325 as->rcTarget.right - as->rcTarget.left,
3326 as->rcTarget.bottom - as->rcTarget.top };
3327 SIZE szActual = {
3328 as->rcActual.right - as->rcActual.left,
3329 as->rcActual.bottom - as->rcActual.top };
3330
3331 SIZE borders = {
3332 szWindow.cx - szTarget.cx,
3333 szWindow.cy - szTarget.cx,
3334 };
3335
3336 switch (m_Position)
3337 {
3338 case ABE_LEFT:
3339 szWindow.cx = szActual.cx + borders.cx;
3340 break;
3341 case ABE_TOP:
3342 szWindow.cy = szActual.cy + borders.cy;
3343 break;
3344 case ABE_RIGHT:
3345 szWindow.cx = szActual.cx + borders.cx;
3346 rc.left = rc.right - szWindow.cy;
3347 break;
3348 case ABE_BOTTOM:
3349 szWindow.cy = szActual.cy + borders.cy;
3350 rc.top = rc.bottom - szWindow.cy;
3351 break;
3352 }
3353
3354 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3355#else
3356 bHandled = FALSE;
3357#endif
3358 return 0;
3359 }
3360
3362 {
3363 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3364
3365 /* Propagate the new settings to the children */
3368
3369 /* Toggle autohide */
3370 SetAutoHideState(newSettings->sr.AutoHide);
3371
3372 /* Toggle lock state */
3373 Lock(newSettings->bLock);
3374
3375 /* Toggle OnTop state */
3376 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3377
3378 /* Adjust taskbar size */
3380
3382 return 0;
3383 }
3384
3386
3389 {
3390 MSG Msg;
3391 LRESULT lRet;
3392
3393 Msg.hwnd = m_hWnd;
3394 Msg.message = uMsg;
3395 Msg.wParam = wParam;
3396 Msg.lParam = lParam;
3397
3398 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3399 {
3400 return lRet;
3401 }
3402
3403 wParam = Msg.wParam;
3404 lParam = Msg.lParam;
3405 }
3406 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
3408 NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnRebarAutoSize) // Doesn't quite work ;P
3420 MESSAGE_HANDLER(WM_DISPLAYCHANGE, OnDisplayChange)
3452 ALT_MSG_MAP(1)
3453 END_MSG_MAP()
3454
3455 /*****************************************************************************/
3456
3458 {
3459 MSG Msg;
3460
3461 /* FIXME: We should keep a reference here... */
3462
3463 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3464 {
3465 if (Msg.message == WM_QUIT)
3466 break;
3467
3468 if (m_StartMenuBand == NULL ||
3469 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3470 {
3473 }
3474 }
3475 }
3476
3478 {
3479 MSG Msg;
3480 BOOL Ret;
3481
3482 /* FIXME: We should keep a reference here... */
3483
3484 while (true)
3485 {
3486 Ret = GetMessage(&Msg, NULL, 0, 0);
3487
3488 if (!Ret || Ret == -1)
3489 break;
3490
3491 if (m_StartMenuBand == NULL ||
3492 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3493 {
3496 }
3497 }
3498 }
3499
3500 /*
3501 * IShellDesktopTray
3502 *
3503 * NOTE: this is a very windows-specific COM interface used by SHCreateDesktop()!
3504 * These are the calls I observed, it may be wrong/incomplete/buggy!!!
3505 * The reason we implement it is because we have to use SHCreateDesktop() so
3506 * that the shell provides the desktop window and all the features that come
3507 * with it (especially positioning of desktop icons)
3508 */
3509
3511 GetState() override
3512 {
3513 /* FIXME: Return ABS_ flags? */
3514 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3515 return 0;
3516 }
3517
3519 GetTrayWindow(OUT HWND *phWndTray) override
3520 {
3521 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3522 *phWndTray = m_hWnd;
3523 return S_OK;
3524 }
3525
3527 RegisterDesktopWindow(IN HWND hWndDesktop) override
3528 {
3529 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3530
3531 m_DesktopWnd = hWndDesktop;
3532 return S_OK;
3533 }
3534
3536 Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
3537 {
3538 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3539 return S_OK;
3540 }
3541
3543 {
3544 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3545 return S_OK;
3546 }
3547
3548 // *** IOleWindow methods ***
3549
3551 GetWindow(HWND* phwnd) override
3552 {
3553 if (!phwnd)
3554 return E_INVALIDARG;
3555 *phwnd = m_hWnd;
3556 return S_OK;
3557 }
3558
3560 ContextSensitiveHelp(BOOL fEnterMode) override
3561 {
3562 return E_NOTIMPL;
3563 }
3564
3565 void _Init()
3566 {
3567 m_Position = (DWORD) -1;
3568 }
3569
3571
3574 /*COM_INTERFACE_ENTRY_IID(IID_ITrayWindow, ITrayWindow)*/
3577 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3578 END_COM_MAP()
3579
3580protected:
3582 // AppBar section
3583 //
3584 // See also: appbar.cpp
3585 // TODO: freedesktop _NET_WM_STRUT integration
3586 // TODO: find when a fullscreen app is in the foreground and send FULLSCREENAPP notifications
3587 // TODO: multiple monitor support
3588
3589 BOOL IsAutoHideState() const override { return g_TaskbarSettings.sr.AutoHide; }
3590 BOOL IsHidingState() const override { return m_AutoHideState == AUTOHIDE_HIDING; }
3592 HMONITOR& GetMonitor() override { return m_Monitor; }
3594 INT GetPosition() const override { return m_Position; }
3595 const RECT* GetTrayRect() override { return &m_TrayRects[m_Position]; }
3596 HWND GetTrayWnd() const override { return m_hWnd; }
3597 HWND GetDesktopWnd() const override { return m_DesktopWnd; }
3598
3599 void SetAutoHideState(_In_ BOOL bAutoHide) override
3600 {
3601 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3603
3605 if (bAutoHide)
3607 else
3609 }
3610
3611 void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
3612 {
3613 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3614 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3615 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3616 }
3617};
3618
3620 public CComCoClass<CTrayWindowCtxMenu>,
3621 public CComObjectRootEx<CComMultiThreadModelNoCS>,
3622 public IContextMenu
3623{
3628
3629public:
3630 HRESULT Initialize(ITrayWindow * pTrayWnd, IN HWND hWndOwner)
3631 {
3632 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3633 this->hWndOwner = hWndOwner;
3634 this->m_idCmdCmFirst = 0;
3635 return S_OK;
3636 }
3637
3640 UINT indexMenu,
3641 UINT idCmdFirst,
3642 UINT idCmdLast,
3643 UINT uFlags) override
3644 {
3645 HMENU hMenuBase;
3646
3648 if (!hMenuBase)
3650
3652 {
3654 MENUITEMINFOW mii = { sizeof(mii) };
3655 mii.fMask = MIIM_ID | MIIM_TYPE;
3657 mii.fType = MFT_STRING;
3658 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3660 }
3661
3663 {
3664 DeleteMenu(hPopup,
3666 MF_BYCOMMAND);
3667 }
3668
3669 CheckMenuItem(hMenuBase,
3672
3673 UINT idCmdNext;
3674 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3675 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3676
3677 ::DestroyMenu(hMenuBase);
3678
3679 if (TrayWnd->m_TrayBandSite != NULL)
3680 {
3681 pcm.Release();
3682 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3683 hPopup,
3684 indexMenu,
3685 idCmdNext,
3686 idCmdLast,
3687 CMF_NORMAL,
3688 &pcm)))
3689 {
3690 WARN("AddContextMenus failed.\n");
3691 pcm.Release();
3692 }
3693 }
3694
3695 return S_OK;
3696 }
3697
3700 {
3701 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3702 if (uiCmdId != 0)
3703 {
3704 if (uiCmdId >= m_idCmdCmFirst)
3705 {
3706 CMINVOKECOMMANDINFO cmici = { 0 };
3707
3708 if (pcm != NULL)
3709 {
3710 /* Setup and invoke the shell command */
3711 cmici.cbSize = sizeof(cmici);
3712 cmici.hwnd = hWndOwner;
3713 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3714 cmici.nShow = SW_NORMAL;
3715
3716 pcm->InvokeCommand(&cmici);
3717 }
3718 }
3719 else
3720 {
3721 TrayWnd->ExecContextMenuCmd(uiCmdId);
3722 }
3723 }
3724
3725 return S_OK;
3726 }
3727
3730 UINT_PTR idCmd,
3731 UINT uType,
3732 UINT *pwReserved,
3733 LPSTR pszName,
3734 UINT cchMax) override
3735 {
3736 return E_NOTIMPL;
3737 }
3738
3740 {
3741 }
3742
3744 {
3745 }
3746
3748 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3749 END_COM_MAP()
3750};
3751
3752HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu)
3753{
3755 mnu->Initialize(TrayWnd, hWndOwner);
3756 *ppCtxMenu = mnu;
3757 return S_OK;
3758}
3759
3760HRESULT CreateTrayWindow(ITrayWindow ** ppTray)
3761{
3763 if (Tray == NULL)
3764 return E_OUTOFMEMORY;
3765
3766 Tray->_Init();
3767 Tray->Open();
3768
3769 *ppTray = (ITrayWindow *) Tray;
3770
3771 return S_OK;
3772}
3773
3774HRESULT
3776{
3777 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3778 return TrayWindow->RaiseStartButton();
3779}
3780
3781VOID TrayProcessMessages(ITrayWindow *Tray)
3782{
3783 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3784 TrayWindow->TrayProcessMessages();
3785}
3786
3787VOID TrayMessageLoop(ITrayWindow *Tray)
3788{
3789 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3790 TrayWindow->TrayMessageLoop();
3791}
@ 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:50
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:555
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:728
#define TWM_SETTINGSCHANGED
Definition: precomp.h:134
#define TNWM_GETSHOWDESKTOPBUTTON
Definition: precomp.h:382
static LONG SetWindowStyle(IN HWND hWnd, IN LONG dwStyleMask, IN LONG dwStyle)
Definition: precomp.h:75
#define NTNWM_REALIGN
Definition: precomp.h:384
HRESULT InitShellServices(HDPA *phdpa)
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:348
VOID ClearRecentAndMru()
HRESULT ShutdownShellServices(HDPA hdpa)
#define TWM_SETZORDER
Definition: precomp.h:135
#define IDM_SEARCH
Definition: resource.h:77
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:215
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:221
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:216
#define IDS_RESTORE_ALL
Definition: resource.h:111
#define IDM_TRAYWND
Definition: resource.h:63
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:211
#define IDB_STARTMENU
Definition: resource.h:44
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:219
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:113
#define IDC_STARTBTN
Definition: resource.h:151
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:220
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:223
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:218
#define ID_LOCKTASKBAR
Definition: resource.h:214
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:217
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:112
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:213
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:222
#define IDS_HELP_COMMAND
Definition: resource.h:109
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:212
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHODIMP_(t)
Definition: basetyps.h:44
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
CONFIGRET WINAPI CM_Request_Eject_PC(VOID)
Definition: cfgmgr.c:7767
void Release()
Definition: atlcomcli.h:170
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
Definition: cstringt.h:658
BOOL IsIconic() const
Definition: atlwin.h:932
HWND GetLastActivePopup() const
Definition: atlwin.h:676
HWND SetFocus()
Definition: atlwin.h:1198
BOOL DestroyWindow()
Definition: atlwin.h:462
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
HDC GetWindowDC()
Definition: atlwin.h:784
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:456
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
CWindow GetParent() const
Definition: atlwin.h:700
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL UpdateWindow()
Definition: atlwin.h:1345
HWND m_hWnd
Definition: atlwin.h:273
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL IsWindowEnabled() const
Definition: atlwin.h:952
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1044
void OnAppBarActivationChange2(_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
Definition: appbar.cpp:475
void OnAppBarNotifyAll(_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
Definition: appbar.cpp:207
void RecomputeAllWorkareas()
Definition: appbar.cpp:449
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
HIMAGELIST m_ImageList
Definition: traywnd.cpp:182
VOID Initialize()
Definition: traywnd.cpp:241
VOID UpdateFont()
Definition: traywnd.cpp:225
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:292
SIZE GetSize()
Definition: traywnd.cpp:204
VOID UpdateSize()
Definition: traywnd.cpp:209
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:261
HFONT m_Font
Definition: traywnd.cpp:184
virtual ~CStartButton()
Definition: traywnd.cpp:195
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:3630
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
Definition: traywnd.cpp:3699
STDMETHODIMP QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition: traywnd.cpp:3639
virtual ~CTrayWindowCtxMenu()
Definition: traywnd.cpp:3743
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3625
STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
Definition: traywnd.cpp:3729
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3626
LRESULT OnHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3082
LRESULT OnEnterSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2700
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:620
DWORD m_DraggingPosition
Definition: traywnd.cpp:338
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2462
HWND m_TaskSwitch
Definition: traywnd.cpp:330
LRESULT OnSysColorChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2571
VOID ResizeWorkArea()
Definition: traywnd.cpp:1558
VOID ToggleDesktop()
Definition: traywnd.cpp:630
DWORD Flags
Definition: traywnd.cpp:358
BOOL IsHidingState() const override
Definition: traywnd.cpp:3590
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3599
LRESULT OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2713
LRESULT OnSetZOrder(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3070
LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2442
HWND m_Rebar
Definition: traywnd.cpp:329
VOID ShowDesktop()
Definition: traywnd.cpp:3145
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2549
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3361
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1308
HMONITOR m_Monitor
Definition: traywnd.cpp:336
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3178
CStartButton m_StartButton
Definition: traywnd.cpp:316
LRESULT OnDoExitWindows(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3042
HWND STDMETHODCALLTYPE GetHWND()
Definition: traywnd.cpp:2209
HMONITOR & GetPreviousMonitor() override
Definition: traywnd.cpp:3593
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1854
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:799
VOID RestoreAll()
Definition: traywnd.cpp:3150
LRESULT OnCtlColorBtn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2565
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:354
VOID ShowFolder(INT csidl, BOOL bExplore)
Definition: traywnd.cpp:735
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2115
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1081
DWORD m_Position
Definition: traywnd.cpp:335
const RECT * GetTrayRect() override
Definition: traywnd.cpp:3595
HTHEME m_Theme
Definition: traywnd.cpp:324
BOOL STDMETHODCALLTYPE IsHorizontal()
Definition: traywnd.cpp:2220
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:349
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:322
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:337
HDPA m_ShellServices
Definition: traywnd.cpp:351
LRESULT OnInitMenuPopup(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3245
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2497
DWORD WINAPI TrayPropertiesThread()
Definition: traywnd.cpp:545
SIZE m_TraySize
Definition: traywnd.cpp:342
LRESULT OnNcCalcSize(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3216
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1133
DWORD InSizeMove
Definition: traywnd.cpp:362
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2958
RECT m_TrayRects[4]
Definition: traywnd.cpp:341
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2524
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:520
GetState() override
Definition: traywnd.cpp:3511
VOID RegLoadSettings()
Definition: traywnd.cpp:1632
LRESULT OnNcRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2880
VOID TrayProcessMessages()
Definition: traywnd.cpp:3457
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:339
HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: traywnd.cpp:2319
LRESULT OnEndSession(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2435
BOOL STDMETHODCALLTYPE IsTaskWnd(HWND hWnd)
Definition: traywnd.cpp:2278
BOOL IsPointWithinShowDesktopButton(LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2832
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1246
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2099
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:320
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:581
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1171
STDMETHODIMP GetTrayWindow(OUT HWND *phWndTray) override
Definition: traywnd.cpp:3519
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1251
void ProcessMouseTracking()
Definition: traywnd.cpp:1937
INT GetPosition() const override
Definition: traywnd.cpp:3594
LRESULT OnNcLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2992
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2856
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2430
BOOL STDMETHODCALLTYPE Lock(IN BOOL bLock)
Definition: traywnd.cpp:2225
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1521
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2890
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3103
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3611
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3589
HRESULT STDMETHODCALLTYPE Open()
Definition: traywnd.cpp:2159
LRESULT OnGetTaskSwitch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3063
LRESULT OnSysChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2726
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3190
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:426
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:574
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:602
DWORD IsDragging
Definition: traywnd.cpp:363
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3096
HRESULT STDMETHODCALLTYPE Close()
Definition: traywnd.cpp:2196
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1610
LRESULT OnNcLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3002
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3052
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:333
UINT m_AutoHideState
Definition: traywnd.cpp:347
LRESULT OnMoving(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2631
void PopupStartMenu()
Definition: traywnd.cpp:1896
LRESULT OnSetFocus(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3294
LRESULT OnGetMinMaxInfo(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3301
void UpdateFonts()
Definition: traywnd.cpp:1050
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:749
STDMETHODIMP RegisterDesktopWindow(IN HWND hWndDesktop) override
Definition: traywnd.cpp:3527
HMONITOR & GetMonitor() override
Definition: traywnd.cpp:3592
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2653
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:317
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1710
LRESULT OnOpenStartMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3027
static DWORD CALLBACK EjectThreadProc(LPVOID arg)
Definition: traywnd.cpp:793
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:344
void DrawShowDesktopButton()
Definition: traywnd.cpp:2542
SIZE m_AutoHideOffset
Definition: traywnd.cpp:348
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2674
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3162
LRESULT OnAppTrayDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3021
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1200
HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: traywnd.cpp:2311
STDMETHODIMP Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
Definition: traywnd.cpp:3536
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: traywnd.cpp:3560
LRESULT OnActivate(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3282
BOOL IsAlwaysOnTop() const override
Definition: traywnd.cpp:3591
VOID HideStartMenu()
Definition: traywnd.cpp:730
VOID TrayMessageLoop()
Definition: traywnd.cpp:3477
HWND GetTrayWnd() const override
Definition: traywnd.cpp:3596
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1410
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2214
virtual ~CTrayWindow()
Definition: traywnd.cpp:395
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:345
HWND GetDesktopWnd() const override
Definition: traywnd.cpp:3597
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2576
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3131
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3551
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1225
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3014
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3542
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1108
LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3208
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:899
DWORD WINAPI RunFileDlgThread()
Definition: traywnd.cpp:484
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2335
DWORD NewPosSize
Definition: traywnd.cpp:364
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:970
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2510
void _Init()
Definition: traywnd.cpp:3565
LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2668
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2789
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:319
HFONT m_Font
Definition: traywnd.cpp:326
LRESULT DoExitWindows()
Definition: traywnd.cpp:461
void ProcessAutoHide()
Definition: traywnd.cpp:1984
HWND m_DesktopWnd
Definition: traywnd.cpp:328
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1428
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:323
void SaveState()
Definition: traywnd.cpp:450
HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: traywnd.cpp:2295
LRESULT OnRebarAutoSize(INT code, LPNMHDR nmhdr, BOOL &bHandled)
Definition: traywnd.cpp:3310
STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
Definition: traywnd.cpp:3076
BOOL STDMETHODCALLTYPE ExecContextMenuCmd(IN UINT uiCmd)
Definition: traywnd.cpp:642
void DisplayRunFileDlg()
Definition: traywnd.cpp:526
HWND m_TrayNotify
Definition: traywnd.cpp:331
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
struct @1772 Msg[]
LPARAM lParam
Definition: combotst.c:139
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
#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:1972
#define UINT_MAX
Definition: limits.h:27
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:1243
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1633
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1087
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:31
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:146
#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
#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 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)
unsigned int UINT
Definition: ndis.h:50
_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 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:738
#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:2472
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2778
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2723
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:1538
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2202
#define CSIDL_PRINTERS
Definition: shlobj.h:2185
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2537
#define MM_ADDSEPARATOR
Definition: shlobj.h:2536
#define CSIDL_DRIVES
Definition: shlobj.h:2197
@ REST_CLASSICSHELL
Definition: shlobj.h:1687
@ REST_NOSAVESET
Definition: shlobj.h:1652
@ REST_NOSETFOLDERS
Definition: shlobj.h:1654
@ REST_NOWINKEYS
Definition: shlobj.h:1748
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1675
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1686
@ REST_NOCLOSE
Definition: shlobj.h:1651
#define CSIDL_CONTROLS
Definition: shlobj.h:2184
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2548
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:3092
HWND hwndDesktop
Definition: traywnd.cpp:105
HWND hwndProgman
Definition: traywnd.cpp:106
BOOL bMustBeInMonitor
Definition: traywnd.cpp:108
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:169
HWND hwnd
Definition: traywnd.cpp:168
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
TW_STRUCKRECTS2 sr
Definition: precomp.h:228
WINDOWPLACEMENT wplt
Definition: traywnd.cpp:51
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:21
const GUID IID_IShellDesktopTray
Definition: traywnd.cpp:177
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:40
#define AUTOHIDE_SHOWN
Definition: traywnd.cpp:30
static BOOL CALLBACK BackupWindowsPosProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:55
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:53
VOID TrayProcessMessages(ITrayWindow *Tray)
Definition: traywnd.cpp:3781
#define IDHK_RUN
Definition: traywnd.cpp:33
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:26
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:16
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:171
VOID TrayMessageLoop(ITrayWindow *Tray)
Definition: traywnd.cpp:3787
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:25
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3775
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:29
HRESULT CreateTrayWindow(ITrayWindow **ppTray)
Definition: traywnd.cpp:3760
#define IDHK_DESKTOP
Definition: traywnd.cpp:43
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:87
#define IDHK_EXPLORE
Definition: traywnd.cpp:37
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:152
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:31
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:34
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:35
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:42
#define IDHK_PREV_TASK
Definition: traywnd.cpp:41
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:18
static BOOL CALLBACK FindEffectiveProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:112
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:28
VOID RestoreWindowPos()
Definition: traywnd.cpp:75
#define IDHK_FIND
Definition: traywnd.cpp:38
enum @116 g_Arrangement
#define AUTOHIDE_INTERVAL_ANIMATING
Definition: traywnd.cpp:23
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:19
VOID BackupWindowPos()
Definition: traywnd.cpp:70
#define IDHK_HELP
Definition: traywnd.cpp:36
@ TILED
Definition: traywnd.cpp:46
@ NONE
Definition: traywnd.cpp:46
@ CASCADED
Definition: traywnd.cpp:46
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:39
#define AUTOHIDE_DELAY_SHOW
Definition: traywnd.cpp:22
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:20
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3752
#define IDHK_PAGER
Definition: traywnd.cpp:44
#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:1012
#define TRAYCMD_STARTMENU
Definition: undocshell.h:995
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:1015
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:1002
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:1018
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:1004
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:1007
#define TABDMC_APPBAR
Definition: undocshell.h:1021
#define TWM_DOEXITWINDOWS
Definition: undocshell.h:67
#define TRAYCMD_TILE_V
Definition: undocshell.h:1000
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:1010
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:1017
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:1009
#define TRAYCMD_TILE_H
Definition: undocshell.h:999
#define TRAYCMD_EJECT
Definition: undocshell.h:1003
#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:1023
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:997
#define TRAYCMD_CASCADE
Definition: undocshell.h:998
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:1008
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:1006
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:1013
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:1014
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:1005
#define TABDMC_NOTIFY
Definition: undocshell.h:1022
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:1016
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:1011
#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:1845
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 SW_SHOWNORMAL
Definition: winuser.h:781
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
#define GW_OWNER
Definition: winuser.h:777
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define CreateWindowEx
Definition: winuser.h:5921
#define GetMonitorInfo
Definition: winuser.h:5957
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define BM_GETSTATE
Definition: winuser.h:1949
#define WM_CLOSE
Definition: winuser.h:1649
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define MF_BYCOMMAND
Definition: winuser.h:202
#define WM_SYSCOMMAND
Definition: winuser.h:1769
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define LR_LOADTRANSPARENT
Definition: winuser.h:1104
#define VK_TAB
Definition: winuser.h:2235
#define SM_CYEDGE
Definition: winuser.h:1020
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MIIM_ID
Definition: winuser.h:733
#define WM_KEYUP
Definition: winuser.h:1744
#define SM_CYSCREEN
Definition: winuser.h:971
#define HTCAPTION
Definition: winuser.h:2512
#define HWND_TOPMOST
Definition: winuser.h:1219
#define SM_CXEDGE
Definition: winuser.h:1019
#define BST_UNCHECKED
Definition: winuser.h:199
#define MOD_WIN
Definition: winuser.h:2686
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1689
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
struct tagWINDOWINFO WINDOWINFO
#define HTBOTTOM
Definition: winuser.h:2529
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_SPACE
Definition: winuser.h:2255
#define HTBORDER
Definition: winuser.h:2533
#define WM_SIZE
Definition: winuser.h:1639
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
#define BM_SETSTATE
Definition: winuser.h:1952
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define SM_CXFRAME
Definition: winuser.h:1005
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1768
#define TPM_BOTTOMALIGN
Definition: winuser.h:2421
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define VK_CONTROL
Definition: winuser.h:2239
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3064
#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
#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
#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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define IID_PPV_ARG(Itype, ppType)