473,748 Members | 8,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Caputring Text From a 3rd Party RichEdit Chat Window

Hi All,

I want to capture / read the text flowing through a chat window that
is part
of an external application. I should note that I don't just want to
capture
the text in the chat window once, I want to get the new text as and
when it
is posted into the chat window

I have little knowledge of the windows api so a simple explanation or
sample
code would be much appreciated.

Adam

Nov 17 '05 #1
2 1671
Hi Adam,
What you need to do is first get the window's HWND
i.e:
HWND mywindow = ::FindWindow("M yWindowClassNam e", "WindowTitleNam e"); <<
Note that either parameter can be set to NULL, but not both.
Then you use FindWindowEx() using the parent HWND, in this case, mywindow in
order to get to the edit box you want to get text from.

Once you've gotten to the HWND of the edit box you can get the text by
doing the following:

::SendMessage(w ndofeditbox,WM_ GETTEXT,strlen( mytext),LPARAM( mytext));

where mytext is a variable i.e char[], to hold string data. And there you
have the editbox's data

As for constantly updating it: I reccomend using Threading. devote a worker
thread to update the text I believe that would be best.

callbacks & threading:

http://www.flounder.com/callbacks.htm

info on findwindowex:
http://www.google.com/search?hl=en&i...q=findwindowex

Jon

"oracle3001 " <or********@yah oo-dot-com.no-spam.invalid> wrote in message
news:41******** **@Usenet.com.. .
Hi All,

I want to capture / read the text flowing through a chat window that
is part
of an external application. I should note that I don't just want to
capture
the text in the chat window once, I want to get the new text as and
when it
is posted into the chat window

I have little knowledge of the windows api so a simple explanation or
sample
code would be much appreciated.

Adam

Nov 17 '05 #2
"oracle3001 " <or********@yah oo-dot-com.no-spam.invalid> wrote in message
news:41******** **@Usenet.com.. .
I want to capture / read the text flowing through a chat window that
is part of an external application. I should note that I don't just want
to
capture the text in the chat window once, I want to get the new text as
and
when it is posted into the chat window
If the window is an "edit control" or a "rich edit" control then an option
to read the text is to send it a message or messages such as
WM_GETTEXTLENGT H and WM_GETTEXT. If it is something else, you'd either have
to know something about the class of window that it is or use some optical
character recognition like scheme.
I have little knowledge of the windows api so a simple explanation or
sample code would be much appreciated.


Well, then I'm sorry to tell you that this isn't easy. Sending a message to
a common control to poll it for its text is easy. To invade another process
to the point of being able to react to changes as they occur is reasonably
difficult. The usual tack would involve planting a system wide hook, doing
something to trigger the hook so that you could subclass the window and then
have the subclassed window procedure running at this point in the external
application send a notification to your application detailing the change.

It is far more to explain than can be done in a newsgroup post. If you want
to pursue this I suggest you read a good book on Windows programming along
the lines of something by Jeffrey Richter class "Advanced Windows".

Regards,
Will
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3420
by: GrantS | last post by:
I need urgent help. Done OK for a newbie getting automation of Windows Messenger into a Winform C# app but have three problems that I urgently need pointers to. Point 1 and 2 are the same issue, I think. Point 3 might relate to a threading issue: 1. I have written a C# Winform application that uses Windows messenger automation. When I attempt to send a file through the window messenger object, there is some horrid screen flicking...
5
4758
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. I modified the class keeping a majority of his code, and built a c#(.net) front end to use this c++ built core library, passing it the hook type of EM_SETTEXTEX (WM_USER + 97) and the threadID of the richedit box, his class comes up telling me...
1
2547
by: Patty O'Dors | last post by:
Hi I'm trying to create an application with a RichEdit control, I found that CreateWindow always returns a null hWnd unless I call LoadLibrary("riched20.dll") first (the error code from GetLastError is 1407 - couldn't find class). This is even when I link with comctl32.lib and call InitCommonControls. Do I HAVE to use a DLL if I want to use a richedit control, and more importantly, do I know that it will be on the target machine, and if...
10
3097
by: Patty O'Dors | last post by:
Hi In trying to create a RICHEDIT-derived ActiveX control in ATL, I've managed to successfully implement the stock font property, thanks for all your help on this. I'm now stuck on receiving notification that the text has changed. I selected a stock Text property when creating the control, which put an OnTextChanged event handler into my control's main class. This never seems to get called, even when I put code to set the event mask...
4
5483
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available in versions 3.0 or later of the class. However, also just found out that the new Rich Text property in Access 2007 ALSO does not support full text justification! This seems incredible, that MS would create a brand new application, and not...
16
11133
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might know one way or the other whether that was true or not, or could point me to an article or help text that would. What I have seen so far online and in Access 2007 help seems to confirm the above. But that (or at least (b)) seems incredible that it...
6
4015
by: =?Utf-8?B?TXJOb2JvZHk=?= | last post by:
I mught have misunderstood how SetCapture works, but I call it passing my form's Handle and I am not noticing any difference in what mouse events my app is picking up. It is only limited to mouse events within my control, which is the same way it worked with just setting a mouse event handler directly. What I desire is to capture mouse events accross the entire system, whether I click in my window or another window... SetCapture...
5
10300
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they may also open up new chat windows with other members (just not the same one). - Each chat page is opened with the member name as the window name. - When I log off from the web page, I would like all the chat windows to automatically close. I...
6
1810
by: phpmagesh | last post by:
Hi to all, I have a page which is to be automated, i explain you clearly: I have a page with 3 fields name mailid and message. what i can do with that page is i can type name mail id and message and if i sand go, the message with the name displays in the chat box. ex : here name is john, email is john.test@mymail.com
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.