Solved

Edit Handle of Notepad

Posted on 1998-11-12
5
324 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

21 Experts available now in Live!

Get 1:1 Help Now