void AccountDlg::OnNMClickSyslinkDisplayPasswod(NMHDR *pNMHDR, LRESULT *pResult) { GetDlgItem(IDC_SYSLINK_DISPLAY_PASSWORD)->ShowWindow(SW_HIDE); CEdit* edit = (CEdit*)GetDlgItem(IDC_EDIT_PASSWORD); edit->SetPasswordChar(0); edit->Invalidate(); edit->SetFocus(); int nLength = edit->GetWindowTextLength(); edit->SetSel(nLength,nLength); *pResult = 0; }
void CPortalDlg::OnBnClickedPortalShow() { // show / hide the key and change the label of the text // flip the show key flag m_fShowKey = !m_fShowKey; CEdit* e = (CEdit*)GetDlgItem(IDC_PORTAL_KEY); CButton* b = (CButton*)GetDlgItem(IDC_PORTAL_SHOW); if ( m_fShowKey ) { e->SetPasswordChar(0); b->SetWindowText(_T("Hide")); } else { e->SetPasswordChar('*'); b->SetWindowText(_T("Show")); } e->Invalidate(); }
void CEditableRange::OnSetfocusValue() { CEdit *ce = (CEdit *) GetDlgItem(IDC_VALUE); ce->PostMessage(EM_SETSEL, 0, -1); ce->Invalidate(); }