Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Edit Handle of Notepad

Posted on 1998-11-12
5
Medium Priority
?
334 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 100 total points
ID: 1346667
heh , thanx :)

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

963 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