ReactOS  0.4.15-dev-5137-g826bd41
applpage.c
Go to the documentation of this file.
1 /*
2  * ReactOS Task Manager
3  *
4  * applpage.c
5  *
6  * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7  * 2005 Klemens Friedl <frik85@reactos.at>
8  * 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24 
25 #include "precomp.h"
26 
27 typedef struct
28 {
30  WCHAR szTitle[260];
34 
35 HWND hApplicationPage; /* Application List Property Page */
36 HWND hApplicationPageListCtrl; /* Application ListCtrl Window */
37 HWND hApplicationPageEndTaskButton; /* Application End Task button */
38 HWND hApplicationPageSwitchToButton; /* Application Switch To button */
39 HWND hApplicationPageNewTaskButton; /* Application New Task button */
43 DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter);
46 
49 void ApplicationPageUpdate(void);
53 int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
54 int ProcGetIndexByProcessId(DWORD dwProcessId);
55 
56 #ifdef RUN_APPS_PAGE
59 #endif
60 
61 static INT
63 {
64  DEVMODE pDevMode;
65  INT ColorDepth;
66 
67  pDevMode.dmSize = sizeof(DEVMODE);
68  pDevMode.dmDriverExtra = 0;
69 
70  if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &pDevMode))
71  return ILC_COLOR;
72 
73  switch (pDevMode.dmBitsPerPel)
74  {
75  case 32: ColorDepth = ILC_COLOR32; break;
76  case 24: ColorDepth = ILC_COLOR24; break;
77  case 16: ColorDepth = ILC_COLOR16; break;
78  case 8: ColorDepth = ILC_COLOR8; break;
79  case 4: ColorDepth = ILC_COLOR4; break;
80  default: ColorDepth = ILC_COLOR; break;
81  }
82 
83  return ColorDepth;
84 }
85 
86 void AppPageCleanup(void)
87 {
88  int i;
89  LV_ITEM item;
92  {
93  memset(&item, 0, sizeof(LV_ITEM));
94  item.mask = LVIF_PARAM;
95  item.iItem = i;
99  }
100 }
101 
102 
105 {
106  RECT rc;
107  int nXDifference;
108  int nYDifference;
110  WCHAR szTemp[256];
111  int cx, cy;
112 
113  switch (message) {
114  case WM_INITDIALOG:
115 
116  /* Save the width and height */
117  GetClientRect(hDlg, &rc);
120 
121  /* Update window position */
123 
124  /* Get handles to the controls */
129 
131 
132  /* Initialize the application page's controls */
133  column.mask = LVCF_TEXT|LVCF_WIDTH;
134 
135  LoadStringW(hInst, IDS_TAB_TASK, szTemp, 256);
136  column.pszText = szTemp;
137  column.cx = 250;
138  (void)ListView_InsertColumn(hApplicationPageListCtrl, 0, &column); /* Add the "Task" column */
139  column.mask = LVCF_TEXT|LVCF_WIDTH;
140  LoadStringW(hInst, IDS_TAB_STATUS, szTemp, 256);
141  column.pszText = szTemp;
142  column.cx = 95;
143  (void)ListView_InsertColumn(hApplicationPageListCtrl, 1, &column); /* Add the "Status" column */
144 
147 
149 
150  /* Start our refresh thread */
151 #ifdef RUN_APPS_PAGE
153 #endif
154 
155  /* Refresh page */
157 
158  return TRUE;
159 
160  case WM_DESTROY:
161  /* Close refresh thread */
162 #ifdef RUN_APPS_PAGE
164 #endif
165  AppPageCleanup();
166  break;
167 
168  case WM_COMMAND:
169 
170  /* Handle the button clicks */
171  switch (LOWORD(wParam))
172  {
173  case IDC_ENDTASK:
175  break;
176  case IDC_SWITCHTO:
178  break;
179  case IDC_NEWTASK:
181  break;
182  }
183 
184  break;
185 
186  case WM_SIZE:
187  if (wParam == SIZE_MINIMIZED)
188  return 0;
189 
190  cx = LOWORD(lParam);
191  cy = HIWORD(lParam);
192  nXDifference = cx - nApplicationPageWidth;
193  nYDifference = cy - nApplicationPageHeight;
196 
197  /* Reposition the application page's controls */
199  cx = (rc.right - rc.left) + nXDifference;
200  cy = (rc.bottom - rc.top) + nYDifference;
203 
205  MapWindowPoints(hApplicationPageEndTaskButton, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
206  cx = rc.left + nXDifference;
207  cy = rc.top + nYDifference;
210 
212  MapWindowPoints(hApplicationPageSwitchToButton, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
213  cx = rc.left + nXDifference;
214  cy = rc.top + nYDifference;
217 
219  MapWindowPoints(hApplicationPageNewTaskButton, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
220  cx = rc.left + nXDifference;
221  cy = rc.top + nYDifference;
224 
225  break;
226 
227  case WM_NOTIFY:
229  break;
230 
231  case WM_KEYDOWN:
232  if (wParam == VK_DELETE)
234  break;
235 
236  }
237 
238  return 0;
239 }
240 
242 {
243 #ifdef RUN_APPS_PAGE
244  /* Signal the event so that our refresh thread */
245  /* will wake up and refresh the application page */
247 #endif
248 }
249 
251 {
253 
254  dwStyle &= ~(LVS_REPORT | LVS_ICON | LVS_LIST | LVS_SMALLICON);
255 
256  switch (TaskManagerSettings.ViewMode) {
257  case ID_VIEW_LARGE: dwStyle |= LVS_ICON; break;
258  case ID_VIEW_SMALL: dwStyle |= LVS_SMALLICON; break;
259  case ID_VIEW_DETAILS: dwStyle |= LVS_REPORT; break;
260  }
262 
264 }
265 
267 {
268  MSG msg;
269  INT i;
270  BOOL bItemRemoved = FALSE;
271  LV_ITEM item;
273  HIMAGELIST hImageListLarge;
274  HIMAGELIST hImageListSmall;
275 
276  /* If we couldn't create the event then exit the thread */
277  while (1)
278  {
279  /* Wait for an the event or application close */
280  if (GetMessage(&msg, NULL, 0, 0) <= 0)
281  return 0;
282 
283  if (msg.message == WM_TIMER)
284  {
285  /*
286  * FIXME:
287  *
288  * Should this be EnumDesktopWindows() instead?
289  */
290  noApps = TRUE;
292  if (noApps)
293  {
296  }
297 
298  /* Get the image lists */
301 
302  /* Check to see if we need to remove any items from the list */
304  {
305  memset(&item, 0, sizeof(LV_ITEM));
306  item.mask = LVIF_IMAGE|LVIF_PARAM;
307  item.iItem = i;
309 
310  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
311  if (!IsWindow(pAPLI->hWnd)||
312  (wcslen(pAPLI->szTitle) <= 0) ||
313  !IsWindowVisible(pAPLI->hWnd) ||
314  (GetParent(pAPLI->hWnd) != NULL) ||
315  (GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) ||
317  {
318  ImageList_Remove(hImageListLarge, item.iItem);
319  ImageList_Remove(hImageListSmall, item.iItem);
320 
322  HeapFree(GetProcessHeap(), 0, pAPLI);
323  bItemRemoved = TRUE;
324  }
325  }
326 
327  /*
328  * If an item was removed from the list then
329  * we need to resync all the items with the
330  * image list
331  */
332  if (bItemRemoved)
333  {
335  {
336  memset(&item, 0, sizeof(LV_ITEM));
337  item.mask = LVIF_IMAGE;
338  item.iItem = i;
339  item.iImage = i;
341  }
342  bItemRemoved = FALSE;
343  }
344 
346  }
347  }
348 }
349 
351 {
352  HICON hIcon;
353  WCHAR szText[260];
354  BOOL bLargeIcon;
355  BOOL bHung = FALSE;
356  LRESULT bAlive;
357 
358  typedef int (FAR __stdcall *IsHungAppWindowProc)(HWND);
359  IsHungAppWindowProc IsHungAppWindow;
360 
361  /* Skip our window */
362  if (hWnd == hMainWnd)
363  return TRUE;
364 
365  bLargeIcon = (TaskManagerSettings.ViewMode == ID_VIEW_LARGE);
366 
367  GetWindowTextW(hWnd, szText, 260); /* Get the window text */
368 
369  /* Check and see if this is a top-level app window */
370  if ((wcslen(szText) <= 0) ||
371  !IsWindowVisible(hWnd) ||
372  (GetParent(hWnd) != NULL) ||
373  (GetWindow(hWnd, GW_OWNER) != NULL) ||
375  {
376  return TRUE; /* Skip this window */
377  }
378 
379  noApps = FALSE;
380 
381 #define GET_ICON(type) \
382  SendMessageTimeoutW(hWnd, WM_GETICON, (type), 0, SMTO_ABORTIFHUNG, 100, (PDWORD_PTR)&hIcon)
383 
384  /* Get the icon for this window */
385  hIcon = NULL;
386  bAlive = GET_ICON(bLargeIcon ? ICON_BIG : ICON_SMALL);
387  if (!hIcon)
388  {
389  /* We failed, try to retrieve other icons... */
390  if (!hIcon && bAlive)
391  GET_ICON(bLargeIcon ? ICON_SMALL : ICON_BIG);
392  if (!hIcon)
394  if (!hIcon)
396 
397  /* If we still do not have any icon, load the default one */
399  }
400 #undef GET_ICON
401 
402  bHung = FALSE;
403 
404  IsHungAppWindow = (IsHungAppWindowProc)(FARPROC)GetProcAddress(GetModuleHandleW(L"USER32.DLL"), "IsHungAppWindow");
405 
406  if (IsHungAppWindow)
407  bHung = IsHungAppWindow(hWnd);
408 
409  AddOrUpdateHwnd(hWnd, szText, hIcon, bHung);
410 
411  return TRUE;
412 }
413 
415 {
417  HIMAGELIST hImageListLarge;
418  HIMAGELIST hImageListSmall;
419  LV_ITEM item;
420  int i;
421  BOOL bAlreadyInList = FALSE;
422 
423  memset(&item, 0, sizeof(LV_ITEM));
424 
425  /* Get the image lists */
428 
429  /* Check to see if it's already in our list */
431  {
432  memset(&item, 0, sizeof(LV_ITEM));
433  item.mask = LVIF_IMAGE|LVIF_PARAM;
434  item.iItem = i;
436 
437  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
438  if (pAPLI->hWnd == hWnd)
439  {
440  bAlreadyInList = TRUE;
441  break;
442  }
443  }
444 
445  /* If it is already in the list then update it if necessary */
446  if (bAlreadyInList)
447  {
448  /* Check to see if anything needs updating */
449  if ((pAPLI->hIcon != hIcon) ||
450  (_wcsicmp(pAPLI->szTitle, szTitle) != 0) ||
451  (pAPLI->bHung != bHung))
452  {
453  /* Update the structure */
454  pAPLI->hIcon = hIcon;
455  pAPLI->bHung = bHung;
456  wcscpy(pAPLI->szTitle, szTitle);
457 
458  /* Update the image list */
459  ImageList_ReplaceIcon(hImageListLarge, item.iItem, hIcon);
460  ImageList_ReplaceIcon(hImageListSmall, item.iItem, hIcon);
461 
462  /* Update the list view */
464  /* UpdateWindow(hApplicationPageListCtrl); */
466  }
467  }
468  /* It is not already in the list so add it */
469  else
470  {
472 
473  pAPLI->hWnd = hWnd;
474  pAPLI->hIcon = hIcon;
475  pAPLI->bHung = bHung;
476  wcscpy(pAPLI->szTitle, szTitle);
477 
478  /* Add the item to the list */
479  memset(&item, 0, sizeof(LV_ITEM));
481  ImageList_AddIcon(hImageListLarge, hIcon);
482  item.iImage = ImageList_AddIcon(hImageListSmall, hIcon);
483  item.pszText = LPSTR_TEXTCALLBACK;
485  item.lParam = (LPARAM)pAPLI;
487  }
488 
489  /* Select first item if any */
492  {
495  }
496  /*
497  else
498  {
499  bApplicationPageSelectionMade = FALSE;
500  }
501  */
502 }
503 
505 {
506  /* Enable or disable the "End Task" & "Switch To" buttons */
508  {
510  }
511  else
512  {
514  }
515  /* Enable "Switch To" button only if only one app is selected */
517 
518  /* If we are on the applications tab the windows menu will be */
519  /* present on the menu bar so enable & disable the menu items */
520  if (TabCtrl_GetCurSel(hTabWnd) == 0)
521  {
522  HMENU hMenu;
523  HMENU hWindowsMenu;
524 
525  hMenu = GetMenu(hMainWnd);
526  hWindowsMenu = GetSubMenu(hMenu, 3);
527 
528  /* Only one item selected */
530  {
537  }
538  /* More than one item selected */
540  {
547  }
548  /* No items selected */
549  else
550  {
557  }
558  }
559 }
560 
562 {
563  LPNMHDR pnmh;
564  LV_DISPINFO* pnmdi;
566  WCHAR szMsg[256];
567 
568  pnmh = (LPNMHDR) lParam;
569  pnmdi = (LV_DISPINFO*) lParam;
570 
571  if (pnmh->hwndFrom == hApplicationPageListCtrl) {
572  switch (pnmh->code) {
573  case LVN_ITEMCHANGED:
575  break;
576 
577  case LVN_GETDISPINFO:
578  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)pnmdi->item.lParam;
579 
580  /* Update the item text */
581  if (pnmdi->item.iSubItem == 0)
582  {
583  wcsncpy(pnmdi->item.pszText, pAPLI->szTitle, pnmdi->item.cchTextMax);
584  }
585 
586  /* Update the item status */
587  else if (pnmdi->item.iSubItem == 1)
588  {
589  if (pAPLI->bHung)
590  {
591  LoadStringW( GetModuleHandleW(NULL), IDS_NOT_RESPONDING , szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
592  }
593  else
594  {
595  LoadStringW( GetModuleHandleW(NULL), IDS_RUNNING, (LPWSTR) szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
596  }
597  wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
598  }
599 
600  break;
601 
602  case NM_RCLICK:
603 
605  {
607  }
608  else
609  {
611  }
612 
613  break;
614 
615  case NM_DBLCLK:
616 
618 
619  break;
620 
621  case LVN_KEYDOWN:
622 
623  if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE)
625 
626  break;
627 
628  }
629  }
631  {
632  switch (pnmh->code)
633  {
634  case NM_RCLICK:
635 
637  {
639  }
640  else
641  {
643  }
644 
645  break;
646 
647  case HDN_ITEMCLICK:
648 
651 
652  break;
653  }
654  }
655 
656 }
657 
659 {
660  HMENU hMenu;
661  HMENU hSubMenu;
662  POINT pt;
663 
664  GetCursorPos(&pt);
665 
667  hSubMenu = GetSubMenu(hMenu, 0);
668 
670 
672 
673  DestroyMenu(hMenu);
674 }
675 
677 {
678  HMENU hMenu;
679  HMENU hSubMenu;
680  POINT pt;
681 
682  GetCursorPos(&pt);
683 
685  hSubMenu = GetSubMenu(hMenu, 0);
686 
688  {
696  }
698  {
706  }
707  else
708  {
716  }
717 
719 
721 
722  DestroyMenu(hMenu);
723 }
724 
726 {
727  HMENU hMenu;
728  HMENU hViewMenu;
729 
730  hMenu = GetMenu(hMainWnd);
731  hViewMenu = GetSubMenu(hMenu, 2);
732 
733  TaskManagerSettings.ViewMode = dwMode;
735 
737 }
738 
740 {
742  LV_ITEM item;
743  int i;
744  HWND* hWndArray;
745  int nWndCount;
746 
748  nWndCount = 0;
749 
751  memset(&item, 0, sizeof(LV_ITEM));
752  item.mask = LVIF_STATE|LVIF_PARAM;
753  item.iItem = i;
754  item.stateMask = (UINT)-1;
756 
757  if (item.state & LVIS_SELECTED) {
758  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
759  if (pAPLI) {
760  hWndArray[nWndCount] = pAPLI->hWnd;
761  nWndCount++;
762  }
763  }
764  }
765 
766  TileWindows(NULL, dwMode, NULL, nWndCount, hWndArray);
767  HeapFree(GetProcessHeap(), 0, hWndArray);
768 }
769 
771 {
773  LV_ITEM item;
774  int i;
775 
777  memset(&item, 0, sizeof(LV_ITEM));
778  item.mask = LVIF_STATE|LVIF_PARAM;
779  item.iItem = i;
780  item.stateMask = (UINT)-1;
782  if (item.state & LVIS_SELECTED) {
783  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
784  if (pAPLI) {
786  }
787  }
788  }
789 }
790 
792 {
794  LV_ITEM item;
795  int i;
796 
798  memset(&item, 0, sizeof(LV_ITEM));
799  item.mask = LVIF_STATE|LVIF_PARAM;
800  item.iItem = i;
801  item.stateMask = (UINT)-1;
803  if (item.state & LVIS_SELECTED) {
804  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
805  if (pAPLI) {
807  }
808  }
809  }
810 }
811 
813 {
815  LV_ITEM item;
816  int i;
817  HWND* hWndArray;
818  int nWndCount;
819 
821  nWndCount = 0;
822 
824  memset(&item, 0, sizeof(LV_ITEM));
825  item.mask = LVIF_STATE|LVIF_PARAM;
826  item.iItem = i;
827  item.stateMask = (UINT)-1;
829  if (item.state & LVIS_SELECTED) {
830  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
831  if (pAPLI) {
832  hWndArray[nWndCount] = pAPLI->hWnd;
833  nWndCount++;
834  }
835  }
836  }
837  CascadeWindows(NULL, 0, NULL, nWndCount, hWndArray);
838  HeapFree(GetProcessHeap(), 0, hWndArray);
839 }
840 
842 {
844  LV_ITEM item;
845  int i;
846 
848  memset(&item, 0, sizeof(LV_ITEM));
849  item.mask = LVIF_STATE|LVIF_PARAM;
850  item.iItem = i;
851  item.stateMask = (UINT)-1;
853  if (item.state & LVIS_SELECTED) {
854  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
855  break;
856  }
857  }
858  if (pAPLI) {
859  SwitchToThisWindow(pAPLI->hWnd, TRUE);
860  }
861 }
862 
864 {
866  LV_ITEM item;
867  int i;
868 
870  memset(&item, 0, sizeof(LV_ITEM));
871  item.mask = LVIF_STATE|LVIF_PARAM;
872  item.iItem = i;
873  item.stateMask = (UINT)-1;
875 
876  if (item.state & LVIS_SELECTED) {
877  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
878  break;
879  }
880  }
881  if (pAPLI) {
882  SwitchToThisWindow(pAPLI->hWnd, TRUE);
885  }
886 }
887 
889 {
891  LV_ITEM item;
892  int i;
893 
894  /* Trick: on Windows, pressing the CTRL key forces the task to be ended */
895  BOOL ForceEndTask = !!(GetKeyState(VK_CONTROL) & 0x8000);
896 
898  memset(&item, 0, sizeof(LV_ITEM));
899  item.mask = LVIF_STATE|LVIF_PARAM;
900  item.iItem = i;
901  item.stateMask = (UINT)-1;
903  if (item.state & LVIS_SELECTED) {
904  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
905  if (pAPLI) {
906  EndTask(pAPLI->hWnd, 0, ForceEndTask);
907  }
908  }
909  }
910 }
911 
913 {
915  LV_ITEM item;
916  int i;
917 
919  memset(&item, 0, sizeof(LV_ITEM));
920  item.mask = LVIF_STATE|LVIF_PARAM;
921  item.iItem = i;
922  item.stateMask = (UINT)-1;
924  if (item.state & LVIS_SELECTED) {
925  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
926  break;
927  }
928  }
929  if (pAPLI) {
930  DWORD dwProcessId;
931 
932  GetWindowThreadProcessId(pAPLI->hWnd, &dwProcessId);
933  /*
934  * Switch to the process tab
935  */
937  /*
938  * Select the process item in the list
939  */
940  i = ProcGetIndexByProcessId(dwProcessId);
941  if (i != -1)
942  {
944  i,
948  i,
949  FALSE);
950  }
951  }
952 }
953 
954 int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
955 {
958 
959  if (bSortAscending) {
960  Param1 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam1;
961  Param2 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam2;
962  } else {
963  Param1 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam2;
964  Param2 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam1;
965  }
966  return wcscmp(Param1->szTitle, Param2->szTitle);
967 }
void ApplicationPage_OnWindowsCascade(void)
Definition: applpage.c:812
INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: applpage.c:104
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2519
#define LV_ITEM
Definition: commctrl.h:2337
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2779
#define ILC_COLOR16
Definition: commctrl.h:356
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
Definition: tftpd.h:59
static HICON
Definition: imagelist.c:84
#define MF_DISABLED
Definition: winuser.h:130
void AppPageCleanup(void)
Definition: applpage.c:86
#define ID_VIEW_DETAILS
Definition: resource.h:36
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)
#define MAKEWPARAM(l, h)
Definition: winuser.h:3999
HWND hApplicationPage
Definition: applpage.c:35
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define MF_BYCOMMAND
Definition: winuser.h:202
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define LVSIL_SMALL
Definition: commctrl.h:2299
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2401
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LVCF_TEXT
Definition: commctrl.h:2588
#define GCL_HICONSM
Definition: winuser.h:662
WORD dmSize
Definition: wingdi.h:1568
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define TPM_LEFTALIGN
Definition: winuser.h:2367
#define LVS_REPORT
Definition: commctrl.h:2262
WORD dmDriverExtra
Definition: wingdi.h:1569
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2651
#define LV_COLUMN
Definition: commctrl.h:2547
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
static INT GetSystemColorDepth(VOID)
Definition: applpage.c:62
#define CALLBACK
Definition: compat.h:35
static HANDLE hApplicationThread
Definition: applpage.c:57
int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: applpage.c:954
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define IDC_APPLIST
Definition: resource.h:35
HANDLE HWND
Definition: compat.h:19
#define GWL_EXSTYLE
Definition: winuser.h:845
#define ID_WINDOWS_MAXIMIZE
Definition: resource.h:152
#define TabCtrl_GetCurSel(hwnd)
Definition: commctrl.h:4063
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define LVNI_SELECTED
Definition: commctrl.h:2424
UINT_PTR WPARAM
Definition: windef.h:207
#define IDI_WINDOWSM
Definition: resource.h:19
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1237
int32_t INT_PTR
Definition: typedefs.h:64
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1181
if(dx==0 &&dy==0)
Definition: linetemp.h:174
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2639
LONG right
Definition: windef.h:308
HWND hApplicationPageListCtrl
Definition: applpage.c:36
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define IDC_SWITCHTO
Definition: resource.h:32
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
DEVMODEA DEVMODE
Definition: wingdi.h:4418
int32_t INT
Definition: typedefs.h:58
void ApplicationPage_OnWindowsMinimize(void)
Definition: applpage.c:770
WPARAM wParam
Definition: combotst.c:138
#define ID_WINDOWS_TILEVERTICALLY
Definition: resource.h:150
struct tagNMHDR * LPNMHDR
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
BOOL bApplicationPageSelectionMade
Definition: applpage.c:45
#define ILC_COLOR4
Definition: commctrl.h:354
HWND hApplicationPageNewTaskButton
Definition: applpage.c:39
#define ICON_SMALL
Definition: tnclass.cpp:48
#define ILC_COLOR32
Definition: commctrl.h:358
static DWORD dwApplicationThread
Definition: applpage.c:58
#define LVIF_TEXT
Definition: commctrl.h:2309
void ApplicationPageShowContextMenu1(void)
Definition: applpage.c:658
UINT code
Definition: winuser.h:3149
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define LVN_KEYDOWN
Definition: commctrl.h:3184
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2709
#define ListView_GetImageList(hwnd, iImageList)
Definition: commctrl.h:2296
#define FALSE
Definition: types.h:117
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2673
HWND hTabWnd
Definition: msconfig.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TPM_TOPALIGN
Definition: winuser.h:2373
#define ILC_COLOR
Definition: commctrl.h:352
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1876
#define IDC_NEWTASK
Definition: resource.h:33
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:585
static int nApplicationPageHeight
Definition: applpage.c:41
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
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
void ProcessPage_OnEndProcess(void)
Definition: endproc.c:30
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define WM_KEYDOWN
Definition: winuser.h:1705
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2411
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
int ProcGetIndexByProcessId(DWORD dwProcessId)
Definition: procpage.c:82
#define LVNI_FOCUSED
Definition: commctrl.h:2423
#define LVS_LIST
Definition: commctrl.h:2264
static BOOL bSortAscending
Definition: applpage.c:42
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
Definition: applpage.c:350
#define VK_DELETE
Definition: winuser.h:2223
#define WM_DESTROY
Definition: winuser.h:1599
#define ID_FILE_NEW
Definition: resource.h:40
SHORT WINAPI GetKeyState(_In_ int)
#define GET_ICON(type)
#define IDC_ENDTASK
Definition: resource.h:31
BOOL noApps
Definition: applpage.c:44
void ApplicationPage_OnWindowsTile(DWORD dwMode)
Definition: applpage.c:739
#define ListView_RedrawItems(hwndLV, iFirst, iLast)
Definition: commctrl.h:2525
void ApplicationPage_OnView(DWORD dwMode)
Definition: applpage.c:725
void RefreshApplicationPage(void)
Definition: applpage.c:241
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
void ApplicationPage_OnEndTask(void)
Definition: applpage.c:888
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SIZE
Definition: winuser.h:1601
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define ILC_COLOR24
Definition: commctrl.h:357
#define WM_TIMER
Definition: winuser.h:1732
#define MF_ENABLED
Definition: winuser.h:128
#define PostThreadMessage
Definition: winuser.h:5823
#define WINAPI
Definition: msvc.h:6
#define LVIF_IMAGE
Definition: commctrl.h:2310
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
void UpdateApplicationListControlViewSetting(void)
Definition: applpage.c:250
#define SIZE_MINIMIZED
Definition: winuser.h:2496
#define __stdcall
Definition: typedefs.h:25
#define IDR_APPLICATION_PAGE_CONTEXT2
Definition: resource.h:21
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define SW_MINIMIZE
Definition: winuser.h:770
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define LVS_ICON
Definition: commctrl.h:2261
void ApplicationPage_OnGotoProcess(void)
Definition: applpage.c:912
#define IDS_RUNNING
Definition: resource.h:259
static int nApplicationPageWidth
Definition: applpage.c:40
HWND hMainWnd
Definition: magnifier.c:32
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2568
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
struct APPLICATION_PAGE_LIST_ITEM * LPAPPLICATION_PAGE_LIST_ITEM
#define IDS_NOT_RESPONDING
Definition: resource.h:258
#define ILC_MASK
Definition: commctrl.h:351
HWND hApplicationPageSwitchToButton
Definition: applpage.c:38
#define LV_DISPINFO
Definition: commctrl.h:3170
void ApplicationPage_OnWindowsBringToFront(void)
Definition: applpage.c:841
#define LVSIL_NORMAL
Definition: commctrl.h:2298
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1730
HWND hwndFrom
Definition: winuser.h:3147
#define ID_VIEW_SMALL
Definition: resource.h:34
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LVN_GETDISPINFO
Definition: commctrl.h:3160
#define ID_WINDOWS_CASCADE
Definition: resource.h:153
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SWP_NOSIZE
Definition: winuser.h:1235
DWORD dmBitsPerPel
Definition: wingdi.h:1595
#define GWL_STYLE
Definition: winuser.h:846
#define IDI_WINDOW
Definition: resource.h:18
#define HDN_ITEMCLICK
Definition: commctrl.h:868
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND WINAPI GetParent(_In_ HWND)
#define GCL_HICON
Definition: winuser.h:661
HINSTANCE hInst
Definition: dxdiag.c:13
static ATOM item
Definition: dde.c:856
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
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
void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam)
Definition: applpage.c:561
#define NM_DBLCLK
Definition: commctrl.h:131
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
HICON hIcon
Definition: msconfig.c:44
void ApplicationPage_OnWindowsMaximize(void)
Definition: applpage.c:791
#define NM_RCLICK
Definition: commctrl.h:133
BOOL WINAPI EndTask(HWND hWnd, BOOL fShutDown, BOOL fForce)
Definition: exit.c:207
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
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)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define ID_WINDOWS_MINIMIZE
Definition: resource.h:151
#define GW_OWNER
Definition: winuser.h:761
#define GetMessage
Definition: winuser.h:5780
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define VK_CONTROL
Definition: winuser.h:2193
#define msg(x)
Definition: auth_time.c:54
_Out_opt_ int * cx
Definition: commctrl.h:585
HWND hApplicationPageEndTaskButton
Definition: applpage.c:37
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2703
void ApplicationPageShowContextMenu2(void)
Definition: applpage.c:676
#define LVIF_PARAM
Definition: commctrl.h:2311
#define TPM_LEFTBUTTON
Definition: winuser.h:2369
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI IsWindowVisible(_In_ HWND)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define ILC_COLOR8
Definition: commctrl.h:355
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:309
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define GetProcAddress(x, y)
Definition: compat.h:612
DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter)
Definition: applpage.c:266
#define SWP_NOMOVE
Definition: winuser.h:1234
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
void ApplicationPageUpdate(void)
Definition: applpage.c:504
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
Definition: winuser.h:5336
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ID_WINDOWS_BRINGTOFRONT
Definition: resource.h:154
#define IDS_TAB_STATUS
Definition: resource.h:201
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define GetWindowLongPtr
Definition: treelist.c:73
#define MF_GRAYED
Definition: winuser.h:129
#define FAR
Definition: zlib.h:34
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2312
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2383
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
LONG_PTR LRESULT
Definition: windef.h:209
#define IDS_TAB_TASK
Definition: resource.h:200
void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung)
Definition: applpage.c:414
#define ID_WINDOWS_TILEHORIZONTALLY
Definition: resource.h:149
#define memset(x, y, z)
Definition: compat.h:39
HWND hProcessPageListCtrl
Definition: procpage.c:43
HMENU WINAPI GetMenu(_In_ HWND)
#define SW_MAXIMIZE
Definition: winuser.h:766
#define ID_APPLICATION_PAGE_SWITCHTO
Definition: resource.h:165
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define LOWORD(l)
Definition: pedump.c:82
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define GetClassLongPtrW
Definition: winuser.h:4554
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
int(* FARPROC)()
Definition: compat.h:36
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define WM_NOTIFY
Definition: richedit.h:61
#define LVS_SMALLICON
Definition: commctrl.h:2263
#define ICON_BIG
Definition: tnclass.cpp:51
#define ID_VIEW_LARGE
Definition: resource.h:33
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define IDR_APPLICATION_PAGE_CONTEXT1
Definition: resource.h:20
#define TabCtrl_SetCurFocus(hwnd, i)
Definition: commctrl.h:4102
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
void ApplicationPage_OnSwitchTo(void)
Definition: applpage.c:863