/*
* ProcessInfo.h
* Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL++2000
#pragma once
#include <sol\Object.h>
namespace SOL {
class ProcessInfo :public Object {
private:
int pid;
TCHAR name[_MAX_PATH*2];
int parentPID;
int cntThreads;
public:
ProcessInfo(int pid1, const TCHAR* name1, int pid2=0, int threads=0) {
pid = pid1;
strcpy_s(name, SizeOf(name), name1);
parentPID = pid2;
cntThreads = threads;
}
int getProcessId() { return pid; }
int getParentProcessId() { return parentPID; }
const TCHAR* getName() { return name; }
int getThreadsCount() { return cntThreads; }
virtual int compare(Object* object) {
ProcessInfo* info = (ProcessInfo*)object;
const TCHAR* p = _T("");
if (info) {
p = info->getName();
}
return strcmp(name, p);
}
};
}
|