Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 93367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:20:00+00:00 2026-05-10T23:20:00+00:00

In win32, how do I setup a callback mechanism for RichEdit I have not

  • 0

In win32, how do I setup a callback mechanism for RichEdit I have not created myself?

PART 1

I’m reading from a textedit field in another application’s GUI. This works just fine now, except after the first read I’d like to fetch only new or modified lines. In GTK+ or Qt I’d just install a callback on some signal the field edits when its changed, but how does it work on Win32?

My MSDN searches result with nothing useful, probably because I don’t know the exact term to search for. The class of the textedit is RichText20W, and it has some messages that are probably used somehow, though that article just discusses using them for the parent of the class.

PART 2

Also, if there is no such ‘text changed, here is the newly inserted text’ callback which returns the new content immediately, I need some way to easily detect what is new. From top-of-my-head:

  1. Have a marker at the end of the text block we’ve read, and only read between that and the end.
  2. Store what we’ve read previously, and after a second read, remove the duplicate part from the latter to have the newly inserted stuff.

Option 2 might not be viable, since the textedit can contain any amount of text. The marker part sounds doable, but yet again, my feeble Win32 skills and horrible Win32 function names prevent me from finding the right way to do it.

Note that all these must be doable for a textedit I do not own and have not created, they belong to a third party process.

Code samples in C++ highly appreciated.

Disclaimer

Obviously, if there is some better way of doing it, let me know. I only assumed callback would be the way to go based on my previous experience with GTK+/Qt. Feel free to show me the path 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:20:00+00:00Added an answer on May 10, 2026 at 11:20 pm

    Win32 controls don’t work on message-specific callbacks that you can subscribe to. They just send messages to their parent window when something happens, in this case EN_UPDATE, EN_CHANGE and all that. Even these events don’t tell you what text changed. They only tell you that it did change.

    You could subclass the parent, but the documentation for SetWindowLongPtr explicitly says you ‘should not subclass a window class created by another process.’ Something like this is probably possible with hooks, but I haven’t used them enough to say for certain how you’d actually do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two Win32 API programs written in plain C: Program A and program
I need to append text to win32 edit control i have working function to
I have a program that runs in the Win32 environment. There is one variable
I am introducing myself to using Hooks in Win32 C++ (specifically KeyboardHooks) & I
What is the best way to set up a window in win32 that has
Started looking at the win32 API on this site: http://www.winprog.org/tutorial/start.html I've literally just compiled
I just downloaded eclipse-java-helios-SR2-win32-x86_64.zip extracted the zip. When i'm trying to run i get
I am retrieving the environment variables in win32 using GetEnvironmentStrings() . It returns a
A standard c++ qmake-based library is developed for Win32, Mac, and Linux. In the
I am trying to call an executable inside of a worker role I tried

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.