Win32 to Copy User-Selected Text

Discussion in 'Win32' started by Eidetikos, May 28, 2010.

  1. Eidetikos

    Eidetikos Banned

    Joined:
    May 28, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I've been struggling for a while now with retrieving the highlighted/selected text from a window. I've used:

    GetForegroundWindow
    GetCursorPos
    WindowFromPoint
    SendMessage(... GETTEXT...)/SendMessage(...GETSELTEXT...)

    But the best I can do is on some windows get back the entire text. In Word, IE, Firefox, etc. I get nothing back. I'm using C# to make the API calls but if anyone knows how to do it in any language, I would appreciate it.
     
  2. Mike911

    Mike911 New Member

    Joined:
    Jun 6, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    I dont use other window than mine.
    You have to use THEIR dll´s.
     
  3. Mike911

    Mike911 New Member

    Joined:
    Jun 6, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    I mean: I dont use foreign windows and their content.
    You have to include the DLLs for eg. IE or Firefox.
    Then you can retrieve a handler to that window and read the context.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice