2002-09-24 14:22:48 +00:00
|
|
|
/*
|
|
|
|
* ReactOS Task Manager
|
|
|
|
*
|
|
|
|
* taskmgr.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
|
|
|
|
*
|
2003-11-29 02:31:24 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2002-09-24 14:22:48 +00:00
|
|
|
*
|
2003-11-29 02:31:24 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2002-09-24 14:22:48 +00:00
|
|
|
*
|
2003-11-29 02:31:24 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-09-24 14:22:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __TASKMGR_H__
|
|
|
|
#define __TASKMGR_H__
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
2003-08-17 07:59:37 +00:00
|
|
|
/*MF
|
2002-09-24 14:22:48 +00:00
|
|
|
typedef struct _IO_COUNTERS {
|
|
|
|
ULONGLONG ReadOperationCount;
|
|
|
|
ULONGLONG WriteOperationCount;
|
|
|
|
ULONGLONG OtherOperationCount;
|
|
|
|
ULONGLONG ReadTransferCount;
|
|
|
|
ULONGLONG WriteTransferCount;
|
|
|
|
ULONGLONG OtherTransferCount;
|
|
|
|
} IO_COUNTERS, *PIO_COUNTERS;
|
2003-08-17 07:59:37 +00:00
|
|
|
*/
|
2003-11-29 02:31:24 +00:00
|
|
|
#endif /* _MSC_VER */
|
2002-09-24 14:22:48 +00:00
|
|
|
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#define RUN_APPS_PAGE
|
|
|
|
#define RUN_PROC_PAGE
|
|
|
|
#define RUN_PERF_PAGE
|
|
|
|
|
|
|
|
#define STATUS_WINDOW 2001
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Window size & position settings */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL Maximized;
|
2003-11-29 02:31:24 +00:00
|
|
|
int Left;
|
|
|
|
int Top;
|
|
|
|
int Right;
|
|
|
|
int Bottom;
|
2002-09-24 14:22:48 +00:00
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Tab settings */
|
|
|
|
int ActiveTabPage;
|
2002-09-24 14:22:48 +00:00
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Options menu settings */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL AlwaysOnTop;
|
|
|
|
BOOL MinimizeOnUse;
|
|
|
|
BOOL HideWhenMinimized;
|
|
|
|
BOOL Show16BitTasks;
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Update speed settings */
|
|
|
|
/* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */
|
|
|
|
int UpdateSpeed;
|
2002-09-24 14:22:48 +00:00
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Applications page settings */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL View_LargeIcons;
|
|
|
|
BOOL View_SmallIcons;
|
|
|
|
BOOL View_Details;
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Processes page settings */
|
|
|
|
BOOL ShowProcessesFromAllUsers; /* Server-only? */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL Column_ImageName;
|
|
|
|
BOOL Column_PID;
|
|
|
|
BOOL Column_CPUUsage;
|
|
|
|
BOOL Column_CPUTime;
|
|
|
|
BOOL Column_MemoryUsage;
|
|
|
|
BOOL Column_MemoryUsageDelta;
|
|
|
|
BOOL Column_PeakMemoryUsage;
|
|
|
|
BOOL Column_PageFaults;
|
|
|
|
BOOL Column_USERObjects;
|
|
|
|
BOOL Column_IOReads;
|
|
|
|
BOOL Column_IOReadBytes;
|
2003-11-29 02:31:24 +00:00
|
|
|
BOOL Column_SessionID; /* Server-only? */
|
|
|
|
BOOL Column_UserName; /* Server-only? */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL Column_PageFaultsDelta;
|
|
|
|
BOOL Column_VirtualMemorySize;
|
|
|
|
BOOL Column_PagedPool;
|
|
|
|
BOOL Column_NonPagedPool;
|
|
|
|
BOOL Column_BasePriority;
|
|
|
|
BOOL Column_HandleCount;
|
|
|
|
BOOL Column_ThreadCount;
|
|
|
|
BOOL Column_GDIObjects;
|
|
|
|
BOOL Column_IOWrites;
|
|
|
|
BOOL Column_IOWriteBytes;
|
|
|
|
BOOL Column_IOOther;
|
|
|
|
BOOL Column_IOOtherBytes;
|
2003-11-29 02:31:24 +00:00
|
|
|
int ColumnOrderArray[25];
|
|
|
|
int ColumnSizeArray[25];
|
|
|
|
int SortColumn;
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL SortAscending;
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Performance page settings */
|
2002-09-24 14:22:48 +00:00
|
|
|
BOOL CPUHistory_OneGraphPerCPU;
|
|
|
|
BOOL ShowKernelTimes;
|
|
|
|
|
|
|
|
} TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS;
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Global Variables: */
|
|
|
|
extern HINSTANCE hInst; /* current instance */
|
|
|
|
extern HWND hMainWnd; /* Main Window */
|
|
|
|
extern HWND hStatusWnd; /* Status Bar Window */
|
|
|
|
extern HWND hTabWnd; /* Tab Control Window */
|
|
|
|
extern int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
|
|
|
|
extern int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
|
|
|
|
extern int nOldWidth; /* Holds the previous client area width */
|
|
|
|
extern int nOldHeight; /* Holds the previous client area height */
|
2002-09-24 14:22:48 +00:00
|
|
|
extern TASKMANAGER_SETTINGS TaskManagerSettings;
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
/* Foward declarations of functions included in this code module: */
|
2002-09-24 14:22:48 +00:00
|
|
|
LRESULT CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
BOOL OnCreate(HWND hWnd);
|
|
|
|
void OnSize(UINT nType, int cx, int cy);
|
|
|
|
void OnMove(UINT nType, int cx, int cy);
|
|
|
|
void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
|
|
|
|
void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr);
|
|
|
|
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight);
|
|
|
|
void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight);
|
|
|
|
void LoadSettings(void);
|
|
|
|
void SaveSettings(void);
|
|
|
|
void TaskManager_OnEnterMenuLoop(HWND hWnd);
|
|
|
|
void TaskManager_OnExitMenuLoop(HWND hWnd);
|
|
|
|
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu);
|
|
|
|
void TaskManager_OnViewUpdateSpeedHigh(void);
|
|
|
|
void TaskManager_OnViewUpdateSpeedNormal(void);
|
|
|
|
void TaskManager_OnViewUpdateSpeedLow(void);
|
|
|
|
void TaskManager_OnViewUpdateSpeedPaused(void);
|
|
|
|
void TaskManager_OnViewRefresh(void);
|
|
|
|
void TaskManager_OnTabWndSelChange(void);
|
|
|
|
LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2003-11-29 02:31:24 +00:00
|
|
|
#endif /* __TASKMGR_H__ */
|