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

  • SEARCH
  • Home
  • 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

The setup: I have a unmanaged/native Win32 application that I inject my code into.
What win32 calls can be used to detect key press events globally (not just
In the WIX setup I've got, when upgrading the application I have set a
I have this line /Od /D WIN32 /D _DEBUG /FD /EHa /MDd /FoDebug /FdDebug\vc80.pdb
The whole story: I have created a fancy .NET program which has an installer
Setup: firebirdsql 2.1.3 win32, php 5.3 (installed with xampp) When I try to update
I have a Win32 application that includes an EXE, an ActiveX control (DLL) and
I created a setup project with VS2005 for an application that I'm developing, which
As part of a build setup on a windows machine I need to add
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;

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.