text Selection in CView

Where can I a find a sample or something on implementing
text selection in a CView (must be CView, text color
inverted from black to white when selected etc...)
searchingAsked:
Who is Participating?
 
zhongbingConnect With a Mentor Commented:
only a skeleton here:
1. message map ON_LBUTTONDOWN
               ON_LBUTTONUP
               ON_MOUSEMOVE
   and add 2 member variable : begin selection flag
                         and   begin selection point

2. in OnLButtonDown
    set the select flag true and begin select point
    SetCapture to track mouse even if it out the current windows
3 in OnMouseMove
    compute the select text, use the begain selecting piont and current mouse point, be cafullly if mouse point outside the window.
     reverse draw the text ( maybe use CClientDC or call invalidate() to let the OnPaint redraw)
4 in OnLButtonUp
     set the selection flag false
0
All Courses

From novice to tech pro — start learning today.