richedit 已经使用EM_AUTOURLDETECT识别了超链接,可是鼠标移上去不变成手形,如何实现?

解决方案 »

  1.   

    oninitialupdate中 // Unregister this edit control as a potential target for OLE drag-and-drop
    //
    ::RevokeDragDrop(m_hWnd); //带下滑线链接
    GetRichEditCtrl().SetEventMask( GetRichEditCtrl().GetEventMask () | ENM_LINK );
      

  2.   

    SetEventMask(dwMark)已经写了,已经有下划线了,仅仅是不变手形,
      

  3.   

    以前的代码里面,有好多被修改的地方
    1)加载了richedit20.dll
    2)设置richeditview的classname为"RICHEDIT20W"
    3)oninitialupdate中
    void CSnooperView::OnInitialUpdate()
    {
    CRichEditView::OnInitialUpdate(); // Unregister this edit control as a potential target for OLE drag-and-drop
    //
    ::RevokeDragDrop(m_hWnd); //带下滑线链接
    GetRichEditCtrl().SetEventMask( GetRichEditCtrl().GetEventMask () | ENM_LINK ); // Set the printing margins (720 twips = 1/2 inch).
    SetMargins(CRect(720, 720, 720, 720));
    }
    4)
    BOOL CSnooperView::PreCreateWindow(CREATESTRUCT& cs)
    {
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs if( !CRichEditView::PreCreateWindow( cs ) )
    {
    TRACE( _T( "Failed CRichEdtView::PreCreateWindow\r\n" ) );
    return FALSE;
    } cs.style |= ES_SELECTIONBAR; if( g____richedit2 )
    {
    #ifndef _UNICODE
    cs.lpszClass = RICHEDIT20A;
    #else
    cs.lpszClass = RICHEDIT20W;
    #endif
    } return TRUE;
    }TCHAR *RICHEDIT20W = _T( "RICHEDIT20W" ); rich = LoadLibrary( _T( "RICHED20.DLL" ) );
    if( NULL == rich )
    {
    g____richedit2 = 0;
    }
    else
    {
    g____richedit2 = 1;
    FreeLibrary( rich );
    }自己看着挑去吧。