태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.


2008/08/02 19:27

EditBox 를 클릭시 전체 선택이 되도록 하기


PreTranslateMessage() 에 다음과 같이 설정해 주면, EditBox를 클릭시 전체 선택이 된다.

BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{

    CEdit *webmacrotext = (CEdit *)GetDlgItem(IDC_WEBMACROTEXT);

    if(pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd==webmacrotext->m_hWnd &&
      GetFocus()->m_hWnd != webmacrotext->m_hWnd )
    {   
        webmacrotext->SetFocus();
        webmacrotext->SetSel(0,-1,true);

        return true;
    }   

    return CDialog::PreTranslateMessage(pMsg);

}

Trackback 0 Comment 0