ReactOS  0.4.12-dev-18-gf469aca
taskmgr.c
Go to the documentation of this file.
1 /*
2  * ReactOS Task Manager
3  *
4  * taskmgr.c : Defines the entry point for the application.
5  *
6  * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7  * 2005 Klemens Friedl <frik85@reactos.at>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #include "precomp.h"
25 
26 #include "perfpage.h"
27 #include "about.h"
28 #include "affinity.h"
29 #include "debug.h"
30 #include "priority.h"
31 
32 #define STATUS_WINDOW 2001
33 
34 /* Global Variables: */
35 HINSTANCE hInst; /* current instance */
36 
37 HWND hMainWnd; /* Main Window */
38 HWND hStatusWnd; /* Status Bar Window */
39 HWND hTabWnd; /* Tab Control Window */
40 
42 
43 int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
44 int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
45 
46 int nOldWidth; /* Holds the previous client area width */
47 int nOldHeight; /* Holds the previous client area height */
48 
49 BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */
50 BOOL bWasKeyboardInput = FALSE; /* TabChange by Keyboard or Mouse ? */
51 
53 
55 // Taken from WinSpy++ 1.7
56 // http://www.catch22.net/software/winspy
57 // Copyright (c) 2002 by J Brown
58 //
59 
60 //
61 // Copied from uxtheme.h
62 // If you have this new header, then delete these and
63 // #include <uxtheme.h> instead!
64 //
65 #define ETDT_DISABLE 0x00000001
66 #define ETDT_ENABLE 0x00000002
67 #define ETDT_USETABTEXTURE 0x00000004
68 #define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE)
69 
70 //
71 typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD);
72 
73 //
74 // Try to call EnableThemeDialogTexture, if uxtheme.dll is present
75 //
77 {
78  HMODULE hUXTheme;
80 
81  hUXTheme = LoadLibraryA("uxtheme.dll");
82 
83  if(hUXTheme)
84  {
85  fnEnableThemeDialogTexture =
86  (ETDTProc)GetProcAddress(hUXTheme, "EnableThemeDialogTexture");
87 
88  if(fnEnableThemeDialogTexture)
89  {
91 
92  FreeLibrary(hUXTheme);
93  return TRUE;
94  }
95  else
96  {
97  // Failed to locate API!
98  FreeLibrary(hUXTheme);
99  return FALSE;
100  }
101  }
102  else
103  {
104  // Not running under XP? Just fail gracefully
105  return FALSE;
106  }
107 }
108 
110  HINSTANCE hPrevInstance,
111  LPWSTR lpCmdLine,
112  int nCmdShow)
113 {
115  HANDLE hToken;
116  TOKEN_PRIVILEGES tkp;
117  HANDLE hMutex;
118 
119  /* check wether we're already running or not */
120  hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros");
121  if (hMutex && GetLastError() == ERROR_ALREADY_EXISTS)
122  {
123  /* Restore existing taskmanager and bring window to front */
124  /* Relies on the fact that the application title string and window title are the same */
125  HWND hTaskMgr;
126  TCHAR szTaskmgr[128];
127 
128  LoadString(hInst, IDS_APP_TITLE, szTaskmgr, sizeof(szTaskmgr)/sizeof(TCHAR));
129  hTaskMgr = FindWindow(NULL, szTaskmgr);
130 
131  if (hTaskMgr != NULL)
132  {
133  SendMessage(hTaskMgr, WM_SYSCOMMAND, SC_RESTORE, 0);
134  SetForegroundWindow(hTaskMgr);
135  }
136 
137  CloseHandle(hMutex);
138  return 0;
139  }
140  else if (!hMutex)
141  {
142  return 1;
143  }
144 
145  /* Initialize global variables */
146  hInst = hInstance;
147 
148  /* Change our priority class to HIGH */
151  CloseHandle(hProcess);
152 
153  /* Now lets get the SE_DEBUG_NAME privilege
154  * so that we can debug processes
155  */
156 
157  /* Get a token for this process. */
159  {
160  /* Get the LUID for the debug privilege. */
162  {
163  tkp.PrivilegeCount = 1; /* one privilege to set */
165 
166  /* Get the debug privilege for this process. */
167  AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
168  }
169  CloseHandle(hToken);
170  }
171 
172  /* Load our settings from the registry */
173  LoadSettings();
174 
175  /* Initialize perf data */
176  if (!PerfDataInitialize())
177  {
178  return -1;
179  }
180 
181  /*
182  * Set our shutdown parameters: we want to shutdown the very last,
183  * without displaying any end task dialog if needed.
184  */
186 
188 
189  /* Save our settings to the registry */
190  SaveSettings();
192  CloseHandle(hMutex);
193  if (hWindowMenu)
195  return 0;
196 }
197 
198 /* Message handler for dialog box. */
201 {
202 #if 0
203  HDC hdc;
204  PAINTSTRUCT ps;
205  RECT rc;
206 #endif
207  LPRECT pRC;
208  LPNMHDR pnmh;
209  WINDOWPLACEMENT wp;
210 
211  switch (message) {
212  case WM_INITDIALOG:
213  // For now, the Help dialog menu item is disabled because of lacking of HTML Help support
215  hMainWnd = hDlg;
216  return OnCreate(hDlg);
217 
218  case WM_COMMAND:
219  if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
220  EndDialog(hDlg, LOWORD(wParam));
221  return TRUE;
222  }
223  /* Process menu commands */
224  switch (LOWORD(wParam))
225  {
226  case ID_FILE_NEW:
228  break;
231  break;
234  break;
237  break;
240  break;
241  case ID_RESTORE:
243  break;
244  case ID_VIEW_LARGE:
245  case ID_VIEW_SMALL:
246  case ID_VIEW_DETAILS:
248  break;
251  break;
254  break;
257  break;
263  break;
266  break;
267  case ID_VIEW_REFRESH:
268  PostMessageW(hDlg, WM_TIMER, 0, 0);
269  break;
272  break;
275  break;
276  case ID_WINDOWS_MINIMIZE:
278  break;
279  case ID_WINDOWS_MAXIMIZE:
281  break;
282  case ID_WINDOWS_CASCADE:
284  break;
287  break;
290  break;
293  break;
296  break;
299  break;
302  break;
305  break;
308  break;
311  break;
314  break;
317  break;
320  break;
323  break;
326  break;
329  break;
330 
331 /* ShutDown items */
332  case ID_SHUTDOWN_STANDBY:
334  break;
337  break;
340  break;
341  case ID_SHUTDOWN_REBOOT:
342  ShutDown_Reboot();
343  break;
344  case ID_SHUTDOWN_LOGOFF:
346  break;
349  break;
352  break;
355  break;
358  break;
359 
360  case ID_HELP_ABOUT:
361  OnAbout();
362  break;
363  case ID_FILE_EXIT:
364  EndDialog(hDlg, IDOK);
365  break;
366  }
367  break;
368 
369  case WM_ONTRAYICON:
370  switch(lParam)
371  {
372  case WM_RBUTTONDOWN:
373  {
374  POINT pt;
375  BOOL OnTop;
376  HMENU hMenu, hPopupMenu;
377 
378  GetCursorPos(&pt);
379 
380  OnTop = ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
381 
382  hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_TRAY_POPUP));
383  hPopupMenu = GetSubMenu(hMenu, 0);
384 
385  if(IsWindowVisible(hMainWnd))
386  {
387  DeleteMenu(hPopupMenu, ID_RESTORE, MF_BYCOMMAND);
388  }
389  else
390  {
391  SetMenuDefaultItem(hPopupMenu, ID_RESTORE, FALSE);
392  }
393 
394  if(OnTop)
395  {
397  } else
398  {
400  }
401 
402  SetForegroundWindow(hMainWnd);
403  TrackPopupMenuEx(hPopupMenu, 0, pt.x, pt.y, hMainWnd, NULL);
404 
405  DestroyMenu(hMenu);
406  break;
407  }
408  case WM_LBUTTONDBLCLK:
410  break;
411  }
412  break;
413 
414  case WM_NOTIFY:
415  pnmh = (LPNMHDR)lParam;
416  if ((pnmh->hwndFrom == hTabWnd) &&
417  (pnmh->idFrom == IDC_TAB))
418  {
419  switch (pnmh->code)
420  {
421  case TCN_SELCHANGE:
423  break;
424  case TCN_KEYDOWN:
426  break;
427  case NM_CLICK:
429  break;
430  }
431  }
432  break;
433 #if 0
434  case WM_NCPAINT:
435  hdc = GetDC(hDlg);
436  GetClientRect(hDlg, &rc);
438  ReleaseDC(hDlg, hdc);
439  break;
440 
441  case WM_PAINT:
442  hdc = BeginPaint(hDlg, &ps);
443  GetClientRect(hDlg, &rc);
445  EndPaint(hDlg, &ps);
446  break;
447 #endif
448  case WM_SIZING:
449  /* Make sure the user is sizing the dialog */
450  /* in an acceptable range */
451  pRC = (LPRECT)lParam;
452  if ((wParam == WMSZ_LEFT) || (wParam == WMSZ_TOPLEFT) || (wParam == WMSZ_BOTTOMLEFT)) {
453  /* If the width is too small enlarge it to the minimum */
454  if (nMinimumWidth > (pRC->right - pRC->left))
455  pRC->left = pRC->right - nMinimumWidth;
456  } else {
457  /* If the width is too small enlarge it to the minimum */
458  if (nMinimumWidth > (pRC->right - pRC->left))
459  pRC->right = pRC->left + nMinimumWidth;
460  }
461  if ((wParam == WMSZ_TOP) || (wParam == WMSZ_TOPLEFT) || (wParam == WMSZ_TOPRIGHT)) {
462  /* If the height is too small enlarge it to the minimum */
463  if (nMinimumHeight > (pRC->bottom - pRC->top))
464  pRC->top = pRC->bottom - nMinimumHeight;
465  } else {
466  /* If the height is too small enlarge it to the minimum */
467  if (nMinimumHeight > (pRC->bottom - pRC->top))
468  pRC->bottom = pRC->top + nMinimumHeight;
469  }
470  return TRUE;
471  break;
472 
473  case WM_SIZE:
474  /* Handle the window sizing in it's own function */
475  OnSize(wParam, LOWORD(lParam), HIWORD(lParam));
476  break;
477 
478  case WM_MOVE:
479  /* Handle the window moving in it's own function */
480  OnMove(wParam, LOWORD(lParam), HIWORD(lParam));
481  break;
482 
483  case WM_DESTROY:
484  ShowWindow(hDlg, SW_HIDE);
486  wp.length = sizeof(WINDOWPLACEMENT);
487  GetWindowPlacement(hDlg, &wp);
488  TaskManagerSettings.Left = wp.rcNormalPosition.left;
489  TaskManagerSettings.Top = wp.rcNormalPosition.top;
490  TaskManagerSettings.Right = wp.rcNormalPosition.right;
491  TaskManagerSettings.Bottom = wp.rcNormalPosition.bottom;
492  if (IsZoomed(hDlg) || (wp.flags & WPF_RESTORETOMAXIMIZED))
493  TaskManagerSettings.Maximized = TRUE;
494  else
495  TaskManagerSettings.Maximized = FALSE;
496  /* Get rid of the allocated command line cache, if any */
498  if (hWindowMenu)
500  return DefWindowProcW(hDlg, message, wParam, lParam);
501 
502  case WM_TIMER:
503  /* Refresh the performance data */
504  PerfDataRefresh();
509  break;
510 
511  case WM_ENTERMENULOOP:
513  break;
514  case WM_EXITMENULOOP:
516  break;
517  case WM_MENUSELECT:
518  TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam);
519  break;
520  case WM_SYSCOLORCHANGE:
521  /* Forward WM_SYSCOLORCHANGE to common controls */
525  break;
526  }
527 
528  return 0;
529 }
530 
532 {
533  SetBkColor(hDC, clr);
534  ExtTextOutW(hDC, 0, 0, ETO_OPAQUE, lpRect, NULL, 0, NULL);
535 }
536 
537 void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr)
538 {
539  RECT rect;
540 
541  SetBkColor(hDC, clr);
542  rect.left = x;
543  rect.top = y;
544  rect.right = x + cx;
545  rect.bottom = y + cy;
546  ExtTextOutW(hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
547 }
548 
549 void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
550 {
551  FillSolidRect2(hDC, x, y, cx - 1, 1, clrTopLeft);
552  FillSolidRect2(hDC, x, y, 1, cy - 1, clrTopLeft);
553  FillSolidRect2(hDC, x + cx, y, -1, cy, clrBottomRight);
554  FillSolidRect2(hDC, x, y + cy, cx, -1, clrBottomRight);
555 }
556 
557 void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight)
558 {
559  Draw3dRect(hDC, lpRect->left, lpRect->top, lpRect->right - lpRect->left,
560  lpRect->bottom - lpRect->top, clrTopLeft, clrBottomRight);
561 }
562 
564 {
565  /* Setup update speed (pause=fall down) */
566  switch (TaskManagerSettings.UpdateSpeed) {
568  SetTimer(hWnd, 1, 1000, NULL);
569  break;
571  SetTimer(hWnd, 1, 2000, NULL);
572  break;
574  SetTimer(hWnd, 1, 4000, NULL);
575  break;
576  }
577 }
578 
580 {
581  HMENU hMenu;
582  HMENU hEditMenu;
583  HMENU hViewMenu;
584  HMENU hShutMenu;
585  HMENU hUpdateSpeedMenu;
586  HMENU hCPUHistoryMenu;
587  int nActivePage;
588  int nParts[3];
589  RECT rc;
590  WCHAR szTemp[256];
591  WCHAR szLogOffItem[MAX_PATH];
592  LPWSTR lpUserName;
593  TCITEM item;
594  DWORD len = 0;
595 
596  SendMessageW(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconW(hInst, MAKEINTRESOURCEW(IDI_TASKMANAGER)));
597 
598  /* Initialize the Windows Common Controls DLL */
600 
601  /* Get the minimum window sizes */
602  GetWindowRect(hWnd, &rc);
603  nMinimumWidth = (rc.right - rc.left);
604  nMinimumHeight = (rc.bottom - rc.top);
605 
606  /* Create the status bar */
608  if(!hStatusWnd)
609  return FALSE;
610 
611  /* Create the status bar panes */
612  nParts[0] = STATUS_SIZE1;
613  nParts[1] = STATUS_SIZE2;
614  nParts[2] = STATUS_SIZE3;
615  SendMessageW(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
616 
617  /* Create tab pages */
618  hTabWnd = GetDlgItem(hWnd, IDC_TAB);
619 #if 1
623 #else
627 #endif
628 
629  /* Insert tabs */
630  LoadStringW(hInst, IDS_TAB_APPS, szTemp, 256);
631  memset(&item, 0, sizeof(TCITEM));
632  item.mask = TCIF_TEXT;
633  item.pszText = szTemp;
634  (void)TabCtrl_InsertItem(hTabWnd, 0, &item);
635  LoadStringW(hInst, IDS_TAB_PROCESSES, szTemp, 256);
636  memset(&item, 0, sizeof(TCITEM));
637  item.mask = TCIF_TEXT;
638  item.pszText = szTemp;
639  (void)TabCtrl_InsertItem(hTabWnd, 1, &item);
640  LoadStringW(hInst, IDS_TAB_PERFORMANCE, szTemp, 256);
641  memset(&item, 0, sizeof(TCITEM));
642  item.mask = TCIF_TEXT;
643  item.pszText = szTemp;
644  (void)TabCtrl_InsertItem(hTabWnd, 2, &item);
645 
646  /* Size everything correctly */
647  GetClientRect(hWnd, &rc);
648  nOldWidth = rc.right;
649  nOldHeight = rc.bottom;
650  /* nOldStartX = rc.left; */
651  /*nOldStartY = rc.top; */
652 
653 #define PAGE_OFFSET_LEFT 17
654 #define PAGE_OFFSET_TOP 72
655 #define PAGE_OFFSET_WIDTH (PAGE_OFFSET_LEFT*2)
656 #define PAGE_OFFSET_HEIGHT (PAGE_OFFSET_TOP+32)
657 
658  if ((TaskManagerSettings.Left != 0) ||
659  (TaskManagerSettings.Top != 0) ||
660  (TaskManagerSettings.Right != 0) ||
661  (TaskManagerSettings.Bottom != 0))
662  {
663  MoveWindow(hWnd, TaskManagerSettings.Left, TaskManagerSettings.Top, TaskManagerSettings.Right - TaskManagerSettings.Left, TaskManagerSettings.Bottom - TaskManagerSettings.Top, TRUE);
664 #ifdef __GNUC__TEST__
665  MoveWindow(hApplicationPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
666  MoveWindow(hProcessPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
667  MoveWindow(hPerformancePage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
668 #endif
669  }
670  if (TaskManagerSettings.Maximized)
671  ShowWindow(hWnd, SW_MAXIMIZE);
672 
673  /* Set the always on top style */
674  hMenu = GetMenu(hWnd);
675  hEditMenu = GetSubMenu(hMenu, 1);
676  hViewMenu = GetSubMenu(hMenu, 2);
677  hShutMenu = GetSubMenu(hMenu, 4);
678  hUpdateSpeedMenu = GetSubMenu(hViewMenu, 1);
679  hCPUHistoryMenu = GetSubMenu(hViewMenu, 7);
680 
681  /* Check or uncheck the always on top menu item */
682  if (TaskManagerSettings.AlwaysOnTop) {
684  SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
685  } else {
687  SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
688  }
689 
690  /* Check or uncheck the minimize on use menu item */
691  if (TaskManagerSettings.MinimizeOnUse)
693  else
695 
696  /* Check or uncheck the hide when minimized menu item */
697  if (TaskManagerSettings.HideWhenMinimized)
699  else
701 
702  /* Check or uncheck the show 16-bit tasks menu item */
703  if (TaskManagerSettings.Show16BitTasks)
705  else
707 
708  /* Set the view mode */
709  CheckMenuRadioItem(hViewMenu, ID_VIEW_LARGE, ID_VIEW_DETAILS, TaskManagerSettings.ViewMode, MF_BYCOMMAND);
710 
711  if (TaskManagerSettings.ShowKernelTimes)
713  else
715 
717 
718  if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
720  else
722 
723  nActivePage = TaskManagerSettings.ActiveTabPage;
724  TabCtrl_SetCurFocus/*Sel*/(hTabWnd, 0);
725  TabCtrl_SetCurFocus/*Sel*/(hTabWnd, 1);
726  TabCtrl_SetCurFocus/*Sel*/(hTabWnd, 2);
727  TabCtrl_SetCurFocus/*Sel*/(hTabWnd, nActivePage);
728 
729  /* Set the username in the "Log Off %s" item of the Shutdown menu */
730 
731  /* 1- Get the menu item text and store it temporarily */
732  GetMenuStringW(hShutMenu, ID_SHUTDOWN_LOGOFF, szTemp, 256, MF_BYCOMMAND);
733 
734  /* 2- Retrieve the username length first, then allocate a buffer for it and call it again */
736  {
737  lpUserName = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR));
738  if (lpUserName && GetUserNameW(lpUserName, &len))
739  {
740  _snwprintf(szLogOffItem, sizeof(szLogOffItem)/sizeof(szLogOffItem[0]), szTemp, lpUserName);
741  szLogOffItem[sizeof(szLogOffItem)/sizeof(szLogOffItem[0]) - 1] = UNICODE_NULL;
742  }
743  else
744  {
745  _snwprintf(szLogOffItem, sizeof(szLogOffItem)/sizeof(szLogOffItem[0]), szTemp, L"n/a");
746  }
747 
748  if (lpUserName) HeapFree(GetProcessHeap(), 0, lpUserName);
749  }
750  else
751  {
752  _snwprintf(szLogOffItem, sizeof(szLogOffItem)/sizeof(szLogOffItem[0]), szTemp, L"n/a");
753  }
754 
755  /* 3- Set the menu item text to its formatted counterpart */
757 
758  /* Setup update speed */
759  SetUpdateSpeed(hWnd);
760 
761  /*
762  * Refresh the performance data
763  * Sample it twice so we can establish
764  * the delta values & cpu usage
765  */
766  PerfDataRefresh();
767  PerfDataRefresh();
768 
772 
774 
775  return TRUE;
776 }
777 
778 /* OnMove()
779  * This function handles all the moving events for the application
780  * It moves every child window that needs moving
781  */
782 void OnMove( WPARAM nType, int cx, int cy )
783 {
784 #ifdef __GNUC__TEST__
785  MoveWindow(hApplicationPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
786  MoveWindow(hProcessPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
787  MoveWindow(hPerformancePage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE);
788 #endif
789 }
790 
791 /* OnSize()
792  * This function handles all the sizing events for the application
793  * It re-sizes every window, and child window that needs re-sizing
794  */
795 void OnSize( WPARAM nType, int cx, int cy )
796 {
797  int nParts[3];
798  int nXDifference;
799  int nYDifference;
800  RECT rc;
801 
802  if (nType == SIZE_MINIMIZED)
803  {
804  if(TaskManagerSettings.HideWhenMinimized)
805  {
806  ShowWindow(hMainWnd, SW_HIDE);
807  }
808  return;
809  }
810 
811  nXDifference = cx - nOldWidth;
812  nYDifference = cy - nOldHeight;
813  nOldWidth = cx;
814  nOldHeight = cy;
815 
816  /* Update the status bar size */
817  GetWindowRect(hStatusWnd, &rc);
818  SendMessageW(hStatusWnd, WM_SIZE, nType, MAKELPARAM(cx,rc.bottom - rc.top));
819 
820  /* Update the status bar pane sizes */
821  nParts[0] = bInMenuLoop ? -1 : STATUS_SIZE1;
822  nParts[1] = STATUS_SIZE2;
823  nParts[2] = cx;
824  SendMessageW(hStatusWnd, SB_SETPARTS, bInMenuLoop ? 1 : 3, (LPARAM) (LPINT) nParts);
825 
826  /* Resize the tab control */
827  GetWindowRect(hTabWnd, &rc);
828  cx = (rc.right - rc.left) + nXDifference;
829  cy = (rc.bottom - rc.top) + nYDifference;
831 
832  /* Resize the application page */
834  cx = (rc.right - rc.left) + nXDifference;
835  cy = (rc.bottom - rc.top) + nYDifference;
837 
838  /* Resize the process page */
840  cx = (rc.right - rc.left) + nXDifference;
841  cy = (rc.bottom - rc.top) + nYDifference;
843 
844  /* Resize the performance page */
846  cx = (rc.right - rc.left) + nXDifference;
847  cy = (rc.bottom - rc.top) + nYDifference;
849 }
850 
851 void LoadSettings(void)
852 {
853  HKEY hKey;
854  WCHAR szSubKey[] = L"Software\\ReactOS\\TaskManager";
855  int i;
856  DWORD dwSize;
857 
858  /* Window size & position settings */
859  TaskManagerSettings.Maximized = FALSE;
860  TaskManagerSettings.Left = 0;
861  TaskManagerSettings.Top = 0;
862  TaskManagerSettings.Right = 0;
863  TaskManagerSettings.Bottom = 0;
864 
865  /* Tab settings */
866  TaskManagerSettings.ActiveTabPage = 0;
867 
868  /* Options menu settings */
869  TaskManagerSettings.AlwaysOnTop = FALSE;
870  TaskManagerSettings.MinimizeOnUse = TRUE;
871  TaskManagerSettings.HideWhenMinimized = TRUE;
872  TaskManagerSettings.Show16BitTasks = TRUE;
873 
874  /* Update speed settings */
875  TaskManagerSettings.UpdateSpeed = ID_VIEW_UPDATESPEED_NORMAL;
876 
877  /* Applications page settings */
878  TaskManagerSettings.ViewMode = ID_VIEW_DETAILS;
879 
880  /* Processes page settings */
881  TaskManagerSettings.ShowProcessesFromAllUsers = FALSE; /* Server-only? */
882 
883  for (i = 0; i < COLUMN_NMAX; i++) {
884  TaskManagerSettings.Columns[i] = ColumnPresets[i].bDefaults;
885  TaskManagerSettings.ColumnOrderArray[i] = i;
886  TaskManagerSettings.ColumnSizeArray[i] = ColumnPresets[i].size;
887  }
888 
889  TaskManagerSettings.SortColumn = COLUMN_IMAGENAME;
890  TaskManagerSettings.SortAscending = TRUE;
891 
892  /* Performance page settings */
893  TaskManagerSettings.CPUHistory_OneGraphPerCPU = TRUE;
894  TaskManagerSettings.ShowKernelTimes = FALSE;
895 
896  /* Open the key */
897  if (RegOpenKeyExW(HKEY_CURRENT_USER, szSubKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
898  return;
899  /* Read the settings */
900  dwSize = sizeof(TASKMANAGER_SETTINGS);
901  RegQueryValueExW(hKey, L"Preferences", NULL, NULL, (LPBYTE)&TaskManagerSettings, &dwSize);
902 
903  /*
904  * ATM, the 'ImageName' column is always visible
905  * (and grayed in configuration dialog)
906  * This will avoid troubles if the registry gets corrupted.
907  */
908  TaskManagerSettings.Column_ImageName = TRUE;
909 
910  /* Close the key */
911  RegCloseKey(hKey);
912 }
913 
914 void SaveSettings(void)
915 {
916  HKEY hKey;
917  WCHAR szSubKey[] = L"Software\\ReactOS\\TaskManager";
918 
919  /* Open (or create) the key */
921  return;
922  /* Save the settings */
923  RegSetValueExW(hKey, L"Preferences", 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
924  /* Close the key */
925  RegCloseKey(hKey);
926 }
927 
929 {
930  //HMENU hMenu, hOptionsMenu;
931  BOOL OnTop;
932 
933  //hMenu = GetMenu(hMainWnd);
934  //hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
935  OnTop = ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
936 
937  OpenIcon(hMainWnd);
938  SetForegroundWindow(hMainWnd);
939  SetWindowPos(hMainWnd, (OnTop ? HWND_TOPMOST : HWND_TOP), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
940 }
941 
943 {
944  int nParts;
945 
946  /* Update the status bar pane sizes */
947  nParts = -1;
948  SendMessageW(hStatusWnd, SB_SETPARTS, 1, (LPARAM) (LPINT)&nParts);
949  bInMenuLoop = TRUE;
950  SendMessageW(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)L"");
951 }
952 
954 {
955  RECT rc;
956  int nParts[3];
957 
958  bInMenuLoop = FALSE;
959 
960  /* Update the status bar pane sizes */
961  GetClientRect(hWnd, &rc);
962  nParts[0] = STATUS_SIZE1;
963  nParts[1] = STATUS_SIZE2;
964  nParts[2] = rc.right;
965  SendMessageW(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
966 
967  /* trigger update of status bar columns and performance page asynchronously */
969 }
970 
971 void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
972 {
973  WCHAR str[100];
974 
975  wcscpy(str, L"");
976  if (LoadStringW(hInst, nItemID, str, 100)) {
977  /* load appropriate string */
978  LPWSTR lpsz = str;
979  /* first newline terminates actual string */
980  lpsz = wcschr(lpsz, '\n');
981  if (lpsz != NULL)
982  *lpsz = '\0';
983  }
984  SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)str);
985 }
986 
988 {
989  HMENU hMenu;
990  HMENU hViewMenu;
991  HMENU hUpdateSpeedMenu;
992 
993  hMenu = GetMenu(hMainWnd);
994  hViewMenu = GetSubMenu(hMenu, 2);
995  hUpdateSpeedMenu = GetSubMenu(hViewMenu, 1);
996 
997  TaskManagerSettings.UpdateSpeed = dwSpeed;
999 
1000  KillTimer(hMainWnd, 1);
1001 
1002  SetUpdateSpeed(hMainWnd);
1003 }
1004 
1006 {
1007  int i;
1008  HMENU hMenu;
1009  HMENU hOptionsMenu;
1010  HMENU hViewMenu;
1011  HMENU hSubMenu;
1012  WCHAR szTemp[256];
1013  SYSTEM_INFO sysInfo;
1014 
1015  hMenu = GetMenu(hMainWnd);
1016  hViewMenu = GetSubMenu(hMenu, 2);
1017  hOptionsMenu = GetSubMenu(hMenu, 1);
1018  TaskManagerSettings.ActiveTabPage = TabCtrl_GetCurSel(hTabWnd);
1019  for (i = GetMenuItemCount(hViewMenu) - 1; i > 2; i--) {
1020  hSubMenu = GetSubMenu(hViewMenu, i);
1021  if (hSubMenu)
1022  DestroyMenu(hSubMenu);
1023  RemoveMenu(hViewMenu, i, MF_BYPOSITION);
1024  }
1025  RemoveMenu(hOptionsMenu, 3, MF_BYPOSITION);
1026  if (hWindowMenu)
1028  switch (TaskManagerSettings.ActiveTabPage) {
1029  case 0:
1034 
1035  LoadStringW(hInst, IDS_MENU_LARGEICONS, szTemp, 256);
1036  AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_LARGE, szTemp);
1037 
1038  LoadStringW(hInst, IDS_MENU_SMALLICONS, szTemp, 256);
1039  AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SMALL, szTemp);
1040 
1041  LoadStringW(hInst, IDS_MENU_DETAILS, szTemp, 256);
1042  AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_DETAILS, szTemp);
1043 
1044  if (GetMenuItemCount(hMenu) <= 5) {
1046 
1047  LoadStringW(hInst, IDS_MENU_WINDOWS, szTemp, 256);
1048  InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hWindowMenu, szTemp);
1049 
1050  DrawMenuBar(hMainWnd);
1051  }
1052  CheckMenuRadioItem(hViewMenu, ID_VIEW_LARGE, ID_VIEW_DETAILS, TaskManagerSettings.ViewMode, MF_BYCOMMAND);
1053 
1054  /*
1055  * Give the application list control focus
1056  */
1057  if (!bWasKeyboardInput)
1059  break;
1060 
1061  case 1:
1066 
1067  LoadStringW(hInst, IDS_MENU_SELECTCOLUMNS, szTemp, 256);
1068  AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SELECTCOLUMNS, szTemp);
1069 
1070  LoadStringW(hInst, IDS_MENU_16BITTASK, szTemp, 256);
1071  AppendMenuW(hOptionsMenu, MF_STRING, ID_OPTIONS_SHOW16BITTASKS, szTemp);
1072 
1073  if (TaskManagerSettings.Show16BitTasks)
1075  if (GetMenuItemCount(hMenu) > 5)
1076  {
1077  DeleteMenu(hMenu, 3, MF_BYPOSITION);
1078  DrawMenuBar(hMainWnd);
1079  }
1080  /*
1081  * Give the process list control focus
1082  */
1083  if (!bWasKeyboardInput)
1085  break;
1086 
1087  case 2:
1092  if (GetMenuItemCount(hMenu) > 5) {
1093  DeleteMenu(hMenu, 3, MF_BYPOSITION);
1094  DrawMenuBar(hMainWnd);
1095  }
1096 
1097  GetSystemInfo(&sysInfo);
1098 
1099  /* Hide CPU graph options on single CPU systems */
1100  if (sysInfo.dwNumberOfProcessors > 1)
1101  {
1102  hSubMenu = CreatePopupMenu();
1103 
1104  LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
1106 
1107  LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
1109 
1110  LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
1111  AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
1112 
1113  if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
1115  else
1117  }
1118 
1119  LoadStringW(hInst, IDS_MENU_SHOWKERNELTIMES, szTemp, 256);
1120  AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SHOWKERNELTIMES, szTemp);
1121 
1122  if (TaskManagerSettings.ShowKernelTimes)
1124  else
1126 
1127  /*
1128  * Give the tab control focus
1129  */
1130  if (!bWasKeyboardInput)
1131  SetFocus(hTabWnd);
1132  break;
1133  }
1134 }
1135 
1137 {
1138  LPWSTR lpMessageBuffer;
1139 
1141  NULL,
1142  dwError,
1144  (LPWSTR)&lpMessageBuffer,
1145  0, NULL) != 0)
1146  {
1147  MessageBoxW(hMainWnd, lpMessageBuffer, NULL, MB_OK | MB_ICONERROR);
1148  if (lpMessageBuffer) LocalFree(lpMessageBuffer);
1149  }
1150 }
1151 
1153 {
1154  DWORD dwRet;
1155  LPWSTR lpszTemp = NULL;
1156 
1158  NULL,
1159  GetLastError(),
1160  LANG_NEUTRAL,
1161  (LPWSTR)&lpszTemp,
1162  0,
1163  NULL );
1164 
1165  /* supplied buffer is not long enough */
1166  if (!dwRet || ( (long)dwSize < (long)dwRet+14)) {
1167  lpszBuf[0] = L'\0';
1168  } else {
1169  lpszTemp[lstrlenW(lpszTemp)-2] = L'\0'; /*remove cr and newline character */
1170  wsprintfW(lpszBuf, L"%s (0x%x)", lpszTemp, (int)GetLastError());
1171  }
1172  if (lpszTemp) {
1173  LocalFree((HLOCAL)lpszTemp);
1174  }
1175  return lpszBuf;
1176 }
1177 
1179 {
1180  DWORD dwExitCodeThread = 0;
1181 
1182  if (*hThread != NULL) {
1183  PostThreadMessage(dwThread,WM_QUIT,0,0);
1184  for (;;) {
1185  MSG msg;
1186 
1187  if (WAIT_OBJECT_0 == WaitForSingleObject(*hThread, 500))
1188  break;
1189  while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
1190  TranslateMessage(&msg);
1191  DispatchMessage(&msg);
1192  }
1193  }
1194  GetExitCodeThread(*hThread, &dwExitCodeThread);
1195  CloseHandle(*hThread);
1196  *hThread = NULL;
1197  }
1198  return dwExitCodeThread;
1199 }
1200 
void ApplicationPage_OnWindowsCascade(void)
Definition: applpage.c:815
INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: applpage.c:110
#define IDS_MENU_DETAILS
Definition: resource.h:233
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HINSTANCE hInst
Definition: taskmgr.c:35
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define ID_SHUTDOWN_SWITCHUSER
Definition: resource.h:189
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define STATUS_SIZE3
Definition: taskmgr.h:51
#define HDC
Definition: msvc.h:22
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDR_WINDOWSMENU
Definition: resource.h:16
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
#define DispatchMessage
Definition: winuser.h:5631
#define COLOR_3DHILIGHT
Definition: winuser.h:927
BOOL WINAPI TranslateMessage(_In_ const MSG *)
Definition: tftpd.h:59
#define REALTIME_PRIORITY_CLASS
Definition: winbase.h:184
#define ID_VIEW_DETAILS
Definition: resource.h:38
#define PeekMessage
Definition: winuser.h:5696
#define TRUE
Definition: types.h:120
#define IDR_TRAY_POPUP
Definition: resource.h:22
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:398
HWND hApplicationPage
Definition: applpage.c:34
#define COLUMN_NMAX
Definition: column.h:51
#define ID_OPTIONS_HIDEWHENMINIMIZED
Definition: resource.h:140
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
#define PAGE_OFFSET_LEFT
BOOL WINAPI DrawMenuBar(_In_ HWND)
#define IDS_MENU_SHOWKERNELTIMES
Definition: resource.h:237
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
BOOL WINAPI ModifyMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define IDD_TASKMGR_DIALOG
Definition: resource.h:4
#define ID_RESTORE
Definition: resource.h:168
#define MF_BYCOMMAND
Definition: winuser.h:202
struct _WINDOWPLACEMENT WINDOWPLACEMENT
#define FindWindow
Definition: winuser.h:5643
#define SC_RESTORE
Definition: winuser.h:2552
long y
Definition: polytest.cpp:48
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
#define ERROR_SUCCESS
Definition: deptool.c:10
void OnAbout(void)
Definition: about.c:25
#define IDS_MENU_ONEGRAPHALLCPUS
Definition: resource.h:234
#define IDC_TAB
Definition: resource.h:12
void OnMove(WPARAM nType, int cx, int cy)
Definition: taskmgr.c:782
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
long x
Definition: polytest.cpp:48
#define STATUS_SIZE2
Definition: taskmgr.h:50
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
Definition: taskmgr.c:549
#define ID_PROCESS_PAGE_SETPRIORITY_NORMAL
Definition: resource.h:179
HDC WINAPI GetDC(_In_opt_ HWND)
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define pt(x, y)
Definition: drawing.c:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SW_HIDE
Definition: winuser.h:762
#define DWORD
Definition: msvc.h:34
void TaskManager_OnViewUpdateSpeed(DWORD dwSpeed)
Definition: taskmgr.c:987
#define LANG_NEUTRAL
Definition: nls.h:22
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define HKEY_CURRENT_USER
Definition: winreg.h:11
void ProcessPage_OnEndProcessTree(void)
Definition: endproc.c:110
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:405
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
HWND hTabWnd
Definition: taskmgr.c:39
#define ID_OPTIONS_ALWAYSONTOP
Definition: resource.h:138
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define ID_SHUTDOWN_POWEROFF
Definition: resource.h:186
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define ID_SHUTDOWN_DISCONNECT
Definition: resource.h:191
void DoSetPriority(DWORD priority)
Definition: priority.c:26
#define ID_APPLICATION_PAGE_GOTOPROCESS
Definition: resource.h:170
#define CALLBACK
Definition: compat.h:27
#define MF_STRING
Definition: winuser.h:138
HWND hWnd
Definition: settings.c:17
#define WM_QUIT
Definition: winuser.h:1605
BOOL HideWhenMinimized
Definition: taskmgr.h:68
VOID ShutDown_LogOffUser(VOID)
Definition: shutdown.c:170
LONG top
Definition: windef.h:297
BOOL PerfDataInitialize(void)
Definition: perfdata.c:64
#define ID_HELP_TOPICS
Definition: resource.h:155
#define ID_VIEW_UPDATESPEED_HIGH
Definition: resource.h:145
HANDLE HWND
Definition: compat.h:13
BOOL WINAPI SetPriorityClass(IN HANDLE hProcess, IN DWORD dwPriorityClass)
Definition: proc.c:1722
$ULONG PrivilegeCount
Definition: setypes.h:969
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int ColumnSizeArray[COLUMN_NMAX]
Definition: taskmgr.h:82
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define WM_MOVE
Definition: winuser.h:1592
VOID ShutDown_PowerOff(VOID)
Definition: shutdown.c:115
#define GWL_EXSTYLE
Definition: winuser.h:845
#define HWND_TOPMOST
Definition: winuser.h:1194
#define HWND_TOP
Definition: winuser.h:1193
BOOL OnCreate(HWND hWnd)
Definition: taskmgr.c:579
void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void)
Definition: perfpage.c:518
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
int nMinimumHeight
Definition: taskmgr.c:44
#define ID_WINDOWS_MAXIMIZE
Definition: resource.h:152
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WMSZ_TOP
Definition: winuser.h:2420
#define TabCtrl_GetCurSel(hwnd)
Definition: commctrl.h:4030
VOID ShutDown_EjectComputer(VOID)
Definition: shutdown.c:194
#define WPF_RESTORETOMAXIMIZED
Definition: winuser.h:2486
#define ID_OPTIONS_SHOW16BITTASKS
Definition: resource.h:158
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
Definition: taskmgr.c:109
#define WS_CHILD
Definition: pedump.c:617
#define TCIF_TEXT
Definition: commctrl.h:3938
#define ID_PROCESS_PAGE_SETPRIORITY_HIGH
Definition: resource.h:177
void RefreshProcessPage(void)
Definition: procpage.c:411
#define GetWindowLongPtrW
Definition: winuser.h:4698
LONG left
Definition: windef.h:296
#define SWP_NOZORDER
Definition: winuser.h:1232
#define NORMAL_PRIORITY_CLASS
Definition: winbase.h:181
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:62
void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr)
Definition: taskmgr.c:537
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1178
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LONG right
Definition: windef.h:298
void PerfDataUninitialize(void)
Definition: perfdata.c:85
HWND hApplicationPageListCtrl
Definition: applpage.c:35
#define lstrlenW
Definition: compat.h:407
HWND hPerformancePage
Definition: perfpage.c:31
#define PAGE_OFFSET_HEIGHT
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
DWORD WINAPI GetSysColor(_In_ int)
void ApplicationPage_OnWindowsMinimize(void)
Definition: applpage.c:773
BOOL TrayIcon_ShellUpdateTrayIcon(void)
Definition: trayicon.c:177
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define ID_WINDOWS_TILEVERTICALLY
Definition: resource.h:150
struct tagNMHDR * LPNMHDR
#define COLOR_3DSHADOW
Definition: winuser.h:921
static void SetUpdateSpeed(HWND hWnd)
Definition: taskmgr.c:563
HWND hStatusWnd
Definition: taskmgr.c:38
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
#define ID_PROCESS_PAGE_ENDPROCESS
Definition: resource.h:172
#define WMSZ_TOPLEFT
Definition: winuser.h:2421
#define ABOVE_NORMAL_PRIORITY_CLASS
Definition: winbase.h:191
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define ID_SHUTDOWN_HIBERNATE
Definition: resource.h:185
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
Definition: proc.c:979
INT INT y
Definition: msvc.h:62
UINT code
Definition: winuser.h:3112
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define WM_NCPAINT
Definition: winuser.h:1669
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:503
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
void ProcessPage_OnDebug(void)
Definition: debug.c:26
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
GLenum GLclampf GLint i
Definition: glfuncs.h:14
HINSTANCE hInstance
Definition: charmap.c:20
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: taskmgr.c:71
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
int WINAPI GetMenuStringW(_In_ HMENU hMenu, _In_ UINT uIDItem, _Out_writes_opt_(cchMax) LPWSTR lpString, _In_ int cchMax, _In_ UINT flags)
#define ETO_OPAQUE
Definition: wingdi.h:645
#define UNICODE_NULL
#define ID_PROCESS_PAGE_SETPRIORITY_REALTIME
Definition: resource.h:176
#define ID_OPTIONS_MINIMIZEONUSE
Definition: resource.h:139
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:162
#define ETDT_ENABLETAB
Definition: taskmgr.c:68
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateStatusWindow
Definition: commctrl.h:1903
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define MF_BYPOSITION
Definition: winuser.h:203
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define ID_FILE_EXIT
Definition: resource.h:47
BOOL TrayIcon_ShellRemoveTrayIcon(void)
Definition: trayicon.c:159
UINT_PTR idFrom
Definition: winuser.h:3111
#define MDITILE_HORIZONTAL
Definition: winuser.h:2142
HWND hProcessPageHeaderCtrl
Definition: procpage.c:39
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_MENUSELECT
Definition: winuser.h:1723
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
int nOldWidth
Definition: taskmgr.c:46
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define WM_SIZING
Definition: winuser.h:1783
#define ID_HELP_ABOUT
Definition: resource.h:77
BOOL WINAPI BringWindowToTop(_In_ HWND)
HDC hdc
Definition: msvc.h:53
#define APIENTRY
Definition: nt_native.h:48
const WCHAR * str
#define HIGH_PRIORITY_CLASS
Definition: winbase.h:183
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:163
VOID ShutDown_Disconnect(VOID)
Definition: shutdown.c:189
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
#define WM_EXITMENULOOP
Definition: winuser.h:1781
VOID ShutDown_Hibernate(VOID)
Definition: shutdown.c:88
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
void ProcessPage_OnEndProcess(void)
Definition: endproc.c:30
smooth NULL
Definition: ftsmooth.c:416
#define ID_VIEW_UPDATESPEED_LOW
Definition: resource.h:147
#define ID_PROCESS_PAGE_SETAFFINITY
Definition: resource.h:175
void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight)
Definition: taskmgr.c:557
#define ID_PROCESS_PAGE_DEBUGCHANNELS
Definition: resource.h:182
void ProcessPage_OnSetAffinity(void)
Definition: affinity.c:41
#define ID_SHUTDOWN_STANDBY
Definition: resource.h:184
HANDLE hMutex
Definition: mutex.c:11
#define SW_SHOW
Definition: winuser.h:769
#define IDD_APPLICATION_PAGE
Definition: resource.h:8
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
#define IDD_PROCESS_PAGE
Definition: resource.h:14
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
#define WM_DESTROY
Definition: winuser.h:1591
#define ID_FILE_NEW
Definition: resource.h:41
#define WM_RBUTTONDOWN
Definition: winuser.h:1755
void SaveSettings(void)
Definition: taskmgr.c:914
void ApplicationPage_OnWindowsTile(DWORD dwMode)
Definition: applpage.c:742
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define MF_CHECKED
Definition: winuser.h:132
void OnSize(WPARAM nType, int cx, int cy)
Definition: taskmgr.c:795
#define KEY_WRITE
Definition: nt_native.h:1031
#define STATUS_SIZE1
Definition: taskmgr.h:49
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
#define LPRECT
Definition: msvc.h:30
char TCHAR
Definition: xmlstorage.h:189
#define TCN_SELCHANGE
Definition: commctrl.h:4099
int nOldHeight
Definition: taskmgr.c:47
#define ID_VIEW_REFRESH
Definition: resource.h:58
BOOL bWasKeyboardInput
Definition: taskmgr.c:50
void ApplicationPage_OnView(DWORD dwMode)
Definition: applpage.c:728
void TaskManager_OnRestoreMainWindow(void)
Definition: taskmgr.c:928
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
#define FreeLibrary(x)
Definition: compat.h:405
#define ID_PROCESS_PAGE_DEBUG
Definition: resource.h:174
void RefreshApplicationPage(void)
Definition: applpage.c:247
#define IDLE_PRIORITY_CLASS
Definition: winbase.h:182
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WAIT_OBJECT_0
Definition: winbase.h:387
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ID_SHUTDOWN_EJECT_COMPUTER
Definition: resource.h:192
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define TOKEN_QUERY
Definition: setypes.h:874
#define COLUMN_IMAGENAME
Definition: column.h:25
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL
Definition: resource.h:180
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
void ApplicationPage_OnEndTask(void)
Definition: applpage.c:905
#define WM_SIZE
Definition: winuser.h:1593
#define MDITILE_VERTICAL
Definition: winuser.h:2143
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
BOOL WINAPI OpenIcon(_In_ HWND)
#define WM_TIMER
Definition: winuser.h:1718
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
void RefreshPerformancePage(void)
Definition: perfpage.c:306
BOOL bDefaults
Definition: column.h:76
#define PostThreadMessage
Definition: winuser.h:5699
#define MAX_PATH
Definition: compat.h:26
static ETDTProc fnEnableThemeDialogTexture
Definition: uxthemesupp.c:15
unsigned int UINT
Definition: ndis.h:50
#define ID_VIEW_SHOWKERNELTIMES
Definition: resource.h:161
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Columns[COLUMN_NMAX]
Definition: taskmgr.h:80
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SIZE_MINIMIZED
Definition: winuser.h:2460
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define IDI_TASKMANAGER
Definition: resource.h:17
#define WM_PAINT
Definition: winuser.h:1602
#define ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL
Definition: resource.h:178
#define IDS_MENU_SMALLICONS
Definition: resource.h:232
BOOL ShowProcessesFromAllUsers
Definition: taskmgr.h:79
void ApplicationPage_OnGotoProcess(void)
Definition: applpage.c:929
VOID ShutDown_StandBy(VOID)
Definition: shutdown.c:61
#define IDS_MENU_ONEGRAPHPERCPU
Definition: resource.h:235
void PerfDataDeallocCommandLineCache()
Definition: perfdata.c:659
#define WM_ONTRAYICON
Definition: trayicon.h:25
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define MF_POPUP
Definition: winuser.h:136
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1087
#define IDS_MENU_LARGEICONS
Definition: resource.h:231
#define SB_SETTEXT
Definition: commctrl.h:1919
#define MB_ICONERROR
Definition: winuser.h:781
#define ID_VIEW_SELECTCOLUMNS
Definition: resource.h:160
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4150
INT_PTR CALLBACK TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: taskmgr.c:200
GLenum GLsizei len
Definition: glext.h:6722
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1754
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define ID_VIEW_UPDATESPEED_PAUSED
Definition: resource.h:148
VOID ShutDown_LockComputer(VOID)
Definition: shutdown.c:182
void ApplicationPage_OnWindowsBringToFront(void)
Definition: applpage.c:844
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
void PerformancePage_OnViewShowKernelTimes(void)
Definition: perfpage.c:481
#define WM_COMMAND
Definition: winuser.h:1716
#define IDS_MENU_CPUHISTORY
Definition: resource.h:236
HWND hwndFrom
Definition: winuser.h:3110
INT_PTR CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: perfpage.c:113
#define MF_UNCHECKED
Definition: winuser.h:204
#define NM_CLICK
Definition: commctrl.h:130
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
void PerformancePage_OnViewCPUHistoryOneGraphAll(void)
Definition: perfpage.c:504
#define ID_VIEW_SMALL
Definition: resource.h:36
VOID ShowWin32Error(DWORD dwError)
Definition: taskmgr.c:1136
#define WINAPI
Definition: msvc.h:20
BOOL bInMenuLoop
Definition: taskmgr.c:49
void TaskManager_OnEnterMenuLoop(HWND hWnd)
Definition: taskmgr.c:942
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:372
#define IDS_MENU_WINDOWS
Definition: resource.h:230
#define ID_WINDOWS_CASCADE
Definition: resource.h:153
#define SWP_NOSIZE
Definition: winuser.h:1230
void LoadSettings(void)
Definition: taskmgr.c:851
static HDC hDC
Definition: 3dtext.c:33
HMENU hWindowMenu
Definition: taskmgr.c:41
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
VOID ShutDown_SwitchUser(VOID)
Definition: shutdown.c:177
void ProcessPage_OnDebugChannels(void)
Definition: dbgchnl.c:381
#define IDS_TAB_PERFORMANCE
Definition: resource.h:198
#define IDS_MENU_16BITTASK
Definition: resource.h:229
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1257
#define SHUTDOWN_NORETRY
Definition: winbase.h:429
#define IDD_PERFORMANCE_PAGE
Definition: resource.h:15
void TaskManager_OnTabWndSelChange(void)
Definition: taskmgr.c:1005
static ATOM item
Definition: dde.c:856
#define IDS_TAB_PROCESSES
Definition: resource.h:197
INT x
Definition: msvc.h:62
void ApplicationPage_OnWindowsMaximize(void)
Definition: applpage.c:794
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
void TaskManager_OnOptionsAlwaysOnTop(void)
Definition: optnmenu.c:31
void TaskManager_OnFileNew(void)
Definition: run.c:26
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:522
#define ID_PROCESS_PAGE_ENDPROCESSTREE
Definition: resource.h:173
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:142
LPWSTR GetLastErrorText(LPWSTR lpszBuf, DWORD dwSize)
Definition: taskmgr.c:1152
BOOL WINAPI IsZoomed(_In_ HWND)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:292
#define ID_WINDOWS_MINIMIZE
Definition: resource.h:151
BOOL TrayIcon_ShellAddTrayIcon(void)
Definition: trayicon.c:129
#define MB_OK
Definition: winuser.h:784
HWND hProcessPage
Definition: procpage.c:36
#define IDS_APP_TITLE
Definition: resource.h:10
#define SWP_SHOWWINDOW
Definition: winuser.h:1233
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define SB_SETPARTS
Definition: commctrl.h:1924
HANDLE hThread
Definition: wizard.c:27
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ID_APPLICATION_PAGE_ENDTASK
Definition: resource.h:169
#define PAGE_OFFSET_WIDTH
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:970
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
RECT rcNormalPosition
Definition: winuser.h:3237
#define msg(x)
Definition: auth_time.c:54
int nMinimumWidth
Definition: taskmgr.c:43
_Out_opt_ int * cx
Definition: commctrl.h:570
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
Definition: commctrl.h:4018
#define SendMessage
Definition: winuser.h:5709
DWORD dwNumberOfProcessors
Definition: winbase.h:1130
void TaskManager_OnOptionsShow16BitTasks(void)
Definition: optnmenu.c:103
#define ID_SHUTDOWN_LOCKCOMPUTER
Definition: resource.h:190
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define HRESULT
Definition: msvc.h:21
#define BELOW_NORMAL_PRIORITY_CLASS
Definition: winbase.h:190
#define HIWORD(l)
Definition: typedefs.h:246
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define MAKELANGID(p, s)
Definition: nls.h:15
BOOL EnableDialogTheme(HWND hwnd)
Definition: taskmgr.c:76
BOOL WINAPI SetForegroundWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:299
#define SE_DEBUG_NAME
Definition: winnt_old.h:384
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define GetProcAddress(x, y)
Definition: compat.h:410
VOID ShutDown_Reboot(VOID)
Definition: shutdown.c:143
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define HWND_NOTOPMOST
Definition: winuser.h:1192
#define IDS_MENU_SELECTCOLUMNS
Definition: resource.h:228
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
int ColumnOrderArray[COLUMN_NMAX]
Definition: taskmgr.h:81
#define ID_WINDOWS_BRINGTOFRONT
Definition: resource.h:154
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define PM_REMOVE
Definition: winuser.h:1182
#define TCITEM
Definition: commctrl.h:3996
#define MF_GRAYED
Definition: winuser.h:129
void ProcessPage_OnViewSelectColumns(void)
Definition: column.c:145
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define IDS_TAB_APPS
Definition: resource.h:196
#define WS_VISIBLE
Definition: pedump.c:620
DWORD COLORREF
Definition: windef.h:290
#define ID_WINDOWS_TILEHORIZONTALLY
Definition: resource.h:149
#define memset(x, y, z)
Definition: compat.h:39
HWND hProcessPageListCtrl
Definition: procpage.c:38
#define ID_VIEW_UPDATESPEED_NORMAL
Definition: resource.h:146
HMENU WINAPI GetMenu(_In_ HWND)
#define SW_MAXIMIZE
Definition: winuser.h:766
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876
#define ID_APPLICATION_PAGE_SWITCHTO
Definition: resource.h:165
INT_PTR CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: procpage.c:132
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_SYSCOMMAND
Definition: winuser.h:1717
#define ID_SHUTDOWN_REBOOT
Definition: resource.h:187
HWND hMainWnd
Definition: taskmgr.c:37
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
BOOL CPUHistory_OneGraphPerCPU
Definition: taskmgr.h:87
void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr)
Definition: taskmgr.c:531
#define SBT_NOBORDERS
Definition: commctrl.h:1941
#define LOWORD(l)
Definition: pedump.c:82
#define TCN_KEYDOWN
Definition: commctrl.h:4085
#define HeapFree(x, y, z)
Definition: compat.h:394
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define LoadString
Definition: winuser.h:5685
void TaskManager_OnOptionsMinimizeOnUse(void)
Definition: optnmenu.c:57
#define ID_PROCESS_PAGE_SETPRIORITY_LOW
Definition: resource.h:181
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
Definition: taskmgr.c:971
#define WMSZ_LEFT
Definition: winuser.h:2418
#define WM_NOTIFY
Definition: richedit.h:61
#define WMSZ_TOPRIGHT
Definition: winuser.h:2422
#define WMSZ_BOTTOMLEFT
Definition: winuser.h:2424
#define STATUS_WINDOW
Definition: taskmgr.c:32
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188
#define ICON_BIG
Definition: tnclass.cpp:51
#define ID_VIEW_LARGE
Definition: resource.h:35
#define PAGE_OFFSET_TOP
void PerfDataRefresh(void)
Definition: perfdata.c:175
#define ID_SHUTDOWN_LOGOFF
Definition: resource.h:188
void TaskManager_OnExitMenuLoop(HWND hWnd)
Definition: taskmgr.c:953
#define TabCtrl_SetCurFocus(hwnd, i)
Definition: commctrl.h:4069
#define SWP_NOOWNERZORDER
Definition: winuser.h:1234
int * LPINT
Definition: windef.h:178
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
void TaskManager_OnOptionsHideWhenMinimized(void)
Definition: optnmenu.c:80
void ApplicationPage_OnSwitchTo(void)
Definition: applpage.c:868