Tab2.cpp
资源名称:OSDemo [点击查看]
上传用户:tianjwyx
上传日期:2007-01-13
资源大小:813k
文件大小:2k
源码类别:
操作系统开发
开发平台:
Visual C++
- // Tab2.cpp : implementation file
- //
- #include "stdafx.h"
- #include "OSDemo.h"
- #include "Tab2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTab2 dialog
- CTab2::CTab2(CWnd* pParent /*=NULL*/)
- : CDialog(CTab2::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CTab2)
- m_ProcName = _T("");
- m_AllTime = 0;
- m_cpuTime = 0;
- //}}AFX_DATA_INIT
- }
- void CTab2::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTab2)
- DDX_Control(pDX, IDC_BTN_BEGIN, m_Exer2);
- DDX_Control(pDX, IDC_PRIORITY, m_Priority);
- DDX_Control(pDX, IDC_PROC_LIST, m_ProcList);
- DDX_Text(pDX, IDC_PROC_NAME, m_ProcName);
- DDX_Text(pDX, IDC_PROC_ALLTIME, m_AllTime);
- DDX_Text(pDX, IDC_PROC_CPUTIME, m_cpuTime);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CTab2, CDialog)
- //{{AFX_MSG_MAP(CTab2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTab2 message handlers
- BOOL CTab2::OnInitDialog()
- {
- CDialog::OnInitDialog();
- DWORD dwStyle = m_ProcList.GetExtendedStyle();
- ListView_SetExtendedListViewStyle(m_ProcList.m_hWnd, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
- m_ProcList.InsertColumn(0,"进程名",LVCFMT_LEFT,60);
- m_ProcList.InsertColumn(1,"优先级",LVCFMT_CENTER,60);
- m_ProcList.InsertColumn(2,"占用CPU时间",LVCFMT_CENTER,80);
- m_ProcList.InsertColumn(3,"需要运行时间",LVCFMT_CENTER,90);
- m_ProcList.InsertColumn(4,"进程运行状态",LVCFMT_CENTER,90);
- m_Priority.SetCurSel(2);
- m_ProcName.Format("进程 %d",++ProcNum);
- UpdateData(false);
- //m_ProcList.InsertColumn(5,"打印机数量",LVCFMT_CENTER,80);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }