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

Method OnInitDialog

WinArk/ProcessMemoryDlg.cpp:11–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11LRESULT CMemoryDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) {
12 BarDesc bars[] = {
13 {15,"State",0},
14 {20,"Address",0},
15 {15,"Size",0},
16 {20,"Type",0},
17 {20,"Protection",0},
18 {20,"Alloc Protection",0},
19 {15,"Usage",0},
20 {260,"Details",0}
21 };
22
23 TableInfo table = {
24 1,1,TABLE_SORTMENU | TABLE_COPYMENU | TABLE_APPMENU,9,0,0,0
25 };
26
27 BarInfo info;
28 info.nbar = _countof(bars);
29 info.font = 9;
30 for (int i = 0; i < info.nbar; i++) {
31 info.bar[i].defdx = bars[i].defdx;
32 info.bar[i].mode = bars[i].mode;
33 info.bar[i].name = bars[i].name;
34 }
35
36 DWORD pid = static_cast<DWORD>(lParam);
37 m_ProcMemoryTable = new CProcessMemoryTable(info, table, pid);
38 CString proc;
39 proc.Format(L"%d <%x>", pid, pid);
40 std::wstring title = L"Process: pid = ";
41 title += proc;
42 SetWindowText(title.c_str());
43 RECT rect;
44 GetClientRect(&rect);
45 m_ProcMemoryTable->Create(m_hWnd, rect, nullptr, WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER | WS_EX_LAYERED);
46 int iHorizontalUnit = LOWORD(GetDialogBaseUnits());
47 int iVerticalUnit = HIWORD(GetDialogBaseUnits());
48 int width, height;
49 height = rect.bottom - rect.top - 3 * iHorizontalUnit;
50 width = rect.right - rect.left - 2 * iHorizontalUnit;
51 ::MoveWindow(m_ProcMemoryTable->m_hWnd, iHorizontalUnit, iVerticalUnit, width, height, false);
52 m_ProcMemoryTable->ShowWindow(SW_SHOW);
53 return TRUE;
54}
55
56LRESULT CMemoryDlg::CMemoryDlg::OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
57 RECT rect;

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.45

Tested by

no test coverage detected