ReactOS 0.4.16-dev-1163-gec5b142
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 "appbar.h"
12
13HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
14
15#define WM_APP_TRAYDESTROY (WM_APP + 0x100)
16
17#define TIMER_ID_AUTOHIDE 1
18#define TIMER_ID_MOUSETRACK 2
19#define MOUSETRACK_INTERVAL 100
20#define AUTOHIDE_DELAY_HIDE 2000
21#define AUTOHIDE_DELAY_SHOW 50
22#define AUTOHIDE_INTERVAL_ANIMATING 10
23
24#define AUTOHIDE_SPEED_SHOW 10
25#define AUTOHIDE_SPEED_HIDE 1
26
27#define AUTOHIDE_HIDDEN 0
28#define AUTOHIDE_SHOWING 1
29#define AUTOHIDE_SHOWN 2
30#define AUTOHIDE_HIDING 3
31
32#define IDHK_RUN 0x1f4
33#define IDHK_MINIMIZE_ALL 0x1f5
34#define IDHK_RESTORE_ALL 0x1f6
35#define IDHK_HELP 0x1f7
36#define IDHK_EXPLORE 0x1f8
37#define IDHK_FIND 0x1f9
38#define IDHK_FIND_COMPUTER 0x1fa
39#define IDHK_NEXT_TASK 0x1fb
40#define IDHK_PREV_TASK 0x1fc
41#define IDHK_SYS_PROPERTIES 0x1fd
42#define IDHK_DESKTOP 0x1fe
43#define IDHK_PAGER 0x1ff
44
46
48{
51};
53
55{
56 WINDOWPOSBACKUPDATA wposdata;
57 HWND hDesk = GetDesktopWindow();
58 if (IsWindowVisible(hwnd) && !IsIconic(hwnd) && (hwnd != hDesk))
59 {
60 wposdata.hwnd = hwnd;
61 wposdata.wplt.length = sizeof(wposdata.wplt);
62 GetWindowPlacement(hwnd, &(wposdata.wplt));
63 g_WindowPosBackup.Add(wposdata);
64 }
65
66 return TRUE;
67}
68
70{
72}
73
75{
77
78 for (INT i = g_WindowPosBackup.GetSize() - 1; i >= 0; --i)
79 {
81 }
82
83 g_WindowPosBackup.RemoveAll();
84}
85
87{
90 {
92 return TRUE;
93
95 if (!(exstyle & WS_EX_TOPMOST))
96 return TRUE;
97 }
98 return FALSE;
99}
100
102{
108};
109
110static BOOL CALLBACK
112{
114
115 if (!CanBeMinimized(hwnd))
116 return TRUE; // continue
117
118 if (pei->hTrayWnd == hwnd || pei->hwndDesktop == hwnd ||
119 pei->hwndProgman == hwnd)
120 {
121 return TRUE; // continue
122 }
123
124 if (pei->bMustBeInMonitor)
125 {
126 // is the window in the nearest monitor?
127 HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
128 if (hMon)
129 {
131 ZeroMemory(&info, sizeof(info));
132 info.cbSize = sizeof(info);
133 if (GetMonitorInfoW(hMon, &info))
134 {
135 RECT rcWindow, rcMonitor, rcIntersect;
136 rcMonitor = info.rcMonitor;
137
138 GetWindowRect(hwnd, &rcWindow);
139
140 if (!IntersectRect(&rcIntersect, &rcMonitor, &rcWindow))
141 return TRUE; // continue
142 }
143 }
144 }
145
146 pei->hwndFound = hwnd;
147 return FALSE; // stop if found
148}
149
150static BOOL
152{
154 ei.hwndFound = NULL;
156 ei.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
157 ei.hwndProgman = FindWindowW(L"Progman", NULL);
158 ei.bMustBeInMonitor = bMustBeInMonitor;
159
161 return ei.hwndFound != NULL;
162}
163
164/* Minimized window position info */
166{
169};
171
172/*
173 * ITrayWindow
174 */
175
176const GUID IID_IShellDesktopTray = { 0x213e2df9, 0x9a14, 0x4328, { 0x99, 0xb1, 0x69, 0x61, 0xf9, 0x14, 0x3c, 0xe9 } };
177
179 : public CWindowImpl<CStartButton>
180{
184
185public:
187 : m_ImageList(NULL),
188 m_Font(NULL)
189 {
190 m_Size.cx = 0;
191 m_Size.cy = 0;
192 }
193
195 {
196 if (m_ImageList != NULL)
198
199 if (m_Font != NULL)
201 }
202
204 {
205 return m_Size;
206 }
207
209 {
210 SIZE Size = { 0, 0 };
211
212 if (m_ImageList == NULL ||
214 {
216 }
217
219
220 /* Save the size of the start button */
221 m_Size = Size;
222 }
223
225 {
226 /* Get the system fonts, we use the caption font, always bold, though. */
227 NONCLIENTMETRICS ncm = {sizeof(ncm)};
228 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
229 return;
230
231 if (m_Font)
233
234 ncm.lfCaptionFont.lfWeight = FW_BOLD;
235 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
236
238 }
239
241 {
242 // HACK & FIXME: CORE-18016
243 HWND hWnd = m_hWnd;
244 m_hWnd = NULL;
246
247 SetWindowTheme(m_hWnd, L"Start", NULL);
248
251 0, 0, 0,
254
257 UpdateSize();
258 }
259
261 {
262 WCHAR szStartCaption[32];
264 IDS_START,
265 szStartCaption,
266 _countof(szStartCaption)))
267 {
268 wcscpy(szStartCaption, L"Start");
269 }
270
272
273 // HACK & FIXME: CORE-18016
275 0,
276 WC_BUTTON,
277 szStartCaption,
278 dwStyle,
279 0, 0, 0, 0,
283 NULL);
284
285 if (m_hWnd)
286 Initialize();
287
288 return m_hWnd;
289 }
290
292 {
293 if (uMsg == WM_KEYUP && wParam != VK_SPACE)
294 return 0;
295
297 return 0;
298 }
299
303
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
327
332
334
340
343
346
350
352
353public:
355
356 union
357 {
359 struct
360 {
361 /* UI Status */
366 };
367 };
368
369public:
373 m_Theme(NULL),
374 m_Font(NULL),
376 m_Rebar(NULL),
379 m_Position(0),
388 Flags(0)
389 {
395 }
396
397 virtual ~CTrayWindow()
398 {
399 if (m_ShellServices != NULL)
400 {
403 }
404
405 if (m_Font != NULL)
406 {
408 m_Font = NULL;
409 }
410
411 if (m_Theme)
412 {
414 m_Theme = NULL;
415 }
416
418 }
419
420
421
422
423
424 /**********************************************************
425 * ##### command handling #####
426 */
427
429 {
430 WCHAR szCommand[256];
431 WCHAR *pszParameters;
432
434 id,
435 szCommand,
436 _countof(szCommand)))
437 {
438 return E_FAIL;
439 }
440
441 pszParameters = wcschr(szCommand, L'>');
442 if (pszParameters)
443 {
444 *pszParameters = 0;
445 pszParameters++;
446 }
447
448 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
449 return S_OK;
450 }
451
453 {
455 return;
456
458
461 }
462
464 {
465 SaveState();
466
467 /* Display the ReactOS Shutdown Dialog */
469
470 /*
471 * If the user presses CTRL+ALT+SHIFT while exiting
472 * the shutdown dialog, exit the shell cleanly.
473 */
474 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
475 (GetKeyState(VK_SHIFT) & 0x8000) &&
476 (GetKeyState(VK_MENU) & 0x8000))
477 {
478 PostMessage(WM_QUIT, 0, 0);
479 }
480 return 0;
481 }
482
484 {
485 HWND hwnd;
486 RECT posRect;
487
489
491 WC_STATIC,
492 NULL,
494 posRect.left,
495 posRect.top,
496 posRect.right - posRect.left,
497 posRect.bottom - posRect.top,
498 NULL,
499 NULL,
500 NULL,
501 NULL);
502
504
505 // build the default directory from two environment variables
506 CStringW strDefaultDir, strHomePath;
507 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
508 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
509 strDefaultDir += strHomePath;
510
512
515
516 return 0;
517 }
518
520 {
521 CTrayWindow * This = (CTrayWindow*) pParam;
522 return This->RunFileDlgThread();
523 }
524
526 {
527 HWND hRunDlg;
529 {
531 if (hRunDlg != NULL &&
532 hRunDlg != m_RunFileDlgOwner)
533 {
534 SetForegroundWindow(hRunDlg);
535 return;
536 }
537 }
538
540 }
541
543 {
544 HWND hwnd;
545 RECT posRect;
546
549 WC_STATIC,
550 NULL,
552 posRect.left,
553 posRect.top,
554 posRect.right - posRect.left,
555 posRect.bottom - posRect.top,
556 NULL,
557 NULL,
558 NULL,
559 NULL);
560
562
564
567
568 return 0;
569 }
570
572 {
573 CTrayWindow *This = (CTrayWindow*) pParam;
574
575 return This->TrayPropertiesThread();
576 }
577
579 {
580 HWND hTrayProp;
581
583 {
585 if (hTrayProp != NULL &&
586 hTrayProp != m_TrayPropertiesOwner)
587 {
588 SetForegroundWindow(hTrayProp);
589 return NULL;
590 }
591 }
592
594 return NULL;
595 }
596
598 {
599 WCHAR szDir[MAX_PATH];
600
601 if (SHGetSpecialFolderPath(hWndOwner,
602 szDir,
604 FALSE))
605 {
606 ShellExecute(hWndOwner,
607 lpOperation,
608 szDir,
609 NULL,
610 NULL,
612 }
613 }
614
616 {
617 ShellExecute(hWndOwner,
618 TEXT("open"),
619 TEXT("taskmgr.exe"),
620 NULL,
621 NULL,
623 }
624
626 {
628 {
629 ShowDesktop();
630 }
631 else
632 {
633 RestoreAll();
634 }
635 }
636
638 {
639 switch (uiCmd)
640 {
643 break;
644
647 TEXT("open"));
648 break;
649
652 TEXT("explore"));
653 break;
654
655 case ID_LOCKTASKBAR:
657 break;
658
661 break;
662
665 break;
666
668 ShowDesktop();
669 break;
670
673 if (g_Arrangement == NONE)
674 {
676 }
680 break;
681
684 if (g_Arrangement == NONE)
685 {
687 }
691 break;
692
695 if (g_Arrangement == NONE)
696 {
698 }
702 break;
703
706 break;
707
709 //FIXME: Use SHRunControlPanel
710 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
711 break;
712
714 RestoreAll();
715 break;
716
717 default:
718 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
719 return FALSE;
720 }
721
722 return TRUE;
723 }
724
726 {
727 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
728 }
729
731 {
732 switch (id)
733 {
734 case IDHK_RUN:
737 break;
738 case IDHK_HELP:
740 break;
741 case IDHK_EXPLORE:
742 //FIXME: We don't support this yet:
743 //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
744 ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
745 break;
746 case IDHK_FIND:
748 break;
751 break;
753 //FIXME: Use SHRunControlPanel
754 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
755 break;
756 case IDHK_NEXT_TASK:
757 break;
758 case IDHK_PREV_TASK:
759 break;
761 MinimizeAll();
762 break;
763 case IDHK_RESTORE_ALL:
764 RestoreAll();
765 break;
766 case IDHK_DESKTOP:
768 break;
769 case IDHK_PAGER:
770 break;
771 }
772
773 return 0;
774 }
775
777 {
778 switch (uCommand)
779 {
781 // TODO:
782 break;
786 break;
788 SaveState();
789 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
790 break;
791 case TRAYCMD_CASCADE:
793 break;
794 case TRAYCMD_TILE_H:
796 break;
797 case TRAYCMD_TILE_V:
799 break;
802 break;
804 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
805 break;
808 break;
810 MinimizeAll();
811 break;
813 RestoreAll();
814 break;
816 ShowDesktop();
817 break;
820 break;
822 break;
825 {
828 }
829 break;
832 break;
834 // TODO:
835 break;
838 break;
840 // TODO:
841 break;
843 // TODO:
844 break;
846 // TODO:
847 break;
848 case IDM_SEARCH:
851 break;
854 break;
855
856 default:
857 break;
858 }
859
860 return FALSE;
861 }
862
863
865 IN HMENU hMenu,
866 IN POINT *ppt OPTIONAL,
867 IN HWND hwndExclude OPTIONAL,
868 IN BOOL TrackUp,
869 IN BOOL IsContextMenu)
870 {
871 TPMPARAMS tmp, *ptmp = NULL;
872 POINT pt;
873 UINT cmdId;
874 UINT fuFlags;
875
876 if (hwndExclude != NULL)
877 {
878 /* Get the client rectangle and map it to screen coordinates */
879 if (::GetClientRect(hwndExclude,
880 &tmp.rcExclude) &&
881 ::MapWindowPoints(hwndExclude,
882 NULL,
883 (LPPOINT) &tmp.rcExclude,
884 2) != 0)
885 {
886 ptmp = &tmp;
887 }
888 }
889
890 if (ppt == NULL)
891 {
892 if (ptmp == NULL &&
893 GetClientRect(&tmp.rcExclude) &&
895 NULL,
896 (LPPOINT) &tmp.rcExclude,
897 2) != 0)
898 {
899 ptmp = &tmp;
900 }
901
902 if (ptmp != NULL)
903 {
904 /* NOTE: TrackPopupMenuEx will eventually align the track position
905 for us, no need to take care of it here as long as the
906 coordinates are somewhere within the exclusion rectangle */
907 pt.x = ptmp->rcExclude.left;
908 pt.y = ptmp->rcExclude.top;
909 }
910 else
911 pt.x = pt.y = 0;
912 }
913 else
914 pt = *ppt;
915
916 tmp.cbSize = sizeof(tmp);
917
918 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
919 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
920 if (IsContextMenu)
921 fuFlags |= TPM_RIGHTBUTTON;
922 else
923 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
924
925 cmdId = TrackPopupMenuEx(hMenu,
926 fuFlags,
927 pt.x,
928 pt.y,
929 m_hWnd,
930 ptmp);
931
932 return cmdId;
933 }
934
936 IN IContextMenu * contextMenu,
937 IN POINT *ppt OPTIONAL,
938 IN HWND hwndExclude OPTIONAL,
939 IN BOOL TrackUp,
941 {
942 POINT pt;
944 RECT rc;
945 HRESULT hr;
946 UINT uCommand;
947 HMENU popup = CreatePopupMenu();
948
949 if (popup == NULL)
950 return E_FAIL;
951
952 if (ppt)
953 {
954 pt = *ppt;
955 }
956 else
957 {
959 pt.x = rc.left;
960 pt.y = rc.top;
961 }
962
963 TRACE("Before Query\n");
964 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
966 {
967 TRACE("Query failed\n");
968 DestroyMenu(popup);
969 return hr;
970 }
971
972 TRACE("Before Tracking\n");
974 if (hwndExclude)
975 {
976 ::GetWindowRect(hwndExclude, &rc);
977 ZeroMemory(&params, sizeof(params));
978 params.cbSize = sizeof(params);
979 params.rcExclude = rc;
980 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
981 }
982 else
983 {
984 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
985 }
987
988 if (uCommand != 0)
989 {
990 TRACE("Before InvokeCommand\n");
991 CMINVOKECOMMANDINFO cmi = { 0 };
992 cmi.cbSize = sizeof(cmi);
993 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
994 cmi.hwnd = m_hWnd;
995 hr = contextMenu->InvokeCommand(&cmi);
996 }
997 else
998 {
999 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1000 hr = S_FALSE;
1001 }
1002
1003 DestroyMenu(popup);
1004 return hr;
1005 }
1006
1007
1008
1009
1010
1011 /**********************************************************
1012 * ##### moving and sizing handling #####
1013 */
1014
1016 {
1017 /* There is nothing to do if themes are enabled */
1018 if (m_Theme)
1019 return;
1020
1022
1023 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1024 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1025 {
1026 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1027 return;
1028 }
1029
1030 if (m_Font != NULL)
1032
1033 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1034 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1035 if (!m_Font)
1036 {
1037 ERR("CreateFontIndirect failed\n");
1038 return;
1039 }
1040
1044 }
1045
1047 IN OUT RECT *pRect,
1049 {
1051 HMONITOR hMon;
1052
1053 mi.cbSize = sizeof(mi);
1054 hMon = MonitorFromRect(pRect, dwFlags);
1055 if (hMon != NULL &&
1056 GetMonitorInfo(hMon, &mi))
1057 {
1058 *pRect = mi.rcMonitor;
1059 }
1060 else
1061 {
1062 pRect->left = 0;
1063 pRect->top = 0;
1064 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1065 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1066
1067 hMon = NULL;
1068 }
1069
1070 return hMon;
1071 }
1072
1074 IN const RECT *pRect)
1075 {
1076 HMONITOR hMon;
1077
1078 /* In case the monitor sizes or saved sizes differ a bit (probably
1079 not a lot, only so the tray window overlaps into another monitor
1080 now), minimize the risk that we determine a wrong monitor by
1081 using the center point of the tray window if we can't determine
1082 it using the rectangle. */
1083 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1084 if (hMon == NULL)
1085 {
1086 POINT pt;
1087
1088 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1089 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1090
1091 /* be less error-prone, find the nearest monitor */
1092 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1093 }
1094
1095 return hMon;
1096 }
1097
1099 IN HMONITOR hMonitor,
1100 IN OUT RECT *pRect)
1101 {
1102 HMONITOR hMon = NULL;
1103
1104 if (hMonitor != NULL)
1105 {
1107
1108 mi.cbSize = sizeof(mi);
1109 if (!GetMonitorInfo(hMonitor, &mi))
1110 {
1111 /* Hm, the monitor is gone? Try to find a monitor where it
1112 could be located now */
1113 hMon = GetMonitorFromRect(pRect);
1114 if (hMon == NULL ||
1115 !GetMonitorInfo(hMon, &mi))
1116 {
1117 hMon = NULL;
1118 goto GetPrimaryRect;
1119 }
1120 }
1121
1122 *pRect = mi.rcMonitor;
1123 }
1124 else
1125 {
1126GetPrimaryRect:
1127 pRect->left = 0;
1128 pRect->top = 0;
1129 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1130 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1131 }
1132
1133 return hMon;
1134 }
1135
1137 {
1139 SIZE size;
1140
1141 if (pos > ABE_BOTTOM)
1142 pos = ABE_BOTTOM;
1143
1144 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1146 return;
1147
1148 switch (pos)
1149 {
1150 case ABE_TOP:
1151 rc->bottom -= size.cy;
1152 break;
1153 case ABE_BOTTOM:
1154 rc->top += size.cy;
1155 break;
1156 case ABE_LEFT:
1157 rc->right -= size.cx;
1158 break;
1159 case ABE_RIGHT:
1160 rc->left += size.cx;
1161 break;
1162 }
1163 }
1164
1166 IN const SIZE *pTraySize,
1167 IN OUT RECT *pRect)
1168 {
1169 switch (Position)
1170 {
1171 case ABE_LEFT:
1172 pRect->right = pRect->left + pTraySize->cx;
1173 break;
1174
1175 case ABE_TOP:
1176 pRect->bottom = pRect->top + pTraySize->cy;
1177 break;
1178
1179 case ABE_RIGHT:
1180 pRect->left = pRect->right - pTraySize->cx;
1181 break;
1182
1183 case ABE_BOTTOM:
1184 default:
1185 pRect->top = pRect->bottom - pTraySize->cy;
1186 break;
1187 }
1188 }
1189
1191 IN const RECT *pScreen,
1192 IN const SIZE *pTraySize OPTIONAL,
1193 OUT RECT *pRect)
1194 {
1195 if (pTraySize == NULL)
1196 pTraySize = &m_TraySize;
1197
1198 *pRect = *pScreen;
1199
1200 if(!m_Theme)
1201 {
1202 /* Move the border outside of the screen */
1203 InflateRect(pRect,
1206 }
1207
1208 MakeTrayRectWithSize(Position, pTraySize, pRect);
1209 }
1210
1212 {
1213 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1214 }
1215
1218 IN OUT RECT *pRect)
1219 {
1220 RECT rcScreen;
1221 //BOOL Horizontal;
1222 HMONITOR hMon;
1223 SIZE szMax, szWnd;
1224
1225 //Horizontal = IsPosHorizontal();
1226
1227 szWnd.cx = pRect->right - pRect->left;
1228 szWnd.cy = pRect->bottom - pRect->top;
1229
1230 rcScreen = *pRect;
1231 hMon = GetScreenRectFromRect(
1232 &rcScreen,
1233 MONITOR_DEFAULTTONEAREST);
1234
1235 /* Calculate the maximum size of the tray window and limit the window
1236 size to half of the screen's size. */
1237 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1238 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1239 if (szWnd.cx > szMax.cx)
1240 szWnd.cx = szMax.cx;
1241 if (szWnd.cy > szMax.cy)
1242 szWnd.cy = szMax.cy;
1243
1244 /* FIXME - calculate */
1245
1247 &rcScreen,
1248 &szWnd,
1249 pRect);
1250
1251 return hMon;
1252 }
1253
1254#if 0
1255 VOID
1256 GetMinimumWindowSize(
1257 OUT RECT *pRect)
1258 {
1259 RECT rcMin = {0};
1260
1261 AdjustWindowRectEx(&rcMin,
1263 GWL_STYLE),
1264 FALSE,
1266 GWL_EXSTYLE));
1267
1268 *pRect = rcMin;
1269 }
1270#endif
1271
1272
1274 IN POINT pt,
1275 OUT RECT *pRect,
1276 OUT HMONITOR *phMonitor)
1277 {
1278 HMONITOR hMon, hMonNew;
1279 DWORD PosH, PosV, Pos;
1280 SIZE DeltaPt, ScreenOffset;
1281 RECT rcScreen;
1282
1283 rcScreen.left = 0;
1284 rcScreen.top = 0;
1285
1286 /* Determine the screen rectangle */
1287 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1288 if (hMon != NULL)
1289 {
1291
1292 mi.cbSize = sizeof(mi);
1293 if (!GetMonitorInfo(hMon, &mi))
1294 {
1295 hMon = NULL;
1296 goto GetPrimaryScreenRect;
1297 }
1298
1299 /* make left top corner of the screen zero based to
1300 make calculations easier */
1301 pt.x -= mi.rcMonitor.left;
1302 pt.y -= mi.rcMonitor.top;
1303
1304 ScreenOffset.cx = mi.rcMonitor.left;
1305 ScreenOffset.cy = mi.rcMonitor.top;
1306 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1307 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1308 }
1309 else
1310 {
1311GetPrimaryScreenRect:
1312 ScreenOffset.cx = 0;
1313 ScreenOffset.cy = 0;
1316 }
1317
1318 /* Calculate the nearest screen border */
1319 if (pt.x < rcScreen.right / 2)
1320 {
1321 DeltaPt.cx = pt.x;
1322 PosH = ABE_LEFT;
1323 }
1324 else
1325 {
1326 DeltaPt.cx = rcScreen.right - pt.x;
1327 PosH = ABE_RIGHT;
1328 }
1329
1330 if (pt.y < rcScreen.bottom / 2)
1331 {
1332 DeltaPt.cy = pt.y;
1333 PosV = ABE_TOP;
1334 }
1335 else
1336 {
1337 DeltaPt.cy = rcScreen.bottom - pt.y;
1338 PosV = ABE_BOTTOM;
1339 }
1340
1341 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1342
1343 /* Fix the screen origin to be relative to the primary monitor again */
1344 OffsetRect(&rcScreen,
1345 ScreenOffset.cx,
1346 ScreenOffset.cy);
1347
1348 RECT rcPos = m_TrayRects[Pos];
1349
1350 hMonNew = GetMonitorFromRect(&rcPos);
1351 if (hMon != hMonNew)
1352 {
1353 SIZE szTray;
1354
1355 /* Recalculate the rectangle, we're dragging to another monitor.
1356 We don't need to recalculate the rect on single monitor systems. */
1357 szTray.cx = rcPos.right - rcPos.left;
1358 szTray.cy = rcPos.bottom - rcPos.top;
1359
1360 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1361 hMon = hMonNew;
1362 }
1363 else
1364 {
1365 /* The user is dragging the tray window on the same monitor. We don't need
1366 to recalculate the rectangle */
1367 *pRect = rcPos;
1368 }
1369
1370 *phMonitor = hMon;
1371
1372 return Pos;
1373 }
1374
1376 IN OUT RECT *pRect,
1377 OUT HMONITOR *phMonitor)
1378 {
1379 POINT pt;
1380
1381 /* Calculate the center of the rectangle. We call
1382 GetDraggingRectFromPt to calculate a valid
1383 dragging rectangle */
1384 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1385 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1386
1387 return GetDraggingRectFromPt(
1388 pt,
1389 pRect,
1390 phMonitor);
1391 }
1392
1394 {
1395 RECT rcTray;
1396
1397 if (IsDragging)
1398 {
1399 rcTray.left = pwp->x;
1400 rcTray.top = pwp->y;
1401 rcTray.right = rcTray.left + pwp->cx;
1402 rcTray.bottom = rcTray.top + pwp->cy;
1403
1404 if (!EqualRect(&rcTray,
1406 {
1407 /* Recalculate the rectangle, the user dragged the tray
1408 window to another monitor or the window was somehow else
1409 moved or resized */
1411 &rcTray,
1413 //m_TrayRects[DraggingPosition] = rcTray;
1414 }
1415
1416 //Monitor = CalculateValidSize(DraggingPosition,
1417 // &rcTray);
1418
1423 IsDragging = FALSE;
1424
1425 m_TrayRects[m_Position] = rcTray;
1426 goto ChangePos;
1427 }
1428 else if (GetWindowRect(&rcTray))
1429 {
1430 if (InSizeMove)
1431 {
1432 if (!(pwp->flags & SWP_NOMOVE))
1433 {
1434 rcTray.left = pwp->x;
1435 rcTray.top = pwp->y;
1436 }
1437
1438 if (!(pwp->flags & SWP_NOSIZE))
1439 {
1440 rcTray.right = rcTray.left + pwp->cx;
1441 rcTray.bottom = rcTray.top + pwp->cy;
1442 }
1443
1445
1446 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1447 {
1448 SIZE szWnd;
1449
1450 szWnd.cx = pwp->cx;
1451 szWnd.cy = pwp->cy;
1452
1453 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1454 }
1455
1456 m_TrayRects[m_Position] = rcTray;
1457 }
1458 else if (m_Position != (DWORD)-1)
1459 {
1460 /* If the user isn't resizing the tray window we need to make sure the
1461 new size or position is valid. this is to prevent changes to the window
1462 without user interaction. */
1463 rcTray = m_TrayRects[m_Position];
1464
1466 {
1467 rcTray.left += m_AutoHideOffset.cx;
1468 rcTray.right += m_AutoHideOffset.cx;
1469 rcTray.top += m_AutoHideOffset.cy;
1470 rcTray.bottom += m_AutoHideOffset.cy;
1471 }
1472
1473 }
1474
1475ChangePos:
1476 m_TraySize.cx = rcTray.right - rcTray.left;
1477 m_TraySize.cy = rcTray.bottom - rcTray.top;
1478
1479 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1480 pwp->x = rcTray.left;
1481 pwp->y = rcTray.top;
1482 pwp->cx = m_TraySize.cx;
1483 pwp->cy = m_TraySize.cy;
1484 }
1485 }
1486
1488 {
1489 RECT rcClip, rcWindow;
1490 HRGN hClipRgn;
1491
1492 if (GetWindowRect(&rcWindow))
1493 {
1494 /* Disable clipping on systems with only one monitor */
1496 Clip = FALSE;
1497
1498 if (Clip)
1499 {
1500 rcClip = rcWindow;
1501
1502 GetScreenRect(m_Monitor, &rcClip);
1503
1504 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1505 {
1506 rcClip = rcWindow;
1507 }
1508
1509 OffsetRect(&rcClip,
1510 -rcWindow.left,
1511 -rcWindow.top);
1512
1513 hClipRgn = CreateRectRgnIndirect(&rcClip);
1514 }
1515 else
1516 hClipRgn = NULL;
1517
1518 /* Set the clipping region or make sure the window isn't clipped
1519 by disabling it explicitly. */
1520 SetWindowRgn(hClipRgn, TRUE);
1521 }
1522 }
1523
1525 {
1526#if !WIN7_DEBUG_MODE
1527 RECT rcTray, rcWorkArea;
1528
1529 /* If monitor has changed then fix the previous monitors work area */
1531 {
1532 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1533 SystemParametersInfoW(SPI_SETWORKAREA,
1534 1,
1535 &rcWorkArea,
1537 }
1538
1539 rcTray = m_TrayRects[m_Position];
1540
1541 GetScreenRect(m_Monitor, &rcWorkArea);
1543
1544 /* If AutoHide is false then change the workarea to exclude
1545 the area that the taskbar covers. */
1547 {
1548 switch (m_Position)
1549 {
1550 case ABE_TOP:
1551 rcWorkArea.top = rcTray.bottom;
1552 break;
1553 case ABE_LEFT:
1554 rcWorkArea.left = rcTray.right;
1555 break;
1556 case ABE_RIGHT:
1557 rcWorkArea.right = rcTray.left;
1558 break;
1559 case ABE_BOTTOM:
1560 rcWorkArea.bottom = rcTray.top;
1561 break;
1562 }
1563 }
1564
1565 /*
1566 * Resize the current monitor work area. Win32k will also send
1567 * a WM_SIZE message to automatically resize the desktop.
1568 */
1569 SystemParametersInfoW(SPI_SETWORKAREA,
1570 1,
1571 &rcWorkArea,
1573#endif
1574 }
1575
1577 {
1578 /* Force the rebar bands to resize */
1580 IID_IDeskBand,
1582 0,
1583 NULL,
1584 NULL);
1585
1586 /* Calculate the size of the taskbar based on the rebar */
1588
1589 /* Move the tray window */
1590 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1591 * and position we use here with m_TrayRects */
1596 }
1597
1599 {
1600 DWORD Pos;
1601 RECT rcScreen;
1602 SIZE WndSize, EdgeSize, DlgFrameSize;
1603 SIZE StartBtnSize = m_StartButton.GetSize();
1604
1605 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1606 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1607 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1608 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1609
1611 rcScreen = g_TaskbarSettings.sr.Rect;
1612 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1613
1615 {
1616 /* Use the minimum size of the taskbar, we'll use the start
1617 button as a minimum for now. Make sure we calculate the
1618 entire window size, not just the client size. However, we
1619 use a thinner border than a standard thick border, so that
1620 the start button and bands are not stuck to the screen border. */
1621 if(!m_Theme)
1622 {
1623 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1624 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1625 }
1626 else
1627 {
1628 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1629 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1632 }
1633 }
1634 /* Determine a minimum tray window rectangle. The "client" height is
1635 zero here since we cannot determine an optimal minimum width when
1636 loaded as a vertical tray window. We just need to make sure the values
1637 loaded from the registry are at least. The windows explorer behaves
1638 the same way, it allows the user to save a zero width vertical tray
1639 window, but not a zero height horizontal tray window. */
1640 if(!m_Theme)
1641 {
1642 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1643 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1644 }
1645 else
1646 {
1647 WndSize.cx = StartBtnSize.cx;
1648 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1649 }
1650
1651 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1652 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1653 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1654 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1655
1656 /* Save the calculated size */
1657 m_TraySize = WndSize;
1658
1659 /* Calculate all docking rectangles. We need to do this here so they're
1660 initialized and dragging the tray window to another position gives
1661 usable results */
1662 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1663 {
1665 &rcScreen,
1666 &m_TraySize,
1667 &m_TrayRects[Pos]);
1668 // 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);
1669 }
1670
1671 /* Determine which monitor we are on. It shouldn't matter which docked
1672 position rectangle we use */
1674 }
1675
1677 {
1678 RECT rcClient;
1679 SIZE TraySize, StartSize;
1680 POINT ptTrayNotify = { 0, 0 };
1681 BOOL Horizontal;
1682 HDWP dwp;
1683
1685 if (prcClient != NULL)
1686 {
1687 rcClient = *prcClient;
1688 }
1689 else
1690 {
1691 if (!GetClientRect(&rcClient))
1692 {
1693 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1694 return;
1695 }
1696 }
1697
1698 Horizontal = IsPosHorizontal();
1699
1700 /* We're about to resize/move the start button, the rebar control and
1701 the tray notification control */
1702 dwp = BeginDeferWindowPos(4);
1703 if (dwp == NULL)
1704 {
1705 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1706 return;
1707 }
1708
1709 /* Limit the Start button width to the client width, if necessary */
1710 StartSize = m_StartButton.GetSize();
1711 if (StartSize.cx > rcClient.right)
1712 StartSize.cx = rcClient.right;
1713
1714 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1715 if (hwndTaskToolbar)
1716 {
1717 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1718
1719 /* Themed button covers Edge area as well */
1720 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1721 }
1722
1723 if (m_StartButton.m_hWnd != NULL)
1724 {
1725 /* Resize and reposition the button */
1726 dwp = m_StartButton.DeferWindowPos(dwp,
1727 NULL,
1728 0,
1729 0,
1730 StartSize.cx,
1731 StartSize.cy,
1733 if (dwp == NULL)
1734 {
1735 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1736 return;
1737 }
1738 }
1739
1740 /* Determine the size that the tray notification window needs */
1741 if (Horizontal)
1742 {
1743 TraySize.cx = 0;
1744 TraySize.cy = rcClient.bottom;
1745 }
1746 else
1747 {
1748 TraySize.cx = rcClient.right;
1749 TraySize.cy = 0;
1750 }
1751
1752 if (m_TrayNotify != NULL &&
1755 (WPARAM)Horizontal,
1756 (LPARAM)&TraySize))
1757 {
1758 /* Move the tray notification window to the desired location */
1759 if (Horizontal)
1760 ptTrayNotify.x = rcClient.right - TraySize.cx;
1761 else
1762 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1763
1764 dwp = ::DeferWindowPos(dwp,
1766 NULL,
1767 ptTrayNotify.x,
1768 ptTrayNotify.y,
1769 TraySize.cx,
1770 TraySize.cy,
1772 if (dwp == NULL)
1773 {
1774 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1775 return;
1776 }
1777 }
1778
1779 /* Resize/Move the rebar control */
1780 if (m_Rebar != NULL)
1781 {
1782 POINT ptRebar = { 0, 0 };
1783 SIZE szRebar;
1784
1785 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1786
1787 if (Horizontal)
1788 {
1789 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1790 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1791 szRebar.cy = rcClient.bottom;
1792 }
1793 else
1794 {
1795 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1796 szRebar.cx = rcClient.right;
1797 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1798 }
1799
1800 dwp = ::DeferWindowPos(dwp,
1801 m_Rebar,
1802 NULL,
1803 ptRebar.x,
1804 ptRebar.y,
1805 szRebar.cx,
1806 szRebar.cy,
1808 }
1809
1810 if (dwp != NULL)
1811 EndDeferWindowPos(dwp);
1812
1813 if (m_TaskSwitch != NULL)
1814 {
1815 /* Update the task switch window configuration */
1817 }
1818 }
1819
1820 void FitToRebar(PRECT pRect)
1821 {
1822 /* Get the rect of the rebar */
1823 RECT rebarRect, taskbarRect, clientRect;
1824 ::GetWindowRect(m_Rebar, &rebarRect);
1825 ::GetWindowRect(m_hWnd, &taskbarRect);
1826 ::GetClientRect(m_hWnd, &clientRect);
1827 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1828
1829 /* Calculate the difference of size of the taskbar and the rebar */
1830 SIZE margins;
1831 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1832 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1833
1834 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1835 switch (m_Position)
1836 {
1837 case ABE_TOP:
1838 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1840 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1841 break;
1842 case ABE_BOTTOM:
1843 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1845 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1846 break;
1847 case ABE_LEFT:
1848 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1850 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1851 break;
1852 case ABE_RIGHT:
1853 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1855 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1856 break;
1857 }
1858
1860 }
1861
1863 {
1864 if (m_StartMenuPopup != NULL)
1865 {
1866 POINTL pt;
1867 RECTL rcExclude;
1868 DWORD dwFlags = 0;
1869
1870 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1871 {
1872 switch (m_Position)
1873 {
1874 case ABE_BOTTOM:
1875 pt.x = rcExclude.left;
1876 pt.y = rcExclude.top;
1877 dwFlags |= MPPF_TOP;
1878 break;
1879 case ABE_TOP:
1880 pt.x = rcExclude.left;
1881 pt.y = rcExclude.bottom;
1882 dwFlags |= MPPF_BOTTOM;
1883 break;
1884 case ABE_LEFT:
1885 pt.x = rcExclude.right;
1886 pt.y = rcExclude.top;
1887 dwFlags |= MPPF_RIGHT;
1888 break;
1889 case ABE_RIGHT:
1890 pt.x = rcExclude.left;
1891 pt.y = rcExclude.top;
1892 dwFlags |= MPPF_LEFT;
1893 break;
1894 }
1895
1896 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1897
1898 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1899 }
1900 }
1901 }
1902
1904 {
1905 RECT rcCurrent;
1906 POINT pt;
1907 BOOL over;
1909
1910 GetCursorPos(&pt);
1911 GetWindowRect(&rcCurrent);
1912 over = PtInRect(&rcCurrent, pt);
1913
1915 {
1916 over = TRUE;
1917 }
1918
1919 if (over)
1920 {
1921 if (state == AUTOHIDE_HIDING)
1922 {
1923 TRACE("AutoHide cancelling hide.\n");
1926 }
1927 else if (state == AUTOHIDE_HIDDEN)
1928 {
1929 TRACE("AutoHide starting show.\n");
1932 }
1933 }
1934 else
1935 {
1936 if (state == AUTOHIDE_SHOWING)
1937 {
1938 TRACE("AutoHide cancelling show.\n");
1941 }
1942 else if (state == AUTOHIDE_SHOWN)
1943 {
1944 TRACE("AutoHide starting hide.\n");
1947 }
1948
1950 }
1951 }
1952
1954 {
1957
1958 switch (m_AutoHideState)
1959 {
1960 case AUTOHIDE_HIDING:
1961 switch (m_Position)
1962 {
1963 case ABE_LEFT:
1964 m_AutoHideOffset.cy = 0;
1966 if (m_AutoHideOffset.cx < -w)
1968 break;
1969 case ABE_TOP:
1970 m_AutoHideOffset.cx = 0;
1972 if (m_AutoHideOffset.cy < -h)
1974 break;
1975 case ABE_RIGHT:
1976 m_AutoHideOffset.cy = 0;
1978 if (m_AutoHideOffset.cx > w)
1980 break;
1981 case ABE_BOTTOM:
1982 m_AutoHideOffset.cx = 0;
1984 if (m_AutoHideOffset.cy > h)
1986 break;
1987 }
1988
1990 {
1992 break;
1993 }
1994
1995 /* fallthrough */
1996 case AUTOHIDE_HIDDEN:
1997
1998 switch (m_Position)
1999 {
2000 case ABE_LEFT:
2002 m_AutoHideOffset.cy = 0;
2003 break;
2004 case ABE_TOP:
2005 m_AutoHideOffset.cx = 0;
2007 break;
2008 case ABE_RIGHT:
2010 m_AutoHideOffset.cy = 0;
2011 break;
2012 case ABE_BOTTOM:
2013 m_AutoHideOffset.cx = 0;
2015 break;
2016 }
2017
2020 break;
2021
2022 case AUTOHIDE_SHOWING:
2024 {
2026 }
2028 {
2030 }
2031 else
2032 {
2033 m_AutoHideOffset.cx = 0;
2034 }
2035
2037 {
2039 }
2041 {
2043 }
2044 else
2045 {
2046 m_AutoHideOffset.cy = 0;
2047 }
2048
2049 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2050 {
2052 break;
2053 }
2054
2055 /* fallthrough */
2056 case AUTOHIDE_SHOWN:
2057
2060 break;
2061 }
2062
2064 }
2065
2066
2067
2068
2069
2070 /**********************************************************
2071 * ##### taskbar drawing #####
2072 */
2073
2075 {
2076 RECT rect;
2078
2080
2081 if (m_Theme)
2082 {
2084 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2085 }
2086
2087 return 0;
2088 }
2089
2091 {
2092 HDC hdc;
2093 RECT rect;
2095 SIZE size;
2096
2098
2101 return 0;
2102
2104 OffsetRect(&rect, -rect.left, -rect.top);
2105
2106 hdc = GetWindowDC();
2107
2108 switch (m_Position)
2109 {
2110 case ABE_LEFT:
2111 rect.left = rect.right - size.cx;
2112 break;
2113 case ABE_TOP:
2114 rect.top = rect.bottom - size.cy;
2115 break;
2116 case ABE_RIGHT:
2117 rect.right = rect.left + size.cx;
2118 break;
2119 case ABE_BOTTOM:
2120 default:
2121 rect.bottom = rect.top + size.cy;
2122 break;
2123 }
2124
2125 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2126
2127 ReleaseDC(hdc);
2128 return 0;
2129 }
2130
2131
2132
2133
2134
2135 /*
2136 * ITrayWindow
2137 */
2139 {
2140 RECT rcWnd;
2141
2142 /* Check if there's already a window created and try to show it.
2143 If it was somehow destroyed just create a new tray window. */
2144 if (m_hWnd != NULL && IsWindow())
2145 {
2146 return S_OK;
2147 }
2148
2151 dwExStyle |= WS_EX_TOPMOST;
2152
2154 if(!m_Theme)
2155 {
2156 dwStyle |= WS_THICKFRAME | WS_BORDER;
2157 }
2158
2159 ZeroMemory(&rcWnd, sizeof(rcWnd));
2160 if (m_Position != (DWORD) -1)
2161 rcWnd = m_TrayRects[m_Position];
2162
2163 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2164 return E_FAIL;
2165
2166 /* Align all controls on the tray window */
2168
2169 /* Move the tray window to the right position and resize it if necessary */
2171
2172 return S_OK;
2173 }
2174
2176 {
2177 if (m_hWnd != NULL)
2178 {
2181 0,
2182 0);
2183 }
2184
2185 return S_OK;
2186 }
2187
2189 {
2190 return m_hWnd;
2191 }
2192
2194 {
2195 return (m_hWnd == hWnd ||
2197 }
2198
2200 {
2201 return IsPosHorizontal();
2202 }
2203
2205 {
2206 BOOL bPrevLock = g_TaskbarSettings.bLock;
2207
2208 if (g_TaskbarSettings.bLock != bLock)
2209 {
2210 g_TaskbarSettings.bLock = bLock;
2211
2212 if (m_TrayBandSite != NULL)
2213 {
2214 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2215 {
2216 /* Reset?? */
2217 g_TaskbarSettings.bLock = bPrevLock;
2218 return bPrevLock;
2219 }
2220 }
2221
2222 if (m_Theme)
2223 {
2224 /* Update cached tray sizes */
2225 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2226 {
2227 RECT rcGripper = {0};
2228 AdjustSizerRect(&rcGripper, Pos);
2229
2231 {
2232 m_TrayRects[Pos].top += rcGripper.top;
2233 m_TrayRects[Pos].left += rcGripper.left;
2234 m_TrayRects[Pos].bottom += rcGripper.bottom;
2235 m_TrayRects[Pos].right += rcGripper.right;
2236 }
2237 else
2238 {
2239 m_TrayRects[Pos].top -= rcGripper.top;
2240 m_TrayRects[Pos].left -= rcGripper.left;
2241 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2242 m_TrayRects[Pos].right -= rcGripper.right;
2243 }
2244 }
2245 }
2249 }
2250
2251 return bPrevLock;
2252 }
2253
2254 /* The task window is visible and non-WS_EX_TOOLWINDOW and
2255 { has WS_EX_APPWINDOW style or has no owner } and is none of explorer's
2256 special windows (such as the desktop or the tray window) */
2258 {
2260 {
2262 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2263 !(exStyle & WS_EX_TOOLWINDOW))
2264 {
2265 return TRUE;
2266 }
2267 }
2268 return FALSE;
2269 }
2270
2271 /*
2272 * IContextMenu
2273 */
2275 UINT indexMenu,
2276 UINT idCmdFirst,
2277 UINT idCmdLast,
2278 UINT uFlags)
2279 {
2280 if (!m_ContextMenu)
2281 {
2284 return hr;
2285 }
2286
2287 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2288 }
2289
2291 {
2292 if (!m_ContextMenu)
2293 return E_INVALIDARG;
2294
2295 return m_ContextMenu->InvokeCommand(lpici);
2296 }
2297
2299 UINT uType,
2300 UINT *pwReserved,
2301 LPSTR pszName,
2302 UINT cchMax)
2303 {
2304 if (!m_ContextMenu)
2305 return E_INVALIDARG;
2306
2307 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2308 }
2309
2310 /**********************************************************
2311 * ##### message handling #####
2312 */
2313
2315 {
2316 HRESULT hRet;
2317
2318 ((ITrayWindow*)this)->AddRef();
2319
2320 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2321
2322 /* Create the Start button */
2324
2325 /* Load the saved tray window settings */
2327
2328 /* Create and initialize the start menu */
2332
2333 /* Create the task band */
2335 if (FAILED_UNEXPECTEDLY(hRet))
2336 return FALSE;
2337
2338 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2340 if (FAILED_UNEXPECTEDLY(hRet))
2341 return FALSE;
2342
2343 /* Create the tray notification window */
2345 if (FAILED_UNEXPECTEDLY(hRet))
2346 return FALSE;
2347
2348 /* Get the hwnd of the rebar */
2350 if (FAILED_UNEXPECTEDLY(hRet))
2351 return FALSE;
2352
2353 /* Get the hwnd of the tasks toolbar */
2355 if (FAILED_UNEXPECTEDLY(hRet))
2356 return FALSE;
2357
2358 /* Get the hwnd of the tray notification window */
2360 if (FAILED_UNEXPECTEDLY(hRet))
2361 return FALSE;
2362
2365 return FALSE;
2366
2367 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2368
2369 UpdateFonts();
2370
2372
2374 {
2377 }
2378
2379 /* Set the initial lock state in the band site */
2381
2382 static const UINT winkeys[] =
2383 {
2396 };
2398 {
2399 for (UINT i = 0; i < _countof(winkeys); ++i)
2400 {
2401 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2402 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2403 }
2404 }
2405
2406 return TRUE;
2407 }
2408
2409#define TIMER_ID_IGNOREPULSERESET 888
2410#define TIMER_IGNOREPULSERESET_TIMEOUT 200
2411
2413 {
2415 return 0;
2416 }
2417
2419 {
2420 if (wParam)
2421 SaveState();
2422 return 0;
2423 }
2424
2426 {
2427 if (m_Theme)
2429
2430 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2431
2432 if (m_Theme)
2433 {
2435 }
2436 else
2437 {
2439 }
2441
2442 return TRUE;
2443 }
2444
2446 {
2447 if (wParam == SPI_SETNONCLIENTMETRICS)
2448 {
2451 UpdateFonts();
2454 }
2455
2456 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2457 if (m_DesktopWnd)
2459
2460 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2461 {
2462 HideStartMenu();
2463
2465#if 1 // FIXME: Please re-use the start menu
2466 /* Re-create the start menu */
2470 FIXME("Use UpdateStartMenu\n");
2471#else
2472 // Update the start menu
2474#endif
2475 }
2476
2477 return 0;
2478 }
2479
2481 {
2482 HDC hdc = (HDC) wParam;
2483
2484 if (!m_Theme)
2485 {
2486 bHandled = FALSE;
2487 return 0;
2488 }
2489
2491 }
2492
2494 {
2495 /* Refresh workareas */
2497
2498 /* Load the saved tray window settings */
2500
2501 /* Move the tray window to the right position and resize it if necessary */
2503
2504 return TRUE;
2505 }
2506
2508 {
2510 if (!pCopyData)
2511 return FALSE;
2512
2513 switch (pCopyData->dwData)
2514 {
2515 case TABDMC_APPBAR:
2516 return OnAppBarMessage(pCopyData);
2517 case TABDMC_NOTIFY:
2518 case TABDMC_LOADINPROC:
2519 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2520 }
2521 return FALSE;
2522 }
2523
2524 // We have to draw non-client area because the 'Show Desktop' button is beyond client area.
2526 {
2527 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2528 return;
2530 }
2531
2533 {
2534 DefWindowProc(uMsg, wParam, lParam);
2535 bHandled = TRUE;
2536
2538 {
2539 DrawShowDesktopButton(); // We have to draw non-client area
2540 return 0;
2541 }
2542
2543 DrawSizerWithTheme((HRGN) wParam);
2544 DrawShowDesktopButton(); // We have to draw non-client area
2545 return 0;
2546 }
2547
2549 {
2552 }
2553
2555 {
2556 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2557 }
2558
2560 {
2561 RECT rcClient;
2562 POINT pt;
2563
2565 {
2566 /* The user may not be able to resize the tray window.
2567 Pretend like the window is not sizeable when the user
2568 clicks on the border. */
2569 return HTBORDER;
2570 }
2571
2573 if (GetClientRect(&rcClient) &&
2574 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2575 {
2576 pt.x = GET_X_LPARAM(lParam);
2577 pt.y = GET_Y_LPARAM(lParam);
2578
2580 return HTBORDER;
2581
2582 if (PtInRect(&rcClient, pt))
2583 {
2584 /* The user is trying to drag the tray window */
2585 return HTCAPTION;
2586 }
2587
2588 /* Depending on the position of the tray window, allow only
2589 changing the border next to the monitor working area */
2590 switch (m_Position)
2591 {
2592 case ABE_TOP:
2593 if (pt.y > rcClient.bottom)
2594 return HTBOTTOM;
2595 break;
2596 case ABE_LEFT:
2597 if (pt.x > rcClient.right)
2598 return HTRIGHT;
2599 break;
2600 case ABE_RIGHT:
2601 if (pt.x < rcClient.left)
2602 return HTLEFT;
2603 break;
2604 case ABE_BOTTOM:
2605 default:
2606 if (pt.y < rcClient.top)
2607 return HTTOP;
2608 break;
2609 }
2610 }
2611 return HTBORDER;
2612 }
2613
2615 {
2616 POINT ptCursor;
2617 PRECT pRect = (PRECT) lParam;
2618
2619 /* We need to ensure that an application can not accidently
2620 move the tray window (using SetWindowPos). However, we still
2621 need to be able to move the window in case the user wants to
2622 drag the tray window to another position or in case the user
2623 wants to resize the tray window. */
2624 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2625 {
2626 IsDragging = TRUE;
2628 }
2629 else
2630 {
2631 *pRect = m_TrayRects[m_Position];
2632 }
2633 return TRUE;
2634 }
2635
2637 {
2638 PRECT pRect = (PRECT) lParam;
2639
2641 {
2642 FitToRebar(pRect);
2643 }
2644 else
2645 {
2646 *pRect = m_TrayRects[m_Position];
2647 }
2648 return TRUE;
2649 }
2650
2652 {
2654 return TRUE;
2655 }
2656
2658 {
2659 RECT rcClient;
2660 if (wParam == SIZE_RESTORED && lParam == 0)
2661 {
2663 /* Clip the tray window on multi monitor systems so the edges can't
2664 overlap into another monitor */
2666
2667 if (!GetClientRect(&rcClient))
2668 {
2669 return FALSE;
2670 }
2671 }
2672 else
2673 {
2674 rcClient.left = rcClient.top = 0;
2675 rcClient.right = LOWORD(lParam);
2676 rcClient.bottom = HIWORD(lParam);
2677 }
2678
2679 AlignControls(&rcClient);
2680 return TRUE;
2681 }
2682
2684 {
2685 InSizeMove = TRUE;
2686 IsDragging = FALSE;
2688 {
2689 /* Remove the clipping on multi monitor systems while dragging around */
2691 }
2692 return TRUE;
2693 }
2694
2696 {
2697 InSizeMove = FALSE;
2699 {
2701
2702 /* Apply clipping */
2704 }
2705 return TRUE;
2706 }
2707
2709 {
2710 switch (wParam)
2711 {
2712 case TEXT(' '):
2713 {
2714 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2715 The tray window needs to handle this specially, since it normally doesn't have
2716 a system menu. */
2717
2718 static const UINT uidDisableItem [] = {
2719 SC_RESTORE,
2720 SC_MOVE,
2721 SC_SIZE,
2724 };
2725 HMENU hSysMenu;
2726 UINT i, uId;
2727
2728 /* temporarily enable the system menu */
2730
2731 hSysMenu = GetSystemMenu(FALSE);
2732 if (hSysMenu != NULL)
2733 {
2734 /* Disable all items that are not relevant */
2735 for (i = 0; i < _countof(uidDisableItem); i++)
2736 {
2737 EnableMenuItem(hSysMenu,
2738 uidDisableItem[i],
2740 }
2741
2742 EnableMenuItem(hSysMenu,
2743 SC_CLOSE,
2744 MF_BYCOMMAND |
2746
2747 /* Display the system menu */
2748 uId = TrackMenu(
2749 hSysMenu,
2750 NULL,
2753 FALSE);
2754 if (uId != 0)
2755 {
2757 }
2758 }
2759
2760 /* revert the system menu window style */
2762 break;
2763 }
2764
2765 default:
2766 bHandled = FALSE;
2767 }
2768 return TRUE;
2769 }
2770
2772 {
2773 if (!ppt || !prcStartBtn || !pwi)
2774 return FALSE;
2775
2776 switch (m_Position)
2777 {
2778 case ABE_TOP:
2779 case ABE_LEFT:
2780 {
2781 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2782 return FALSE;
2783 break;
2784 }
2785 case ABE_RIGHT:
2786 {
2787 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2788 return FALSE;
2789
2790 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2791 ppt->x > prcStartBtn->right)
2792 {
2793 return FALSE;
2794 }
2795 break;
2796 }
2797 case ABE_BOTTOM:
2798 {
2799 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2800 return FALSE;
2801
2802 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2803 ppt->y > prcStartBtn->bottom)
2804 {
2805 return FALSE;
2806 }
2807
2808 break;
2809 }
2810 }
2811 return TRUE;
2812 }
2813
2815 {
2816 if (!ppt || !prcShowDesktopBtn)
2817 return FALSE;
2819
2820 switch (m_Position)
2821 {
2822 case ABE_LEFT:
2823 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2824 case ABE_TOP:
2825 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2826 case ABE_RIGHT:
2827 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2828 case ABE_BOTTOM:
2829 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2830 }
2831 return FALSE;
2832 }
2833
2839 {
2841 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2842
2843 bHandled = FALSE;
2844
2845 RECT rcStartBtn;
2846 m_StartButton.GetWindowRect(&rcStartBtn);
2847 GetWindowInfo(m_hWnd, &wi);
2848
2849 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2850 {
2851 bHandled = TRUE;
2853 return 0;
2854 }
2855
2858
2859 return 0;
2860 }
2861
2863 {
2864 /* We want the user to be able to get a context menu even on the nonclient
2865 area (including the sizing border)! */
2866 uMsg = WM_CONTEXTMENU;
2867 wParam = (WPARAM) m_hWnd;
2868
2869 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2870 }
2871
2873 {
2874 LRESULT Ret = FALSE;
2875 POINT pt, *ppt = NULL;
2876 HWND hWndExclude = NULL;
2877
2878 /* Check if the administrator has forbidden access to context menus */
2880 return FALSE;
2881
2882 pt.x = (SHORT) LOWORD(lParam);
2883 pt.y = (SHORT) HIWORD(lParam);
2884
2885 if (pt.x != -1 || pt.y != -1)
2886 ppt = &pt;
2887 else
2888 hWndExclude = m_StartButton.m_hWnd;
2889
2891 {
2892 /* Make sure we can't track the context menu if the start
2893 menu is currently being shown */
2895 {
2896 CComPtr<IContextMenu> ctxMenu;
2898 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2899 }
2900 }
2901 else
2902 {
2903 /* See if the context menu should be handled by the task band site */
2904 if (ppt != NULL && m_TrayBandSite != NULL)
2905 {
2906 HWND hWndAtPt;
2907 POINT ptClient = *ppt;
2908
2909 /* Convert the coordinates to client-coordinates */
2910 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2911
2912 hWndAtPt = ChildWindowFromPoint(ptClient);
2913 if (hWndAtPt != NULL &&
2914 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2915 {
2916 /* Check if the user clicked on the task switch window */
2917 ptClient = *ppt;
2918 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2919
2921 if (hWndAtPt == m_TaskSwitch)
2922 goto HandleTrayContextMenu;
2923
2924 /* Forward the message to the task band site */
2925 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2926 }
2927 else
2928 goto HandleTrayContextMenu;
2929 }
2930 else
2931 {
2932HandleTrayContextMenu:
2933 /* Tray the default tray window context menu */
2934 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2935 }
2936 }
2937 return Ret;
2938 }
2939
2941 {
2942 LRESULT Ret = FALSE;
2943 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
2944 the rebar control! But we shouldn't forward messages that the band
2945 site doesn't handle, such as other controls (start button, tray window) */
2946
2947 HRESULT hr = E_FAIL;
2948
2949 if (m_TrayBandSite)
2950 {
2951 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2952 if (SUCCEEDED(hr))
2953 return Ret;
2954 }
2955
2956 if (m_TrayBandSite == NULL || FAILED(hr))
2957 {
2958 const NMHDR *nmh = (const NMHDR *) lParam;
2959
2960 if (nmh->hwndFrom == m_TrayNotify)
2961 {
2962 switch (nmh->code)
2963 {
2964 case NTNWM_REALIGN:
2965 /* Cause all controls to be aligned */
2967 break;
2968 }
2969 }
2970 }
2971 return Ret;
2972 }
2973
2975 {
2976 /* Let the clock handle the double-click */
2978
2979 /* We "handle" this message so users can't cause a weird maximize/restore
2980 window animation when double-clicking the tray window! */
2981 return TRUE;
2982 }
2983
2985 {
2986 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
2987 {
2990 bHandled = TRUE;
2991 }
2992
2993 return FALSE;
2994 }
2995
2997 {
2999 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
3000 return FALSE;
3001 }
3002
3004 {
3005 DestroyWindow();
3006 return TRUE;
3007 }
3008
3010 {
3011 HWND hwndStartMenu;
3012 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3014 return FALSE;
3015
3016 if (::IsWindowVisible(hwndStartMenu))
3017 HideStartMenu();
3018 else
3020
3021 return TRUE;
3022 }
3023
3025 {
3026 /*
3027 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3028 * to show the shutdown dialog. Also a WM_CLOSE message sent
3029 * by apps should show the dialog.
3030 */
3031 return DoExitWindows();
3032 }
3033
3035 {
3036 if (wParam == SC_CLOSE)
3037 {
3038 return DoExitWindows();
3039 }
3040
3041 bHandled = FALSE;
3042 return TRUE;
3043 }
3044
3046 {
3047 bHandled = TRUE;
3048 return (LRESULT)m_TaskSwitch;
3049 }
3050
3051 void RestoreMinimizedNonTaskWnds(BOOL bDestroyed, HWND hwndActive)
3052 {
3053 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3054 {
3055 HWND hwnd = g_MinimizedAll[i].hwnd;
3056 if (!hwnd || hwndActive == hwnd)
3057 continue;
3058
3061 {
3062 ::SetWindowPlacement(hwnd, &g_MinimizedAll[i].wndpl); // Restore
3063 }
3064 }
3065
3066 if (bDestroyed)
3068 else
3069 ::SetForegroundWindow(hwndActive);
3070 }
3071
3073 {
3074 if (IgnorePulse)
3075 return 0;
3076
3078 IgnorePulse = TRUE;
3081 return 0;
3082 }
3083
3085 {
3086 return HandleHotKey(wParam);
3087 }
3088
3090 {
3096 };
3097
3099 {
3100 WCHAR szClass[32];
3101 GetClassNameW(hwnd, szClass, _countof(szClass));
3102 return wcscmp(szClass, L"#32770") == 0;
3103 }
3104
3106 {
3108 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3109 return TRUE; // Ignore special windows
3110
3111 if (!info->bShowDesktop)
3112 {
3114 return TRUE;
3115 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3116 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3117 return TRUE;
3118 }
3119
3120 if (CanBeMinimized(hwnd))
3121 {
3122 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3123 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3125 {
3126 info->pMinimizedAll->Add(mwp);
3127 }
3128 }
3129
3130 return TRUE;
3131 }
3132
3133 VOID MinimizeAll(BOOL bShowDesktop = FALSE)
3134 {
3135 IgnorePulse = TRUE;
3137
3139 info.hwndDesktop = GetDesktopWindow();;
3140 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3141 info.hwndProgman = FindWindowW(L"Progman", NULL);
3142 info.pMinimizedAll = &g_MinimizedAll;
3143 info.bShowDesktop = bShowDesktop;
3145
3149 }
3150
3152 {
3154 }
3155
3157 {
3158 IgnorePulse = TRUE;
3160
3161 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3162 {
3163 HWND hwnd = g_MinimizedAll[i].hwnd;
3166 }
3167
3170 }
3171
3173 {
3174 LRESULT Ret = FALSE;
3175
3177 {
3178 return FALSE;
3179 }
3180
3181 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3182 {
3183 return HandleCommand(LOWORD(wParam));
3184 }
3185 return Ret;
3186 }
3187
3189 {
3191
3193 {
3195 }
3196
3197 return TRUE;
3198 }
3199
3201 {
3203 {
3205 }
3206 else if (wParam == TIMER_ID_AUTOHIDE)
3207 {
3209 }
3211 {
3214 }
3215 return 0;
3216 }
3217
3219 {
3221 DrawShowDesktopButton(); // We have to draw non-client area
3222 bHandled = TRUE;
3223 return ret;
3224 }
3225
3227 {
3228 RECT *rc = NULL;
3229 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3231 {
3232 bHandled = FALSE;
3233 return 0;
3234 }
3235 if(!wParam)
3236 {
3237 rc = (RECT*)wParam;
3238 }
3239 else
3240 {
3242 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3243 {
3244 bHandled = FALSE;
3245 return 0;
3246 }
3247 rc = &prms->rgrc[0];
3248 }
3249
3251
3252 return 0;
3253 }
3254
3256 {
3257 HMENU hMenu = (HMENU)wParam;
3259 {
3263 if (g_Arrangement != NONE)
3264 {
3267 MENUITEMINFOW mii = { sizeof(mii) };
3269 mii.fMask = MIIM_TYPE;
3270 mii.fType = MFT_STRING;
3271 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3273 }
3274 else
3275 {
3277 }
3278 }
3279 else
3280 {
3286 g_WindowPosBackup.RemoveAll();
3287 }
3288 return 0;
3289 }
3290
3292 {
3293#if 0
3294 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3295
3296 if (!as->fChanged)
3297 return 0;
3298
3299 RECT rc;
3300 ::GetWindowRect(m_hWnd, &rc);
3301
3302 SIZE szWindow = {
3303 rc.right - rc.left,
3304 rc.bottom - rc.top };
3305 SIZE szTarget = {
3306 as->rcTarget.right - as->rcTarget.left,
3307 as->rcTarget.bottom - as->rcTarget.top };
3308 SIZE szActual = {
3309 as->rcActual.right - as->rcActual.left,
3310 as->rcActual.bottom - as->rcActual.top };
3311
3312 SIZE borders = {
3313 szWindow.cx - szTarget.cx,
3314 szWindow.cy - szTarget.cx,
3315 };
3316
3317 switch (m_Position)
3318 {
3319 case ABE_LEFT:
3320 szWindow.cx = szActual.cx + borders.cx;
3321 break;
3322 case ABE_TOP:
3323 szWindow.cy = szActual.cy + borders.cy;
3324 break;
3325 case ABE_RIGHT:
3326 szWindow.cx = szActual.cx + borders.cx;
3327 rc.left = rc.right - szWindow.cy;
3328 break;
3329 case ABE_BOTTOM:
3330 szWindow.cy = szActual.cy + borders.cy;
3331 rc.top = rc.bottom - szWindow.cy;
3332 break;
3333 }
3334
3335 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3336#else
3337 bHandled = FALSE;
3338#endif
3339 return 0;
3340 }
3341
3343 {
3344 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3345
3346 /* Propagate the new settings to the children */
3349
3350 /* Toggle autohide */
3351 if (newSettings->sr.AutoHide != g_TaskbarSettings.sr.AutoHide)
3352 {
3353 g_TaskbarSettings.sr.AutoHide = newSettings->sr.AutoHide;
3356 if (!newSettings->sr.AutoHide)
3358 else
3360 }
3361
3362 /* Toggle lock state */
3363 Lock(newSettings->bLock);
3364
3365 /* Toggle OnTop state */
3366 if (newSettings->sr.AlwaysOnTop != g_TaskbarSettings.sr.AlwaysOnTop)
3367 {
3369 HWND hWndInsertAfter = newSettings->sr.AlwaysOnTop ? HWND_TOPMOST : HWND_BOTTOM;
3370 SetWindowPos(hWndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
3371 }
3372
3373 /* Adjust taskbar size */
3375
3377 return 0;
3378 }
3379
3381
3384 {
3385 MSG Msg;
3386 LRESULT lRet;
3387
3388 Msg.hwnd = m_hWnd;
3389 Msg.message = uMsg;
3390 Msg.wParam = wParam;
3391 Msg.lParam = lParam;
3392
3393 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3394 {
3395 return lRet;
3396 }
3397
3398 wParam = Msg.wParam;
3399 lParam = Msg.lParam;
3400 }
3401 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
3403 NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnRebarAutoSize) // Doesn't quite work ;P
3415 MESSAGE_HANDLER(WM_DISPLAYCHANGE, OnDisplayChange)
3444 ALT_MSG_MAP(1)
3445 END_MSG_MAP()
3446
3447 /*****************************************************************************/
3448
3450 {
3451 MSG Msg;
3452
3453 /* FIXME: We should keep a reference here... */
3454
3455 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3456 {
3457 if (Msg.message == WM_QUIT)
3458 break;
3459
3460 if (m_StartMenuBand == NULL ||
3461 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3462 {
3465 }
3466 }
3467 }
3468
3470 {
3471 MSG Msg;
3472 BOOL Ret;
3473
3474 /* FIXME: We should keep a reference here... */
3475
3476 while (true)
3477 {
3478 Ret = GetMessage(&Msg, NULL, 0, 0);
3479
3480 if (!Ret || Ret == -1)
3481 break;
3482
3483 if (m_StartMenuBand == NULL ||
3484 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3485 {
3488 }
3489 }
3490 }
3491
3492 /*
3493 * IShellDesktopTray
3494 *
3495 * NOTE: this is a very windows-specific COM interface used by SHCreateDesktop()!
3496 * These are the calls I observed, it may be wrong/incomplete/buggy!!!
3497 * The reason we implement it is because we have to use SHCreateDesktop() so
3498 * that the shell provides the desktop window and all the features that come
3499 * with it (especially positioning of desktop icons)
3500 */
3501
3503 GetState() override
3504 {
3505 /* FIXME: Return ABS_ flags? */
3506 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3507 return 0;
3508 }
3509
3511 GetTrayWindow(OUT HWND *phWndTray) override
3512 {
3513 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3514 *phWndTray = m_hWnd;
3515 return S_OK;
3516 }
3517
3519 RegisterDesktopWindow(IN HWND hWndDesktop) override
3520 {
3521 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3522
3523 m_DesktopWnd = hWndDesktop;
3524 return S_OK;
3525 }
3526
3528 Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
3529 {
3530 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3531 return S_OK;
3532 }
3533
3535 {
3536 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3537 return S_OK;
3538 }
3539
3540 // *** IOleWindow methods ***
3541
3543 GetWindow(HWND* phwnd) override
3544 {
3545 if (!phwnd)
3546 return E_INVALIDARG;
3547 *phwnd = m_hWnd;
3548 return S_OK;
3549 }
3550
3552 ContextSensitiveHelp(BOOL fEnterMode) override
3553 {
3554 return E_NOTIMPL;
3555 }
3556
3557 void _Init()
3558 {
3559 m_Position = (DWORD) -1;
3560 }
3561
3563
3566 /*COM_INTERFACE_ENTRY_IID(IID_ITrayWindow, ITrayWindow)*/
3569 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3570 END_COM_MAP()
3571
3572protected:
3574 // AppBar section
3575 //
3576 // See also: appbar.cpp
3577 // TODO: freedesktop _NET_WM_STRUT integration
3578 // TODO: find when a fullscreen app is in the foreground and send FULLSCREENAPP notifications
3579 // TODO: detect changes in the screen size and send ABN_POSCHANGED ?
3580 // TODO: multiple monitor support
3581
3582 BOOL IsAutoHideState() const override { return g_TaskbarSettings.sr.AutoHide; }
3583 BOOL IsHidingState() const override { return m_AutoHideState == AUTOHIDE_HIDING; }
3584 HMONITOR GetMonitor() const override { return m_Monitor; }
3585 HMONITOR GetPreviousMonitor() const override { return m_PreviousMonitor; }
3586 INT GetPosition() const override { return m_Position; }
3587 const RECT* GetTrayRect() override { return &m_TrayRects[m_Position]; }
3588 HWND GetDesktopWnd() const override { return m_DesktopWnd; }
3589};
3590
3592 public CComCoClass<CTrayWindowCtxMenu>,
3593 public CComObjectRootEx<CComMultiThreadModelNoCS>,
3594 public IContextMenu
3595{
3600
3601public:
3602 HRESULT Initialize(ITrayWindow * pTrayWnd, IN HWND hWndOwner)
3603 {
3604 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3605 this->hWndOwner = hWndOwner;
3606 this->m_idCmdCmFirst = 0;
3607 return S_OK;
3608 }
3609
3612 UINT indexMenu,
3613 UINT idCmdFirst,
3614 UINT idCmdLast,
3615 UINT uFlags) override
3616 {
3617 HMENU hMenuBase;
3618
3620 if (!hMenuBase)
3622
3624 {
3626 MENUITEMINFOW mii = { sizeof(mii) };
3627 mii.fMask = MIIM_ID | MIIM_TYPE;
3629 mii.fType = MFT_STRING;
3630 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3632 }
3633
3635 {
3636 DeleteMenu(hPopup,
3638 MF_BYCOMMAND);
3639 }
3640
3641 CheckMenuItem(hMenuBase,
3644
3645 UINT idCmdNext;
3646 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3647 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3648
3649 ::DestroyMenu(hMenuBase);
3650
3651 if (TrayWnd->m_TrayBandSite != NULL)
3652 {
3653 pcm.Release();
3654 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3655 hPopup,
3656 indexMenu,
3657 idCmdNext,
3658 idCmdLast,
3659 CMF_NORMAL,
3660 &pcm)))
3661 {
3662 WARN("AddContextMenus failed.\n");
3663 pcm.Release();
3664 }
3665 }
3666
3667 return S_OK;
3668 }
3669
3672 {
3673 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3674 if (uiCmdId != 0)
3675 {
3676 if (uiCmdId >= m_idCmdCmFirst)
3677 {
3678 CMINVOKECOMMANDINFO cmici = { 0 };
3679
3680 if (pcm != NULL)
3681 {
3682 /* Setup and invoke the shell command */
3683 cmici.cbSize = sizeof(cmici);
3684 cmici.hwnd = hWndOwner;
3685 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3686 cmici.nShow = SW_NORMAL;
3687
3688 pcm->InvokeCommand(&cmici);
3689 }
3690 }
3691 else
3692 {
3693 TrayWnd->ExecContextMenuCmd(uiCmdId);
3694 }
3695 }
3696
3697 return S_OK;
3698 }
3699
3702 UINT_PTR idCmd,
3703 UINT uType,
3704 UINT *pwReserved,
3705 LPSTR pszName,
3706 UINT cchMax) override
3707 {
3708 return E_NOTIMPL;
3709 }
3710
3712 {
3713 }
3714
3716 {
3717 }
3718
3720 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
3721 END_COM_MAP()
3722};
3723
3724HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu)
3725{
3727 mnu->Initialize(TrayWnd, hWndOwner);
3728 *ppCtxMenu = mnu;
3729 return S_OK;
3730}
3731
3732HRESULT CreateTrayWindow(ITrayWindow ** ppTray)
3733{
3735 if (Tray == NULL)
3736 return E_OUTOFMEMORY;
3737
3738 Tray->_Init();
3739 Tray->Open();
3740
3741 *ppTray = (ITrayWindow *) Tray;
3742
3743 return S_OK;
3744}
3745
3746HRESULT
3748{
3749 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3750 return TrayWindow->RaiseStartButton();
3751}
3752
3753VOID TrayProcessMessages(ITrayWindow *Tray)
3754{
3755 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3756 TrayWindow->TrayProcessMessages();
3757}
3758
3759VOID TrayMessageLoop(ITrayWindow *Tray)
3760{
3761 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3762 TrayWindow->TrayMessageLoop();
3763}
@ TS_TRUE
std::map< E_MODULE, HMODULE > mod
Definition: LocaleTests.cpp:66
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:23
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
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
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:395
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:378
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
#define TWM_PULSE
Definition: precomp.h:135
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:380
#define NTNWM_REALIGN
Definition: precomp.h:382
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 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
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
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 OnAppBarNotifyAll(_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
Definition: appbar.cpp:206
void RecomputeAllWorkareas()
Definition: appbar.cpp:448
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:469
HIMAGELIST m_ImageList
Definition: traywnd.cpp:181
VOID Initialize()
Definition: traywnd.cpp:240
VOID UpdateFont()
Definition: traywnd.cpp:224
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:291
SIZE GetSize()
Definition: traywnd.cpp:203
VOID UpdateSize()
Definition: traywnd.cpp:208
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:260
HFONT m_Font
Definition: traywnd.cpp:183
virtual ~CStartButton()
Definition: traywnd.cpp:194
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:3602
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
Definition: traywnd.cpp:3671
STDMETHODIMP QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition: traywnd.cpp:3611
virtual ~CTrayWindowCtxMenu()
Definition: traywnd.cpp:3715
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3597
STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
Definition: traywnd.cpp:3701
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3598
LRESULT OnHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3084
LRESULT OnEnterSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2683
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:615
DWORD m_DraggingPosition
Definition: traywnd.cpp:338
LRESULT OnSettingChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2445
HWND m_TaskSwitch
Definition: traywnd.cpp:330
LRESULT OnSysColorChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2554
VOID ResizeWorkArea()
Definition: traywnd.cpp:1524
VOID ToggleDesktop()
Definition: traywnd.cpp:625
DWORD Flags
Definition: traywnd.cpp:358
BOOL IsHidingState() const override
Definition: traywnd.cpp:3583
LRESULT OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2695
LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2425
HWND m_Rebar
Definition: traywnd.cpp:329
VOID ShowDesktop()
Definition: traywnd.cpp:3151
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2532
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3342
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1273
HMONITOR m_Monitor
Definition: traywnd.cpp:336
DWORD IgnorePulse
Definition: traywnd.cpp:365
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3188
CStartButton m_StartButton
Definition: traywnd.cpp:316
LRESULT OnDoExitWindows(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3024
HWND STDMETHODCALLTYPE GetHWND()
Definition: traywnd.cpp:2188
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1820
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:776
VOID RestoreAll()
Definition: traywnd.cpp:3156
LRESULT OnCtlColorBtn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2548
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:354
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2090
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1046
DWORD m_Position
Definition: traywnd.cpp:335
const RECT * GetTrayRect() override
Definition: traywnd.cpp:3587
HTHEME m_Theme
Definition: traywnd.cpp:324
BOOL STDMETHODCALLTYPE IsHorizontal()
Definition: traywnd.cpp:2199
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:349
HMONITOR GetPreviousMonitor() const override
Definition: traywnd.cpp:3585
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:3255
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2480
DWORD WINAPI TrayPropertiesThread()
Definition: traywnd.cpp:542
SIZE m_TraySize
Definition: traywnd.cpp:342
LRESULT OnNcCalcSize(INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3226
void RestoreMinimizedNonTaskWnds(BOOL bDestroyed, HWND hwndActive)
Definition: traywnd.cpp:3051
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1098
DWORD InSizeMove
Definition: traywnd.cpp:362
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2940
RECT m_TrayRects[4]
Definition: traywnd.cpp:341
LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2507
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:519
GetState() override
Definition: traywnd.cpp:3503
VOID RegLoadSettings()
Definition: traywnd.cpp:1598
LRESULT OnNcRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2862
VOID TrayProcessMessages()
Definition: traywnd.cpp:3449
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:339
HRESULT STDMETHODCALLTYPE GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: traywnd.cpp:2298
LRESULT OnEndSession(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2418
BOOL STDMETHODCALLTYPE IsTaskWnd(HWND hWnd)
Definition: traywnd.cpp:2257
BOOL IsPointWithinShowDesktopButton(LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2814
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1211
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2074
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:320
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:578
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1136
STDMETHODIMP GetTrayWindow(OUT HWND *phWndTray) override
Definition: traywnd.cpp:3511
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1216
void ProcessMouseTracking()
Definition: traywnd.cpp:1903
INT GetPosition() const override
Definition: traywnd.cpp:3586
LRESULT OnNcLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2974
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2838
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2412
BOOL STDMETHODCALLTYPE Lock(IN BOOL bLock)
Definition: traywnd.cpp:2204
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1487
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2872
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3105
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3582
HRESULT STDMETHODCALLTYPE Open()
Definition: traywnd.cpp:2138
LRESULT OnGetTaskSwitch(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3045
LRESULT OnSysChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2708
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3200
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:428
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:571
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:597
DWORD IsDragging
Definition: traywnd.cpp:363
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3098
HRESULT STDMETHODCALLTYPE Close()
Definition: traywnd.cpp:2175
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1576
LRESULT OnNcLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2984
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3034
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:2614
void PopupStartMenu()
Definition: traywnd.cpp:1862
void UpdateFonts()
Definition: traywnd.cpp:1015
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:730
STDMETHODIMP RegisterDesktopWindow(IN HWND hWndDesktop) override
Definition: traywnd.cpp:3519
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2636
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:317
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1676
LRESULT OnOpenStartMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3009
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:344
void DrawShowDesktopButton()
Definition: traywnd.cpp:2525
SIZE m_AutoHideOffset
Definition: traywnd.cpp:348
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2657
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3172
LRESULT OnAppTrayDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3003
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1165
HRESULT STDMETHODCALLTYPE InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: traywnd.cpp:2290
STDMETHODIMP Unknown(IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
Definition: traywnd.cpp:3528
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: traywnd.cpp:3552
VOID HideStartMenu()
Definition: traywnd.cpp:725
VOID TrayMessageLoop()
Definition: traywnd.cpp:3469
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1375
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2193
virtual ~CTrayWindow()
Definition: traywnd.cpp:397
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:345
HWND GetDesktopWnd() const override
Definition: traywnd.cpp:3588
LRESULT OnPulse(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3072
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2559
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3133
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3543
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1190
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2996
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3534
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1073
LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:3218
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:864
DWORD WINAPI RunFileDlgThread()
Definition: traywnd.cpp:483
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2314
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:935
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2493
void _Init()
Definition: traywnd.cpp:3557
LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2651
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2771
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:319
HFONT m_Font
Definition: traywnd.cpp:326
LRESULT DoExitWindows()
Definition: traywnd.cpp:463
void ProcessAutoHide()
Definition: traywnd.cpp:1953
HMONITOR GetMonitor() const override
Definition: traywnd.cpp:3584
HWND m_DesktopWnd
Definition: traywnd.cpp:328
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1393
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:323
void SaveState()
Definition: traywnd.cpp:452
HRESULT STDMETHODCALLTYPE QueryContextMenu(HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: traywnd.cpp:2274
LRESULT OnRebarAutoSize(INT code, LPNMHDR nmhdr, BOOL &bHandled)
Definition: traywnd.cpp:3291
BOOL STDMETHODCALLTYPE ExecContextMenuCmd(IN UINT uiCmd)
Definition: traywnd.cpp:637
void DisplayRunFileDlg()
Definition: traywnd.cpp:525
HWND m_TrayNotify
Definition: traywnd.cpp:331
WPARAM wParam
Definition: combotst.c:138
struct @1681 Msg[]
LPARAM lParam
Definition: combotst.c:139
wcscpy
static HWND hwndParent
Definition: cryptui.c:300
#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
#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
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:65
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:4262
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1534
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1597
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:399
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:1148
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
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
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:850
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:965
#define pt(x, y)
Definition: drawing.c:79
#define PtrToUlong(u)
Definition: config.h:107
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 UINT_MAX
Definition: intsafe.h:152
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define TEXT(s)
Definition: k32.h:26
#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 ASSERT(a)
Definition: mode.c:44
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static BOOL protected
Definition: protectdata.c:37
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HRGN hRgn
Definition: mapping.c:33
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static MONITORINFO mi
Definition: win.c:7338
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
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
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#define DWORD
Definition: nt_native.h:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IOleWindow
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_SYSMENU
Definition: pedump.c:629
#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
#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
#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
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
#define ABE_BOTTOM
Definition: shellapi.h:20
#define ShellExecute
Definition: shellapi.h:733
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_TOP
Definition: shellapi.h:18
#define ABE_LEFT
Definition: shellapi.h:17
#define ABN_WINDOWARRANGE
Definition: shellapi.h:76
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2468
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2529
HRESULT hr
Definition: shlfolder.c:183
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:1539
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2202
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2537
#define MM_ADDSEPARATOR
Definition: shlobj.h:2536
@ REST_CLASSICSHELL
Definition: shlobj.h:1688
@ REST_NOSAVESET
Definition: shlobj.h:1653
@ REST_NOWINKEYS
Definition: shlobj.h:1749
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1676
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1687
@ REST_NOCLOSE
Definition: shlobj.h:1652
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2528
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
CSimpleArray< MINWNDPOS > * pMinimizedAll
Definition: traywnd.cpp:3094
HWND hwndDesktop
Definition: traywnd.cpp:104
HWND hwndProgman
Definition: traywnd.cpp:105
BOOL bMustBeInMonitor
Definition: traywnd.cpp:107
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:168
HWND hwnd
Definition: traywnd.cpp:167
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:226
WINDOWPLACEMENT wplt
Definition: traywnd.cpp:50
Definition: dpa.c:49
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD AutoHide
Definition: precomp.h:205
DWORD AlwaysOnTop
Definition: precomp.h:206
DWORD SmSmallIcons
Definition: precomp.h:207
DWORD Position
Definition: precomp.h:211
UINT flags
Definition: winuser.h:3605
Definition: inflate.c:139
Definition: copy.c:22
ULONG_PTR dwData
Definition: winuser.h:3012
LPWSTR dwTypeData
Definition: winuser.h:3280
RECT rcMonitor
Definition: winuser.h:3796
DWORD cbSize
Definition: winuser.h:3795
PWINDOWPOS lppos
Definition: winuser.h:3610
UINT code
Definition: winuser.h:3170
HWND hwndFrom
Definition: winuser.h:3168
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
RECT rcExclude
Definition: winuser.h:3587
UINT cbSize
Definition: winuser.h:3586
UINT cxWindowBorders
Definition: winuser.h:3783
UINT cyWindowBorders
Definition: winuser.h:3784
RECT rcWindow
Definition: winuser.h:3778
static COORD Position
Definition: mouse.c:34
#define max(a, b)
Definition: svc.c:63
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:20
const GUID IID_IShellDesktopTray
Definition: traywnd.cpp:176
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:39
#define AUTOHIDE_SHOWN
Definition: traywnd.cpp:29
static BOOL CALLBACK BackupWindowsPosProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:54
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:52
VOID TrayProcessMessages(ITrayWindow *Tray)
Definition: traywnd.cpp:3753
#define IDHK_RUN
Definition: traywnd.cpp:32
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:25
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:15
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:170
VOID TrayMessageLoop(ITrayWindow *Tray)
Definition: traywnd.cpp:3759
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:24
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3747
@ TILED
Definition: traywnd.cpp:45
@ NONE
Definition: traywnd.cpp:45
@ CASCADED
Definition: traywnd.cpp:45
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:28
HRESULT CreateTrayWindow(ITrayWindow **ppTray)
Definition: traywnd.cpp:3732
#define IDHK_DESKTOP
Definition: traywnd.cpp:42
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:86
#define IDHK_EXPLORE
Definition: traywnd.cpp:36
#define TIMER_IGNOREPULSERESET_TIMEOUT
Definition: traywnd.cpp:2410
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:151
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:30
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:33
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:34
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:41
#define IDHK_PREV_TASK
Definition: traywnd.cpp:40
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:17
static BOOL CALLBACK FindEffectiveProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:111
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:27
VOID RestoreWindowPos()
Definition: traywnd.cpp:74
#define IDHK_FIND
Definition: traywnd.cpp:37
#define AUTOHIDE_INTERVAL_ANIMATING
Definition: traywnd.cpp:22
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:18
VOID BackupWindowPos()
Definition: traywnd.cpp:69
#define IDHK_HELP
Definition: traywnd.cpp:35
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:38
enum @108 g_Arrangement
#define TIMER_ID_IGNOREPULSERESET
Definition: traywnd.cpp:2409
#define AUTOHIDE_DELAY_SHOW
Definition: traywnd.cpp:21
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:19
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3724
#define IDHK_PAGER
Definition: traywnd.cpp:43
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define MAKEWORD(a, b)
Definition: typedefs.h:248
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:926
#define TRAYCMD_STARTMENU
Definition: undocshell.h:910
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:929
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:917
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:932
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:918
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:921
#define TABDMC_APPBAR
Definition: undocshell.h:935
#define TWM_DOEXITWINDOWS
Definition: undocshell.h:54
#define TRAYCMD_TILE_V
Definition: undocshell.h:915
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:924
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:931
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:923
#define TRAYCMD_TILE_H
Definition: undocshell.h:914
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:916
#define WM_PROGMAN_SAVESTATE
Definition: undocshell.h:61
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:911
#define TABDMC_LOADINPROC
Definition: undocshell.h:937
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:912
#define TRAYCMD_CASCADE
Definition: undocshell.h:913
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:922
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:920
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:927
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:928
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:919
#define TABDMC_NOTIFY
Definition: undocshell.h:936
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:930
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:925
#define WC_DIALOG
Definition: undocuser.h:11
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
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define PRECT
Definition: precomp.h:27
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1845
#define ZeroMemory
Definition: winbase.h:1744
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define S_FALSE
Definition: winerror.h:2357
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:4444
#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:1636
#define CreateWindowEx
Definition: winuser.h:5775
#define GetMonitorInfo
Definition: winuser.h:5811
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define BM_GETSTATE
Definition: winuser.h:1931
#define WM_CLOSE
Definition: winuser.h:1632
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define MF_BYCOMMAND
Definition: winuser.h:202
#define WM_SYSCOMMAND
Definition: winuser.h:1752
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:4840
#define LR_LOADTRANSPARENT
Definition: winuser.h:1104
#define VK_TAB
Definition: winuser.h:2210
#define SM_CYEDGE
Definition: winuser.h:1020
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define WM_QUIT
Definition: winuser.h:1634
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MIIM_ID
Definition: winuser.h:733
#define WM_KEYUP
Definition: winuser.h:1727
#define SM_CYSCREEN
Definition: winuser.h:971
#define HTCAPTION
Definition: winuser.h:2487
#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:2655
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1672
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define TPM_RIGHTBUTTON
Definition: winuser.h:2391
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1619
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#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:2504
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_SPACE
Definition: winuser.h:2230
#define HTBORDER
Definition: winuser.h:2508
#define WM_SIZE
Definition: winuser.h:1622
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:1934
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1751
#define TPM_BOTTOMALIGN
Definition: winuser.h:2396
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define VK_CONTROL
Definition: winuser.h:2214
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032
#define WM_NCHITTEST
Definition: winuser.h:1697
#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)
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:1786
#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:1787
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1637
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:2266
#define VK_PAUSE
Definition: winuser.h:2216
#define MF_UNCHECKED
Definition: winuser.h:204
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1705
#define TPM_TOPALIGN
Definition: winuser.h:2394
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:2595
#define SPIF_SENDCHANGE
Definition: winuser.h:1583
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
#define SC_MINIMIZE
Definition: winuser.h:2597
#define WM_SETTINGCHANGE
Definition: winuser.h:1640
#define WM_CTLCOLORBTN
Definition: winuser.h:1780
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define GetMessage
Definition: winuser.h:5810
#define WM_NCMOUSEMOVE
Definition: winuser.h:1702
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:1699
#define WM_SYSCHAR
Definition: winuser.h:1732
#define CWP_SKIPDISABLED
Definition: winuser.h:209
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define WM_EXITSIZEMOVE
Definition: winuser.h:1835
#define WM_INITMENUPOPUP
Definition: winuser.h:1757
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:1661
#define WM_TIMER
Definition: winuser.h:1753
#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:2500
#define RDW_ERASENOW
Definition: winuser.h:1230
#define RDW_FRAME
Definition: winuser.h:1223
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define WM_COPYDATA
Definition: winuser.h:1675
#define WM_NULL
Definition: winuser.h:1618
#define SendMessage
Definition: winuser.h:5863
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define PeekMessage
Definition: winuser.h:5850
#define BS_VCENTER
Definition: winuser.h:279
#define TPM_VERTICAL
Definition: winuser.h:2393
#define SM_CXSIZEFRAME
Definition: winuser.h:1004
#define SC_CLOSE
Definition: winuser.h:2603
#define SC_MOVE
Definition: winuser.h:2596
#define GetWindowLong
Definition: winuser.h:5816
#define SM_CXDLGFRAME
Definition: winuser.h:977
#define WM_LBUTTONUP
Definition: winuser.h:1788
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:5852
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define GetClassLongPtrW
Definition: winuser.h:4575
#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:1818
#define SIZE_RESTORED
Definition: winuser.h:2516
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define WM_NCLBUTTONUP
Definition: winuser.h:1704
#define HTTOP
Definition: winuser.h:2501
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2198
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define WM_HOTKEY
Definition: winuser.h:1890
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define VK_SHIFT
Definition: winuser.h:2213
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:2199
#define WM_DESTROY
Definition: winuser.h:1620
#define WM_NCRBUTTONUP
Definition: winuser.h:1707
#define SM_CXSCREEN
Definition: winuser.h:970
#define DispatchMessage
Definition: winuser.h:5785
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define WM_MOVING
Definition: winuser.h:1820
#define WM_ENDSESSION
Definition: winuser.h:1638
#define GW_CHILD
Definition: winuser.h:774
#define MDITILE_VERTICAL
Definition: winuser.h:2200
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2500
#define TPM_RETURNCMD
Definition: winuser.h:2398
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define HTLEFT
Definition: winuser.h:2498
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define WM_NCCALCSIZE
Definition: winuser.h:1696
#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:2609
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:1703
#define GCW_ATOM
Definition: winuser.h:669
#define MIIM_TYPE
Definition: winuser.h:736
#define RDW_INVALIDATE
Definition: winuser.h:1225
#define HWND_BOTTOM
Definition: winuser.h:1216
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SC_MAXIMIZE
Definition: winuser.h:2599
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2215
#define WM_NCPAINT
Definition: winuser.h:1698
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:1834
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define IID_PPV_ARG(Itype, ppType)
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185