MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ParseTableEntry

Method ParseTableEntry

WinArk/ProcessTable.cpp:32–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32int CProcessTable::ParseTableEntry(CString& s, char& mask, int& select, std::shared_ptr<WinSys::ProcessInfo>& info, int column) {
33 // Name,Id,Session,Priority,Threads,Handles,Attributes,CreateTime,CompanyName,Description,ExePath,CmdLines
34 auto& px = GetProcessInfoEx(info.get());
35 switch (static_cast<ProcessColumn>(column)) {
36 case ProcessColumn::Name:
37 s = info->GetImageName().c_str();
38 break;
39 case ProcessColumn::Id:
40 s.Format(L"%6u (0x%05X)", info->Id,info->Id);
41 break;
42 case ProcessColumn::Session:
43 s.Format(L"%2d ", info->SessionId);
44 break;
45 case ProcessColumn::UserName:
46 s = px.UserName().c_str();
47 break;
48 case ProcessColumn::Priority:
49 s = FormatHelper::PriorityClassToString(px.GetPriorityClass());
50 break;
51 case ProcessColumn::Threads:
52 s.Format(L"%u", info->ThreadCount);
53 break;
54 case ProcessColumn::Handles:
55 s.Format(L"%u ", info->HandleCount);
56 break;
57 case ProcessColumn::Attributes:
58 s = FormatHelper::ProcessAttributesToString(px.GetAttributes(m_ProcMgr));
59 break;
60 case ProcessColumn::CreateTime:
61 s = FormatHelper::TimeToString(info->CreateTime);
62 break;
63 case ProcessColumn::Description:
64 s = px.GetDescription().c_str();
65 break;
66 case ProcessColumn::CompanyName:
67 s = px.GetCompanyName().c_str();
68 break;
69 case ProcessColumn::Version:
70 s = px.GetVersion().c_str();
71 break;
72 case ProcessColumn::ExePath:
73 s = px.GetExecutablePath().c_str();
74 break;
75 case ProcessColumn::CmdLine:
76 s = px.GetCommandLine().c_str();
77 if (s.GetLength() > MAX_PATH) {
78 select = DRAW_HILITE;
79 }
80 break;
81 default:
82 break;
83 }
84 return s.GetLength();
85}
86
87LRESULT CProcessTable::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) {
88 m_Table.data.info.clear();

Callers

nothing calls this directly

Calls 7

UserNameMethod · 0.80
GetAttributesMethod · 0.80
GetVersionMethod · 0.80
GetCommandLineMethod · 0.80
GetPriorityClassMethod · 0.45
GetCompanyNameMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected