#include "taskmgr.h"
#include ".\procpage.h"
//-------------------------------------------------------------函数声明--------------------------------------------
BOOL InsertIntoSortedArray(CPtrArray * pArray, CProcInfo * pProc);
BOOL ResortArray(CPtrArray ** ppArray);
//-------------------------------------------------------------变量声明--------------------------------------------
SYSTEM_BASIC_INFORMATION g_BasicInfo;
DWORD g_cProcesses = 0;
//
// Table of which resource IDs in the column selection dialog
// correspond to which columns
//
int g_aDlgColIDs[] =
{
IDC_IMAGENAME,
IDC_PID,
// #ifdef _HYDRA_
IDC_USERNAME,
IDC_SESSIONID,
// #endif
IDC_CPU,
IDC_CPUTIME,
IDC_MEMUSAGE,
IDC_MEMPEAK,
IDC_MEMUSAGEDIFF,
IDC_PAGEFAULTS,
IDC_PAGEFAULTSDIFF,
IDC_COMMITCHARGE,
IDC_PAGEDPOOL,
IDC_NONPAGEDPOOL,
IDC_BASEPRIORITY,
IDC_HANDLECOUNT,
IDC_THREADCOUNT,
IDC_USEROBJECTS,
IDC_GDIOBJECTS,
IDC_READOPERCOUNT,
IDC_WRITEOPERCOUNT,
IDC_OTHEROPERCOUNT,
IDC_READXFERCOUNT,
IDC_WRITEXFERCOUNT,
IDC_OTHERXFERCOUNT
};
//
// Column Default Info
//
struct
{
INT Format;
INT Width;
} ColumnDefaults[NUM_COLUMN] =
{
{ LVCFMT_LEFT, 0x6B }, // COL_IMAGENAME
{ LVCFMT_RIGHT, 50 }, // COL_PID
//#ifdef _HYDRA_
{ LVCFMT_LEFT, 0x6B }, // COL_USERNAME
{ LVCFMT_RIGHT, 70 }, // COL_SESSIONID
//#endif
{ LVCFMT_RIGHT, 35}, // COL_CPU
{ LVCFMT_RIGHT, 70 }, // COL_CPUTIME
{ LVCFMT_RIGHT, 70 }, // COL_MEMUSAGE
{ LVCFMT_RIGHT, 100 }, // COL_MEMPEAK
{ LVCFMT_RIGHT, 70 }, // COL_MEMUSAGEDIFF
{ LVCFMT_RIGHT, 70 }, // COL_PAGEFAULTS
{ LVCFMT_RIGHT, 70 }, // COL_PAGEFAULTSDIFF
{ LVCFMT_RIGHT, 70 }, // COL_COMMITCHARGE
{ LVCFMT_RIGHT, 70 }, // COL_PAGEDPOOL
{ LVCFMT_RIGHT, 70 }, // COL_NONPAGEDPOOL
{ LVCFMT_RIGHT, 60 }, // COL_BASEPRIORITY
{ LVCFMT_RIGHT, 60 }, // COL_HANDLECOUNT
{ LVCFMT_RIGHT, 60 }, // COL_THREADCOUNT
{ LVCFMT_RIGHT, 60 }, // COL_USEROBJECTS
{ LVCFMT_RIGHT, 60 }, // COL_GDIOBJECTS
{ LVCFMT_RIGHT, 70 }, // COL_READOPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_WRITEOPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_OTHEROPERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_READXFERCOUNT
{ LVCFMT_RIGHT, 70 }, // COL_WRITEXFERCOUNT
{ LVCFMT_RIGHT, 70 } // COL_OTHERXFERCOUNT
};
/*++ class CProcPage::SetupColumns
Class Description:
Removes any existing columns from the process listview and
adds all of the columns listed in the g_Options.m_ActiveProcCol array.
Arguments:
Return Value:
HRESULT
Revision History:
Nov-16-95 Davepl Created
--*/
static const _aIDColNames[NUM_COLUMN] =
{
IDS_COL_IMAGENAME,
IDS_COL_PID,
// #ifdef _HYDRA_
IDS_COL_USERNAME,
IDS_COL_SESSIONID,
// #endif
IDS_COL_CPU,
IDS_COL_CPUTIME,
IDS_COL_MEMUSAGE,
IDS_COL_MEMPEAK,
IDS_COL_MEMUSAGEDIFF,
IDS_COL_PAGEFAULTS,
IDS_COL_PAGEFAULTSDIFF,
IDS_COL_COMMITCHARGE,
IDS_COL_PAGEDPOOL,
IDS_COL_NONPAGEDPOOL,
IDS_COL_BASEPRIORITY,
IDS_COL_HANDLECOUNT,
IDS_COL_THREADCOUNT,
IDS_COL_USEROBJECTS,
IDS_COL_GDIOBJECTS,
IDS_COL_READOPERCOUNT,
IDS_COL_WRITEOPERCOUNT,
IDS_COL_OTHEROPERCOUNT,
IDS_COL_READXFERCOUNT,
IDS_COL_WRITEXFERCOUNT,
IDS_COL_OTHERXFERCOUNT
};
static struct
{
size_t cbOffset;
UINT idString;
}
g_OffsetMap[] =
{
{ FIELD_OFFSET(CSysInfo, m_cHandles), IDC_TOTAL_HANDLES },
{ FIELD_OFFSET(CSysInfo, m_cThreads), IDC_TOTAL_THREADS },
{ FIELD_OFFSET(CSysInfo, m_cProcesses), IDC_TOTAL_PROCESSES },
{ FIELD_OFFSET(CSysInfo, m_dwPhysicalMemory), IDC_TOTAL_PHYSICAL },
{ FIELD_OFFSET(CSysInfo, m_dwPhysAvail), IDC_AVAIL_PHYSICAL },
{ FIELD_OFFSET(CSysInfo, m_dwFileCache), IDC_FILE_CACHE },
{ FIELD_OFFSET(CSysInfo, m_dwCommitTotal), IDC_COMMIT_TOTAL },
{ FIELD_OFFSET(CSysInfo, m_dwCommitLimit), IDC_COMMIT_LIMIT },
{ FIELD_OFFSET(CSysInfo, m_dwCommitPeak), IDC_COMMIT_PEAK },
{ FIELD_OFFSET(CSysInfo, m_dwKernelPaged), IDC_KERNEL_PAGED },
{ FIELD_OFFSET(CSysInfo, m_dwKernelNP), IDC_KERNEL_NONPAGED },
{ FIELD_OFFSET(CSysInfo, m_dwKernelTotal), IDC_KERNEL_TOTAL },
};
//---------------------------------------------------------------------------------------------------------
CProcPage::CProcPage(void)
{
m_hPage = NULL;
m_hwndTabs = NULL;
m_pProcArray = NULL;
m_pvBuffer = NULL;
m_cbBuffer = 0;
m_fPaused = FALSE;
m_pszDebugger = NULL;
OnSettingsChange();
}
CProcPage::~CProcPage(void)
{
if (m_pProcArray)
{
INT c = m_pProcArray->GetSize();
while (c)
{
delete (CProcInfo *) (m_pProcArray->GetAt(c - 1));
c--;
}
delete m_pProcArray;
}
}
//-----------------------------------------------------------全局函数-----------------------------------------------
/*++ InsertIntoSortedArray
Class Description:
Sticks a CProcInfo ptr into the ptrarray supplied at the
appropriate location based on the current sort column (which
is used by the Compare member function)
Arguments:
pArray - The CPtrArray to add to
pProc - The CProcInfo object to add to the array
Return Value:
TRUE if successful, FALSE if fails
Revision History:
Nov-20-95 Davepl Created
--*/
// REVIEW (davepl) Use binary insert here, not linear
BOOL InsertIntoSortedArray(CPtrArray * pArray, CProcInfo * pProc)
{
INT cItems = pArray->GetSize();
for (INT iIndex = 0; iIndex < cItems; iIndex++)
{
CProcInfo * pTmp = (CProcInfo *) pArray->GetAt(iIndex);
if (pProc->Compare(pTmp) < 0)
{
return pArray->InsertAt(iIndex, pProc);
}
}
return pArray->Add(pProc);
}
/*++ IsTerminalServer
Routine Description:
One time call to ValidateProductSuite to
determine if we're running terminalServer
Arguments:
< None >
Return Value:
BOOL
Revision History:
Jun-30-98 alhen revised ( no creation info supplied )
--*/
BOOL IsTerminalServer()
{
static BOOL s_bIsTerminalServer = ValidateProductSuite( );
// if the exports are not available it's just the same that terminal server
// is not properly configured and terminal services options should not be available
return( s_bIsTerminalServer && gpfnWinStationGetProcessSid != NULL && gpfnCachedGetUserFromSid != NULL );
}
/* ++ ValidateProductSuite
Routine Description:
Retrieves OSVERSIONINFO, but we're only interested
in the wSuiteMask
Arguments:
< None >
Return Value:
BOOL
Revision History:
Jul-1-98 alhen
-- */
BOOL ValidateProductSuite( )
{
OSVERSIONINFOEXW osVersionInfo;
DWORDLONG dwlConditionMask = 0;
ZeroMemory( &osVersionInfo , sizeof( OSVERSIONINFOEX ) );
osVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX );
osVersionInfo.wSuiteMask = VER_SUITE_TERMINAL;
VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_AND );
return VerifyVersionInfo( &osVersionInfo , VER_SUITENAME , dwlConditionMask );
}
//
// Take two unsigned 64-bit values an
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于c语言的做的一个任务管理器.zip (50个子文件)
基于c语言的做的一个任务管理器
c语言做的一个任务管理器
Page.h 3KB
taskmgr.aps 172KB
taskmgr.sln 903B
PerfPage.cpp 53KB
define.h 8KB
taskmgr.h 7KB
PerfPage.h 3KB
TaskPage.cpp 64KB
ProcPage.cpp 98KB
resource.h 15KB
taskmgr.rc 39KB
ptrarray.h 4KB
asm.cpp 4KB
taskmgr.suo 10KB
Release
taskmgr.exe 132KB
taskmgr.cpp 73KB
ptrarray.cpp 6KB
ProcPage.h 12KB
TaskPage.h 6KB
Res
ledunlit.bmp 2KB
bitmap1.bmp 2KB
tray11.ico 318B
tray7.ico 318B
tray9.ico 318B
tray3.ico 318B
default.ico 1KB
tray2.ico 318B
tray1.ico 318B
main.ico 1KB
ledlit.bmp 2KB
numbers.bmp 646B
bmpback.bmp 214B
tray0.ico 318B
bmp00001.bmp 246B
tray4.ico 318B
tray6.ico 318B
tray5.ico 318B
tray10.ico 318B
bitmap2.bmp 246B
bmpforwa.bmp 226B
tray8.ico 318B
Page.cpp 84B
taskmgr.vcproj 6KB
ProcInfo.cpp 34KB
main
Option.h 5KB
TaskIcon.cpp 8KB
TaskIcon.h 558B
TaskNot.h 981B
Option.cpp 4KB
struct.h 7KB
共 50 条
- 1
资源评论
小码叔
- 粉丝: 5105
- 资源: 5463
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于ESP8266和MQTT协议的语音控制家庭自动化系统.zip
- opencv-4.0.1-vc14-vc15
- Vue搭建AudioPlaySation(三)
- (源码)基于SpringBoot和SpringCloud的在线订餐系统.zip
- STM32与RS-485通讯
- C#ASP.NET养老院老人信息管理系统源码数据库 SQL2008源码类型 WebForm
- (源码)基于ApacheSpark的IoT数据分析系统.zip
- 基于图最优传输的法律案例匹配模型及其解释性分析
- (源码)基于SpringBoot和MyBatis的秒杀系统.zip
- 多模态视觉对象追踪的自蒸馏对称适配器学习方法CVPR2024
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功