Rename queue_t to jobqueue_t to avoid collision with library symbol
[wine] / programs / taskmgr / taskmgr.h
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __TASKMGR_H__
24 #define __TASKMGR_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #ifdef _MSC_VER
31 /*MF
32 typedef struct _IO_COUNTERS {
33         ULONGLONG  ReadOperationCount;
34         ULONGLONG  WriteOperationCount;
35         ULONGLONG  OtherOperationCount;
36         ULONGLONG ReadTransferCount;
37         ULONGLONG WriteTransferCount;
38         ULONGLONG OtherTransferCount;
39 } IO_COUNTERS, *PIO_COUNTERS;
40 */
41 #endif /* _MSC_VER */
42
43 #include "resource.h"
44
45 #define RUN_APPS_PAGE
46 #define RUN_PROC_PAGE
47 #define RUN_PERF_PAGE
48
49 #define STATUS_WINDOW   2001
50
51 typedef struct
52 {
53         /* Window size & position settings */
54         BOOL    Maximized;
55         int     Left;
56         int     Top;
57         int     Right;
58         int     Bottom;
59
60         /* Tab settings */
61         int     ActiveTabPage;
62
63         /* Options menu settings */
64         BOOL    AlwaysOnTop;
65         BOOL    MinimizeOnUse;
66         BOOL    HideWhenMinimized;
67         BOOL    Show16BitTasks;
68
69         /* Update speed settings */
70         /* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */
71         int     UpdateSpeed; 
72
73         /* Applications page settings */
74         BOOL    View_LargeIcons;
75         BOOL    View_SmallIcons;
76         BOOL    View_Details;
77
78         /* Processes page settings */
79         BOOL    ShowProcessesFromAllUsers; /* Server-only? */
80         BOOL    Column_ImageName;
81         BOOL    Column_PID;
82         BOOL    Column_CPUUsage;
83         BOOL    Column_CPUTime;
84         BOOL    Column_MemoryUsage;
85         BOOL    Column_MemoryUsageDelta;
86         BOOL    Column_PeakMemoryUsage;
87         BOOL    Column_PageFaults;
88         BOOL    Column_USERObjects;
89         BOOL    Column_IOReads;
90         BOOL    Column_IOReadBytes;
91         BOOL    Column_SessionID; /* Server-only? */
92         BOOL    Column_UserName; /* Server-only? */
93         BOOL    Column_PageFaultsDelta;
94         BOOL    Column_VirtualMemorySize;
95         BOOL    Column_PagedPool;
96         BOOL    Column_NonPagedPool;
97         BOOL    Column_BasePriority;
98         BOOL    Column_HandleCount;
99         BOOL    Column_ThreadCount;
100         BOOL    Column_GDIObjects;
101         BOOL    Column_IOWrites;
102         BOOL    Column_IOWriteBytes;
103         BOOL    Column_IOOther;
104         BOOL    Column_IOOtherBytes;
105         int     ColumnOrderArray[25];
106         int     ColumnSizeArray[25];
107         int     SortColumn;
108         BOOL    SortAscending;
109
110         /* Performance page settings */
111         BOOL    CPUHistory_OneGraphPerCPU;
112         BOOL    ShowKernelTimes;
113
114 } TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS;
115
116 /* Global Variables: */
117 extern  HINSTANCE       hInst;                                          /* current instance */
118 extern  HWND            hMainWnd;                                       /* Main Window */
119 extern  HWND            hStatusWnd;                                     /* Status Bar Window */
120 extern  HWND            hTabWnd;                                        /* Tab Control Window */
121 extern  int                     nMinimumWidth;                          /* Minimum width of the dialog (OnSize()'s cx) */
122 extern  int                     nMinimumHeight;                         /* Minimum height of the dialog (OnSize()'s cy) */
123 extern  int                     nOldWidth;                                      /* Holds the previous client area width */
124 extern  int                     nOldHeight;                                     /* Holds the previous client area height */
125 extern  TASKMANAGER_SETTINGS    TaskManagerSettings;
126
127 extern WNDPROC OldProcessListWndProc;
128 extern WNDPROC OldGraphWndProc;
129
130 extern HWND hProcessPage;                               /* Process List Property Page */
131 extern HWND hProcessPageListCtrl;                       /* Process ListCtrl Window */
132 extern HWND hProcessPageHeaderCtrl;                     /* Process Header Control */
133 extern HWND hProcessPageEndProcessButton;               /* Process End Process button */
134 extern HWND hProcessPageShowAllProcessesButton;         /* Process Show All Processes checkbox */
135 extern HWND hPerformancePage;                           /* Performance Property Page */
136
137 extern HWND hApplicationPage;                /* Application List Property Page */
138 extern HWND hApplicationPageListCtrl;        /* Application ListCtrl Window */
139 extern HWND hApplicationPageEndTaskButton;   /* Application End Task button */
140 extern HWND hApplicationPageSwitchToButton;  /* Application Switch To button */
141 extern HWND hApplicationPageNewTaskButton;   /* Application New Task button */
142
143
144 /* Foward declarations of functions included in this code module: */
145 INT_PTR CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM);
146 BOOL OnCreate(HWND hWnd);
147 void OnSize(UINT nType, int cx, int cy);
148 void OnMove(UINT nType, int cx, int cy);
149 void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
150 void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr);
151 void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight);
152 void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight);
153 void Font_DrawText(HDC hDC, LPCTSTR lpszText, int x, int y);
154 void LoadSettings(void);
155 void SaveSettings(void);
156 void TaskManager_OnRestoreMainWindow(void);
157 void TaskManager_OnEnterMenuLoop(HWND hWnd);
158 void TaskManager_OnExitMenuLoop(HWND hWnd);
159 void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu);
160 void TaskManager_OnViewUpdateSpeedHigh(void);
161 void TaskManager_OnViewUpdateSpeedNormal(void);
162 void TaskManager_OnViewUpdateSpeedLow(void);
163 void TaskManager_OnViewUpdateSpeedPaused(void);
164 void TaskManager_OnViewRefresh(void);
165 void TaskManager_OnTabWndSelChange(void);
166
167 #define OPTIONS_MENU_INDEX    1
168
169 void TaskManager_OnOptionsAlwaysOnTop(void);
170 void TaskManager_OnOptionsMinimizeOnUse(void);
171 void TaskManager_OnOptionsHideWhenMinimized(void);
172 void TaskManager_OnOptionsShow16BitTasks(void);
173 void TaskManager_OnFileNew(void);
174
175 LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
176
177 void OnAbout(void);
178
179 BOOL AreDebugChannelsSupported(void);
180
181 void ProcessPage_OnSetAffinity(void);
182 void ProcessPage_OnDebug(void);
183 void ProcessPage_OnEndProcess(void);
184 void ProcessPage_OnEndProcessTree(void);
185 void ProcessPage_OnSetPriorityRealTime(void);
186 void ProcessPage_OnSetPriorityHigh(void);
187 void ProcessPage_OnSetPriorityAboveNormal(void);
188 void ProcessPage_OnSetPriorityNormal(void);
189 void ProcessPage_OnSetPriorityBelowNormal(void);
190 void ProcessPage_OnSetPriorityLow(void);
191 void ProcessPage_OnDebugChannels(void);
192
193 #define WM_ONTRAYICON   WM_USER + 5
194
195 HICON TrayIcon_GetProcessorUsageIcon(void);
196 BOOL TrayIcon_ShellAddTrayIcon(void);
197 BOOL TrayIcon_ShellRemoveTrayIcon(void);
198 BOOL TrayIcon_ShellUpdateTrayIcon(void);
199
200 void PerformancePage_OnViewShowKernelTimes(void);
201 void PerformancePage_OnViewCPUHistoryOneGraphAll(void);
202 void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void);
203
204 void ApplicationPage_OnViewLargeIcons(void);
205 void ApplicationPage_OnViewSmallIcons(void);
206 void ApplicationPage_OnViewDetails(void);
207 void ApplicationPage_OnWindowsTileHorizontally(void);
208 void ApplicationPage_OnWindowsTileVertically(void);
209 void ApplicationPage_OnWindowsMinimize(void);
210 void ApplicationPage_OnWindowsMaximize(void);
211 void ApplicationPage_OnWindowsCascade(void);
212 void ApplicationPage_OnWindowsBringToFront(void);
213 void ApplicationPage_OnSwitchTo(void);
214 void ApplicationPage_OnEndTask(void);
215 void ApplicationPage_OnGotoProcess(void);
216
217 void RefreshApplicationPage(void);
218 void UpdateApplicationListControlViewSetting(void);
219 void RefreshPerformancePage(void);
220 void RefreshProcessPage(void);
221
222 INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
223 INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
224 LRESULT CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
225 INT_PTR CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
226 INT_PTR CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
227
228 #ifdef __cplusplus
229 }
230 #endif
231
232 #endif /* __TASKMGR_H__ */