- Update address of Free Software Foundation.
[reactos.git] / reactos / base / applications / 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 #define STATUS_SIZE1 80
51 #define STATUS_SIZE2 210
52 #define STATUS_SIZE3 400
53
54 typedef struct
55 {
56 /* Window size & position settings */
57 BOOL Maximized;
58 int Left;
59 int Top;
60 int Right;
61 int Bottom;
62
63 /* Tab settings */
64 int ActiveTabPage;
65
66 /* Options menu settings */
67 BOOL AlwaysOnTop;
68 BOOL MinimizeOnUse;
69 BOOL HideWhenMinimized;
70 BOOL Show16BitTasks;
71
72 /* Update speed settings */
73 /* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */
74 DWORD UpdateSpeed;
75
76 /* Applications page settings */
77 DWORD ViewMode;
78
79 /* Processes page settings */
80 BOOL ShowProcessesFromAllUsers; /* Server-only? */
81 BOOL Columns[COLUMN_NMAX];
82 int ColumnOrderArray[COLUMN_NMAX];
83 int ColumnSizeArray[COLUMN_NMAX];
84 int SortColumn;
85 BOOL SortAscending;
86
87 /* Performance page settings */
88 BOOL CPUHistory_OneGraphPerCPU;
89 BOOL ShowKernelTimes;
90
91 } TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS;
92
93 /* Global Variables: */
94 extern HINSTANCE hInst; /* current instance */
95 extern HWND hMainWnd; /* Main Window */
96 extern HWND hStatusWnd; /* Status Bar Window */
97 extern HWND hTabWnd; /* Tab Control Window */
98 extern int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
99 extern int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
100 extern int nOldWidth; /* Holds the previous client area width */
101 extern int nOldHeight; /* Holds the previous client area height */
102 extern TASKMANAGER_SETTINGS TaskManagerSettings;
103
104 /* Foward declarations of functions included in this code module: */
105 INT_PTR CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM);
106 BOOL OnCreate(HWND hWnd);
107 void OnSize(WPARAM nType, int cx, int cy);
108 void OnMove(WPARAM nType, int cx, int cy);
109 void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
110 void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr);
111 void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight);
112 void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight);
113 void LoadSettings(void);
114 void SaveSettings(void);
115 void TaskManager_OnRestoreMainWindow(void);
116 void TaskManager_OnEnterMenuLoop(HWND hWnd);
117 void TaskManager_OnExitMenuLoop(HWND hWnd);
118 void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu);
119 void TaskManager_OnViewUpdateSpeed(DWORD);
120 void TaskManager_OnViewRefresh(void);
121 void TaskManager_OnTabWndSelChange(void);
122 LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif /* __TASKMGR_H__ */