CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2022

    WinAPI, Working with text


    I am somewhat new to both C++ and Win32 (also to this forum), Currently I am stuck with a program and don't know the approach to take.

    I have a child window with text displayed. I would like to move the mouse to a section of text, hit the left key and highlight (select) some of the text. So far, I know about WM_LBUTTONDOWN and how to capture the window X & Y position. I have found some reference to DragDetect. How should the text be hilighted? Is the window erased and drawn each small movement? I suspect there is some API that just does most of the work (?)

    I would appreciate some help with a general overview of how a passage of text is identified/highlighted using as few resources as possible.

    Thank you

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: WinAPI, Working with text

    1. What type (class) of the "child window" are you using? For instance, if it is a STATIC control then it is impossible to select/highlight a text in it.
    2. Yes, the window is erased and redrawn by movement.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width