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

Method OnInitDialog

WinArk/BinaryValueDlg.cpp:18–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18LRESULT CBinaryValueDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
19 CRect rc;
20 GetDlgItem(IDC_BUTTON1).GetWindowRect(&rc);
21 ScreenToClient(&rc);
22 GetDlgItem(IDC_BUTTON1).ShowWindow(SW_HIDE);
23
24 m_Hex.Create(m_hWnd, &rc, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_CLIENTEDGE, IDC_HEX);
25 rc.OffsetRect(0, -30);
26
27 PostMessage(WM_SIZE);
28
29 ULONG bytes = 0;
30 m_Key.QueryBinaryValue(m_Name, nullptr, &bytes);
31 m_Value.resize(bytes);
32 if (ERROR_SUCCESS != m_Key.QueryBinaryValue(m_Name, m_Value.data(), &bytes)) {
33 EndDialog(IDRETRY);
34 return 0;
35 }
36
37 m_Buffer.Init(m_Value.data(), (uint32_t)m_Value.size());
38
39 UpdateBufferSize();
40
41 m_Hex.SetReadOnly(m_ReadOnly);
42 m_Hex.SetBufferManager(&m_Buffer);
43 m_Hex.SetBytesPerLine(8);
44 m_Hex.SetBiasOffset(0);
45 m_Hex.SetFocus();
46
47 SetDlgItemText(IDC_NAME, m_Name.IsEmpty() ? RegHelpers::DefaultValueName : m_Name);
48
49 return 0;
50}
51
52LRESULT CBinaryValueDlg::OnCloseCmd(WORD, WORD wID, HWND, BOOL&) {
53 if (IDOK == wID && !m_ReadOnly) {

Callers

nothing calls this directly

Calls 9

QueryBinaryValueMethod · 0.80
SetReadOnlyMethod · 0.80
SetBufferManagerMethod · 0.80
SetBytesPerLineMethod · 0.80
SetBiasOffsetMethod · 0.80
IsEmptyMethod · 0.80
CreateMethod · 0.45
InitMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected