Get text selection?

This is a discussion on Get text selection? within the Windows Programming forums, part of the Platform Specific Boards category; What i am trying to do is copy the text that is currently selected in a richedit control into a ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    24

    Get text selection?

    What i am trying to do is copy the text that is currently selected in a richedit control into a buffer. One way to do this would be use EM_GETSEL to get what the current selection is. Then use GetWindowText() to get all the text out of the edit and pull out the selection that way.
    But i have a feeling there's an easier way to do it.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Try EM_GETSELTEXT.

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    24
    thanks for that. I looked on msdn for an edit controls messages but not rich edit, silly really.
    i have another question regarding rich edits, how can i insert pictures without using that STREAMOUT, STREAMIN stuff, because i tried that and it was nothing but trouble.

    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Appending text to an edit control
    By dit6a9 in forum Windows Programming
    Replies: 3
    Last Post: 08-13-2004, 10:52 PM
  2. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 01:35 AM
  3. Scrolling The Text
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 07-14-2002, 05:33 PM
  4. Replies: 1
    Last Post: 07-13-2002, 06:45 PM
  5. random selection of words from a text file
    By archie in forum C++ Programming
    Replies: 0
    Last Post: 03-02-2002, 12:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21