Solved

Edit Handle of Notepad

Posted on 1998-11-12
5
325 Views
Last Modified: 2012-08-13
I have the handle of edit for notepad, how can I monitor what has been written on notepad. I tried using a DC handle, all I can do is write to notepads edit clipboard.
0
Comment
Question by:npatel
  • 2
  • 2
5 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1346663
You could use a timer that calls WM_GETTEXT. If you don't like that you'll have to write a system wide hook by calling SetWindowsHookEx (must be in a dll). If you want that, please look at "http://www.experts-exchange.com/Q.10096444".

Regards, Madshi.
0
 
LVL 1

Expert Comment

by:jecksom
ID: 1346664
Ohhh , i'm late again , don't wanna throw my code in trashcan , so maybe it help :

procedure TForm1.Button1Click(Sender: TObject);
var buf:array [0..256] of char;
wnd:hwnd;
begin
wnd:=findwindow('Notepad',nil);
if wnd=0 then
showmessage('run notepad and type something!')
else
begin
wnd:=getwindow(wnd,GW_CHILD);
while wnd<>0 do
begin
sendmessage(wnd,wm_gettext,256,longint(@buf));
memo1.lines.add(buf);
wnd:=getwindow(wnd,GW_HWNDNEXT);
end;end;end;

Jecksom

0
 

Author Comment

by:npatel
ID: 1346665
Jecksom,

Your sample code works, I think both Madshi and You have the correct solution to my problem.

I don't know who gets the points on this one?.

 


0
 
LVL 20

Expert Comment

by:Madshi
ID: 1346666
Jecksom gave you a little example. So give the points to him...
0
 
LVL 1

Accepted Solution

by:
jecksom earned 50 total points
ID: 1346667
heh , thanx :)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now