ReactOS  0.4.15-dev-3717-g292e6a4
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 */
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 one app is selected */
517  {
519  }
520  else
521  {
523  }
524 
525  /* If we are on the applications tab the windows menu will be */
526  /* present on the menu bar so enable & disable the menu items */
527  if (TabCtrl_GetCurSel(hTabWnd) == 0)
528  {
529  HMENU hMenu;
530  HMENU hWindowsMenu;
531 
532  hMenu = GetMenu(hMainWnd);
533  hWindowsMenu = GetSubMenu(hMenu, 3);
534 
535  /* Only one item selected */
537  {
544  }
545  /* More than one item selected */
547  {
554  }
555  /* No items selected */
556  else
557  {
564  }
565  }
566 }
567 
569 {
570  LPNMHDR pnmh;
571  LV_DISPINFO* pnmdi;
573  WCHAR szMsg[256];
574 
575  pnmh = (LPNMHDR) lParam;
576  pnmdi = (LV_DISPINFO*) lParam;
577 
578  if (pnmh->hwndFrom == hApplicationPageListCtrl) {
579  switch (pnmh->code) {
580  case LVN_ITEMCHANGED:
582  break;
583 
584  case LVN_GETDISPINFO:
585  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)pnmdi->item.lParam;
586 
587  /* Update the item text */
588  if (pnmdi->item.iSubItem == 0)
589  {
590  wcsncpy(pnmdi->item.pszText, pAPLI->szTitle, pnmdi->item.cchTextMax);
591  }
592 
593  /* Update the item status */
594  else if (pnmdi->item.iSubItem == 1)
595  {
596  if (pAPLI->bHung)
597  {
598  LoadStringW( GetModuleHandleW(NULL), IDS_NOT_RESPONDING , szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
599  }
600  else
601  {
602  LoadStringW( GetModuleHandleW(NULL), IDS_RUNNING, (LPWSTR) szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
603  }
604  wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
605  }
606 
607  break;
608 
609  case NM_RCLICK:
610 
612  {
614  }
615  else
616  {
618  }
619 
620  break;
621 
622  case NM_DBLCLK:
623 
625 
626  break;
627 
628  case LVN_KEYDOWN:
629 
630  if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE)
632 
633  break;
634 
635  }
636  }
638  {
639  switch (pnmh->code)
640  {
641  case NM_RCLICK:
642 
644  {
646  }
647  else
648  {
650  }
651 
652  break;
653 
654  case HDN_ITEMCLICK:
655 
658 
659  break;
660  }
661  }
662 
663 }
664 
666 {
667  HMENU hMenu;
668  HMENU hSubMenu;
669  POINT pt;
670 
671  GetCursorPos(&pt);
672 
674  hSubMenu = GetSubMenu(hMenu, 0);
675 
677 
679 
680  DestroyMenu(hMenu);
681 }
682 
684 {
685  HMENU hMenu;
686  HMENU hSubMenu;
687  POINT pt;
688 
689  GetCursorPos(&pt);
690 
692  hSubMenu = GetSubMenu(hMenu, 0);
693 
695  {
702  }
704  {
711  }
712  else
713  {
720  }
721 
723 
725 
726  DestroyMenu(hMenu);
727 }
728 
730 {
731  HMENU hMenu;
732  HMENU hViewMenu;
733 
734  hMenu = GetMenu(hMainWnd);
735  hViewMenu = GetSubMenu(hMenu, 2);
736 
737  TaskManagerSettings.ViewMode = dwMode;
739 
741 }
742 
744 {
746  LV_ITEM item;
747  int i;
748  HWND* hWndArray;
749  int nWndCount;
750 
752  nWndCount = 0;
753 
755  memset(&item, 0, sizeof(LV_ITEM));
756  item.mask = LVIF_STATE|LVIF_PARAM;
757  item.iItem = i;
758  item.stateMask = (UINT)-1;
760 
761  if (item.state & LVIS_SELECTED) {
762  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
763  if (pAPLI) {
764  hWndArray[nWndCount] = pAPLI->hWnd;
765  nWndCount++;
766  }
767  }
768  }
769 
770  TileWindows(NULL, dwMode, NULL, nWndCount, hWndArray);
771  HeapFree(GetProcessHeap(), 0, hWndArray);
772 }
773 
775 {
777  LV_ITEM item;
778  int i;
779 
781  memset(&item, 0, sizeof(LV_ITEM));
782  item.mask = LVIF_STATE|LVIF_PARAM;
783  item.iItem = i;
784  item.stateMask = (UINT)-1;
786  if (item.state & LVIS_SELECTED) {
787  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
788  if (pAPLI) {
790  }
791  }
792  }
793 }
794 
796 {
798  LV_ITEM item;
799  int i;
800 
802  memset(&item, 0, sizeof(LV_ITEM));
803  item.mask = LVIF_STATE|LVIF_PARAM;
804  item.iItem = i;
805  item.stateMask = (UINT)-1;
807  if (item.state & LVIS_SELECTED) {
808  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
809  if (pAPLI) {
811  }
812  }
813  }
814 }
815 
817 {
819  LV_ITEM item;
820  int i;
821  HWND* hWndArray;
822  int nWndCount;
823 
825  nWndCount = 0;
826 
828  memset(&item, 0, sizeof(LV_ITEM));
829  item.mask = LVIF_STATE|LVIF_PARAM;
830  item.iItem = i;
831  item.stateMask = (UINT)-1;
833  if (item.state & LVIS_SELECTED) {
834  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
835  if (pAPLI) {
836  hWndArray[nWndCount] = pAPLI->hWnd;
837  nWndCount++;
838  }
839  }
840  }
841  CascadeWindows(NULL, 0, NULL, nWndCount, hWndArray);
842  HeapFree(GetProcessHeap(), 0, hWndArray);
843 }
844 
846 {
848  LV_ITEM item;
849  int i;
850 
852  memset(&item, 0, sizeof(LV_ITEM));
853  item.mask = LVIF_STATE|LVIF_PARAM;
854  item.iItem = i;
855  item.stateMask = (UINT)-1;
857  if (item.state & LVIS_SELECTED) {
858  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
859  break;
860  }
861  }
862  if (pAPLI) {
863  SwitchToThisWindow(pAPLI->hWnd, TRUE);
864  }
865 }
866 
868 {
870  LV_ITEM item;
871  int i;
872 
874  memset(&item, 0, sizeof(LV_ITEM));
875  item.mask = LVIF_STATE|LVIF_PARAM;
876  item.iItem = i;
877  item.stateMask = (UINT)-1;
879 
880  if (item.state & LVIS_SELECTED) {
881  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
882  break;
883  }
884  }
885  if (pAPLI) {
886  SwitchToThisWindow(pAPLI->hWnd, TRUE);
889  }
890 }
891 
893 {
895  LV_ITEM item;
896  int i;
897 
898  /* Trick: on Windows, pressing the CTRL key forces the task to be ended */
899  BOOL ForceEndTask = !!(GetKeyState(VK_CONTROL) & 0x8000);
900 
902  memset(&item, 0, sizeof(LV_ITEM));
903  item.mask = LVIF_STATE|LVIF_PARAM;
904  item.iItem = i;
905  item.stateMask = (UINT)-1;
907  if (item.state & LVIS_SELECTED) {
908  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
909  if (pAPLI) {
910  EndTask(pAPLI->hWnd, 0, ForceEndTask);
911  }
912  }
913  }
914 }
915 
917 {
919  LV_ITEM item;
920  int i;
921 
923  memset(&item, 0, sizeof(LV_ITEM));
924  item.mask = LVIF_STATE|LVIF_PARAM;
925  item.iItem = i;
926  item.stateMask = (UINT)-1;
928  if (item.state & LVIS_SELECTED) {
929  pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
930  break;
931  }
932  }
933  if (pAPLI) {
934  DWORD dwProcessId;
935 
936  GetWindowThreadProcessId(pAPLI->hWnd, &dwProcessId);
937  /*
938  * Switch to the process tab
939  */
941  /*
942  * Select the process item in the list
943  */
944  i = ProcGetIndexByProcessId(dwProcessId);
945  if (i != -1)
946  {
948  i,
952  i,
953  FALSE);
954  }
955  }
956 }
957 
958 int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
959 {
962 
963  if (bSortAscending) {
964  Param1 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam1;
965  Param2 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam2;
966  } else {
967  Param1 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam2;
968  Param2 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam1;
969  }
970  return wcscmp(Param1->szTitle, Param2->szTitle);
971 }
void ApplicationPage_OnWindowsCascade(void)
Definition: applpage.c:816
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:3989
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
#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:2357
#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:958
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:4809
#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:1175
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:774
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:665
UINT code
Definition: winuser.h:3139
#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
static const WCHAR szText[]
Definition: dialog.c:139
#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:2363
#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
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
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:136
#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:1702
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:78
#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:2213
#define WM_DESTROY
Definition: winuser.h:1596
#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:743
#define ListView_RedrawItems(hwndLV, iFirst, iLast)
Definition: commctrl.h:2525
void ApplicationPage_OnView(DWORD dwMode)
Definition: applpage.c:729
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:892
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SIZE
Definition: winuser.h:1598
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define ILC_COLOR24
Definition: commctrl.h:357
#define WM_TIMER
Definition: winuser.h:1729
#define MF_ENABLED
Definition: winuser.h:128
#define PostThreadMessage
Definition: winuser.h:5813
#define WINAPI
Definition: msvc.h:6
#define LVIF_IMAGE
Definition: commctrl.h:2310
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
unsigned long DWORD
Definition: ntddk_ex.h:95
void UpdateApplicationListControlViewSetting(void)
Definition: applpage.c:250
#define SIZE_MINIMIZED
Definition: winuser.h:2486
#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
#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:916
#define IDS_RUNNING
Definition: resource.h:257
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:256
LPVOID lpParameter
Definition: kernel32.h:241
#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:845
#define LVSIL_NORMAL
Definition: commctrl.h:2298
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1727
HWND hwndFrom
Definition: winuser.h:3137
#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:568
#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:795
#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:5770
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:2183
#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:683
#define LVIF_PARAM
Definition: commctrl.h:2311
#define TPM_LEFTBUTTON
Definition: winuser.h:2359
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:5326
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ID_WINDOWS_BRINGTOFRONT
Definition: resource.h:154
#define IDS_TAB_STATUS
Definition: resource.h:199
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:198
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:38
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:1726
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:4544
_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:867