| 16 | } |
| 17 | |
| 18 | LRESULT 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 | |
| 52 | LRESULT CBinaryValueDlg::OnCloseCmd(WORD, WORD wID, HWND, BOOL&) { |
| 53 | if (IDOK == wID && !m_ReadOnly) { |
nothing calls this directly
no test coverage detected