| 21 | } |
| 22 | |
| 23 | LRESULT CNumberValueDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) { |
| 24 | ATLASSERT(m_Type == REG_DWORD || m_Type == REG_QWORD); |
| 25 | m_Value = 0; |
| 26 | ULONG bytes = m_Type == REG_DWORD ? 4 : 8; |
| 27 | DWORD type; |
| 28 | if (ERROR_SUCCESS != m_Key.QueryValue(m_Name, &type, &m_Value, &bytes)) { |
| 29 | EndDialog(IDRETRY); |
| 30 | return 0; |
| 31 | } |
| 32 | ATLASSERT(m_Type == type); |
| 33 | SetWindowText(m_Type == REG_DWORD ? L"DWORD Value" : L"QWORD Value"); |
| 34 | SetDlgItemText(IDC_NAME, m_Name.IsEmpty() ? RegHelpers::DefaultValueName : m_Name); |
| 35 | DisplayValue(m_Value); |
| 36 | |
| 37 | if (m_ReadOnly) |
| 38 | ((CEdit)GetDlgItem(IDC_VALUE)).SetReadOnly(TRUE); |
| 39 | |
| 40 | if (m_Type == REG_QWORD) { |
| 41 | GetDlgItem(IDC_COLOR).ShowWindow(SW_HIDE); |
| 42 | int extra = 120; |
| 43 | CRect rc; |
| 44 | GetWindowRect(&rc); |
| 45 | SetWindowPos(nullptr, 0, 0, rc.Width() + extra, rc.Height(), SWP_NOMOVE | SWP_NOREPOSITION); |
| 46 | GetDlgItem(IDC_VALUE).GetClientRect(&rc); |
| 47 | GetDlgItem(IDC_VALUE).SetWindowPos(nullptr, 0, 0, rc.right + extra, rc.bottom, SWP_NOMOVE | SWP_NOREPOSITION); |
| 48 | } |
| 49 | |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | LRESULT CNumberValueDlg::OnCloseCmd(WORD, WORD wID, HWND, BOOL&) { |
| 54 | if (IDOK == wID) { |
nothing calls this directly
no test coverage detected