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 #pragma once 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 #ifdef _MSC_VER 30 /*MF 31 typedef struct _IO_COUNTERS { 32 ULONGLONG ReadOperationCount; 33 ULONGLONG WriteOperationCount; 34 ULONGLONG OtherOperationCount; 35 ULONGLONG ReadTransferCount; 36 ULONGLONG WriteTransferCount; 37 ULONGLONG OtherTransferCount; 38 } IO_COUNTERS, *PIO_COUNTERS; 39 */ 40 #endif /* _MSC_VER */ 41 42 #include "resource.h" 43 44 #define RUN_APPS_PAGE 45 #define RUN_PROC_PAGE 46 #define RUN_PERF_PAGE 47 48 #define STATUS_WINDOW 2001 49 #define STATUS_SIZE1 85 50 #define STATUS_SIZE2 190 51 #define STATUS_SIZE3 400 52 53 typedef struct 54 { 55 /* Window size & position settings */ 56 BOOL Maximized; 57 int Left; 58 int Top; 59 int Right; 60 int Bottom; 61 62 /* Tab settings */ 63 int ActiveTabPage; 64 65 /* Options menu settings */ 66 BOOL AlwaysOnTop; 67 BOOL MinimizeOnUse; 68 BOOL HideWhenMinimized; 69 BOOL Show16BitTasks; 70 71 /* Update speed settings */ 72 /* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */ 73 DWORD UpdateSpeed; 74 75 /* Applications page settings */ 76 DWORD ViewMode; 77 78 /* Processes page settings */ 79 BOOL ShowProcessesFromAllUsers; /* Server-only? */ 80 BOOL Columns[COLUMN_NMAX]; 81 int ColumnOrderArray[COLUMN_NMAX]; 82 int ColumnSizeArray[COLUMN_NMAX]; 83 int SortColumn; 84 BOOL SortAscending; 85 86 /* Performance page settings */ 87 BOOL CPUHistory_OneGraphPerCPU; 88 BOOL ShowKernelTimes; 89 90 } TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS; 91 92 /* Global Variables: */ 93 extern HINSTANCE hInst; /* current instance */ 94 extern HWND hMainWnd; /* Main Window */ 95 extern HWND hStatusWnd; /* Status Bar Window */ 96 extern HWND hTabWnd; /* Tab Control Window */ 97 extern int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */ 98 extern int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */ 99 extern int nOldWidth; /* Holds the previous client area width */ 100 extern int nOldHeight; /* Holds the previous client area height */ 101 extern TASKMANAGER_SETTINGS TaskManagerSettings; 102 103 /* Forward declarations of functions included in this code module: */ 104 INT_PTR CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM); 105 BOOL OnCreate(HWND hWnd); 106 void OnSize(WPARAM nType, int cx, int cy); 107 void OnMove(WPARAM nType, int cx, int cy); 108 void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr); 109 void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr); 110 void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight); 111 void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight); 112 void LoadSettings(void); 113 void SaveSettings(void); 114 void TaskManager_OnRestoreMainWindow(void); 115 void TaskManager_OnEnterMenuLoop(HWND hWnd); 116 void TaskManager_OnExitMenuLoop(HWND hWnd); 117 void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu); 118 void TaskManager_OnViewUpdateSpeed(DWORD); 119 void TaskManager_OnTabWndSelChange(void); 120 VOID ShowWin32Error(DWORD dwError); 121 LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize ); 122 DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread); 123 124 #ifdef __cplusplus 125 } 126 #endif 127