www.pudn.com > Process_Mo18292312142004.rar > ProcList.h
/*******************************************************
This file is part of Process Monitor.
Copyright (c) 2004 by Michel van Kerkhof, ( michel000@planet.nl http://home.wxs.nl/~wijk0550/ )
For more information consult the Readme file.
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU
General Public License as published by the Free
Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU
General Public License along with this program;
if not, write to:
the Free Software Foundation, Inc.,
59 Temple Place,
Suite 330, Boston,
MA 02111-1307 USA
*******************************************************
If you like my work and you have a job for me please contact me at: michel000@planet.nl
*******************************************************/
#ifndef PROCESSLIST_H
#define PROCESSLIST_H
class CWindow;
//Error's
#define ERR_NO_MEMORY -1
#define ERR_SUCCESS 1
#define ERR_UNKNOWN -2
#define ERR_NTAPI -3
#define ERR_PLEASE_WAITH -4
typedef LONG NTSTATUS, *PNTSTATUS;
typedef struct {
DWORD dwPID;
DWORD dwOwnerPID;
char pProcessName[MAX_PATH];
char pOwnerName[MAX_PATH];
DWORD dwRam;
double dCpu;
LARGE_INTEGER ftStartTime;
LARGE_INTEGER CpuOldTime;
LARGE_INTEGER CpuDeltaTime;
LARGE_INTEGER ReadTransferCount;
LARGE_INTEGER WriteTransferCount;
long BasePriority;
BYTE Changed;
} PROCESSLIST;
class CProcList {
private:
HWND m_hMain;
bool m_bUpdateInProgress;
bool m_bAccessToBuffer;
void *m_pBuffer;
DWORD m_dwBufferSize;
double m_dOldCpu;
PROCESSLIST **m_pList;
DWORD m_dwListSize;
int m_OldListSize;
int GetNewBuffer();
int SetOwnerName(DWORD dwItem);
int SetList(HWND hWnd);
public:
#ifdef CHECK_LAG
bool m_bLagging;
#endif
CProcList(DWORD *dwRet,HWND hWnd);
~CProcList() {
}
int UpdateProcList(CWindow *CWnd);
int GetProcessInfo(PROCESSLIST *lpProcessList,int iLine);
int GetProcessInfoFromPid(PROCESSLIST *lpProcessList,DWORD dwPID);
};
#endif