Solved

Edit Handle of Notepad

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 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