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