taskmgr.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /*
  2. * ReactOS Task Manager
  3. *
  4. * taskmgr.h
  5. *
  6. * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #ifndef __TASKMGR_H__
  23. #define __TASKMGR_H__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifdef _MSC_VER
  28. /*MF
  29. typedef struct _IO_COUNTERS {
  30. ULONGLONG ReadOperationCount;
  31. ULONGLONG WriteOperationCount;
  32. ULONGLONG OtherOperationCount;
  33. ULONGLONG ReadTransferCount;
  34. ULONGLONG WriteTransferCount;
  35. ULONGLONG OtherTransferCount;
  36. } IO_COUNTERS, *PIO_COUNTERS;
  37. */
  38. #endif /* _MSC_VER */
  39. #include "resource.h"
  40. #define RUN_APPS_PAGE
  41. #define RUN_PROC_PAGE
  42. #define RUN_PERF_PAGE
  43. #define STATUS_WINDOW 2001
  44. typedef struct
  45. {
  46. /* Window size & position settings */
  47. BOOL Maximized;
  48. int Left;
  49. int Top;
  50. int Right;
  51. int Bottom;
  52. /* Tab settings */
  53. int ActiveTabPage;
  54. /* Options menu settings */
  55. BOOL AlwaysOnTop;
  56. BOOL MinimizeOnUse;
  57. BOOL HideWhenMinimized;
  58. BOOL Show16BitTasks;
  59. /* Update speed settings */
  60. /* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */
  61. int UpdateSpeed;
  62. /* Applications page settings */
  63. BOOL View_LargeIcons;
  64. BOOL View_SmallIcons;
  65. BOOL View_Details;
  66. /* Processes page settings */
  67. BOOL ShowProcessesFromAllUsers; /* Server-only? */
  68. BOOL Column_ImageName;
  69. BOOL Column_PID;
  70. BOOL Column_CPUUsage;
  71. BOOL Column_CPUTime;
  72. BOOL Column_MemoryUsage;
  73. BOOL Column_MemoryUsageDelta;
  74. BOOL Column_PeakMemoryUsage;
  75. BOOL Column_PageFaults;
  76. BOOL Column_USERObjects;
  77. BOOL Column_IOReads;
  78. BOOL Column_IOReadBytes;
  79. BOOL Column_SessionID; /* Server-only? */
  80. BOOL Column_UserName; /* Server-only? */
  81. BOOL Column_PageFaultsDelta;
  82. BOOL Column_VirtualMemorySize;
  83. BOOL Column_PagedPool;
  84. BOOL Column_NonPagedPool;
  85. BOOL Column_BasePriority;
  86. BOOL Column_HandleCount;
  87. BOOL Column_ThreadCount;
  88. BOOL Column_GDIObjects;
  89. BOOL Column_IOWrites;
  90. BOOL Column_IOWriteBytes;
  91. BOOL Column_IOOther;
  92. BOOL Column_IOOtherBytes;
  93. int ColumnOrderArray[25];
  94. int ColumnSizeArray[25];
  95. int SortColumn;
  96. BOOL SortAscending;
  97. /* Performance page settings */
  98. BOOL CPUHistory_OneGraphPerCPU;
  99. BOOL ShowKernelTimes;
  100. } TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS;
  101. /* Global Variables: */
  102. extern HINSTANCE hInst; /* current instance */
  103. extern HWND hMainWnd; /* Main Window */
  104. extern HWND hStatusWnd; /* Status Bar Window */
  105. extern HWND hTabWnd; /* Tab Control Window */
  106. extern int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
  107. extern int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
  108. extern int nOldWidth; /* Holds the previous client area width */
  109. extern int nOldHeight; /* Holds the previous client area height */
  110. extern TASKMANAGER_SETTINGS TaskManagerSettings;
  111. extern WNDPROC OldProcessListWndProc;
  112. extern WNDPROC OldGraphWndProc;
  113. extern HWND hProcessPage; /* Process List Property Page */
  114. extern HWND hProcessPageListCtrl; /* Process ListCtrl Window */
  115. extern HWND hProcessPageHeaderCtrl; /* Process Header Control */
  116. extern HWND hProcessPageEndProcessButton; /* Process End Process button */
  117. extern HWND hProcessPageShowAllProcessesButton; /* Process Show All Processes checkbox */
  118. extern HWND hPerformancePage; /* Performance Property Page */
  119. extern HWND hApplicationPage; /* Application List Property Page */
  120. extern HWND hApplicationPageListCtrl; /* Application ListCtrl Window */
  121. extern HWND hApplicationPageEndTaskButton; /* Application End Task button */
  122. extern HWND hApplicationPageSwitchToButton; /* Application Switch To button */
  123. extern HWND hApplicationPageNewTaskButton; /* Application New Task button */
  124. /* Forward declarations of functions included in this code module: */
  125. void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
  126. void Font_DrawText(HDC hDC, LPWSTR lpwszText, int x, int y);
  127. #define OPTIONS_MENU_INDEX 1
  128. void TaskManager_OnOptionsAlwaysOnTop(void);
  129. void TaskManager_OnOptionsMinimizeOnUse(void);
  130. void TaskManager_OnOptionsHideWhenMinimized(void);
  131. void TaskManager_OnOptionsShow16BitTasks(void);
  132. void TaskManager_OnFileNew(void);
  133. LPWSTR GetLastErrorText( LPWSTR lpwszBuf, DWORD dwSize );
  134. void OnAbout(void);
  135. void ProcessPage_OnSetAffinity(void);
  136. void ProcessPage_OnDebug(void);
  137. void ProcessPage_OnEndProcess(void);
  138. void ProcessPage_OnEndProcessTree(void);
  139. void ProcessPage_OnSetPriorityRealTime(void);
  140. void ProcessPage_OnSetPriorityHigh(void);
  141. void ProcessPage_OnSetPriorityAboveNormal(void);
  142. void ProcessPage_OnSetPriorityNormal(void);
  143. void ProcessPage_OnSetPriorityBelowNormal(void);
  144. void ProcessPage_OnSetPriorityLow(void);
  145. void ProcessPage_OnDebugChannels(void);
  146. #define WM_ONTRAYICON WM_USER + 5
  147. BOOL TrayIcon_ShellAddTrayIcon(void);
  148. BOOL TrayIcon_ShellRemoveTrayIcon(void);
  149. BOOL TrayIcon_ShellUpdateTrayIcon(void);
  150. void PerformancePage_OnViewShowKernelTimes(void);
  151. void PerformancePage_OnViewCPUHistoryOneGraphAll(void);
  152. void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void);
  153. void ApplicationPage_OnViewLargeIcons(void);
  154. void ApplicationPage_OnViewSmallIcons(void);
  155. void ApplicationPage_OnViewDetails(void);
  156. void ApplicationPage_OnWindowsTileHorizontally(void);
  157. void ApplicationPage_OnWindowsTileVertically(void);
  158. void ApplicationPage_OnWindowsMinimize(void);
  159. void ApplicationPage_OnWindowsMaximize(void);
  160. void ApplicationPage_OnWindowsCascade(void);
  161. void ApplicationPage_OnWindowsBringToFront(void);
  162. void ApplicationPage_OnSwitchTo(void);
  163. void ApplicationPage_OnEndTask(void);
  164. void ApplicationPage_OnGotoProcess(void);
  165. void RefreshApplicationPage(void);
  166. void RefreshPerformancePage(void);
  167. void RefreshProcessPage(void);
  168. INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  169. INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  170. LRESULT CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  171. INT_PTR CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  172. INT_PTR CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176. #endif /* __TASKMGR_H__ */