Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

findwindowex and text sending and receiving

Posted on 2000-03-17
3
Medium Priority
?
328 Views
Last Modified: 2010-04-04
I want to make a program that takes text out of an editbox of a completely seperate application. ie. a Name field.

I also wish to modify this text (or complelty change it) and put this new text back into this other applications edit box.

How do i go about doing this.

Please note, i only have Delphi 4 Standard which means i don't have WinSight.

Thanks in advance.

Andrew

I will raise the points shortly when i get more.
0
Comment
Question by:frangers99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:frangers99
ID: 2630566
Adjusted points from 20 to 30
0
 
LVL 17

Accepted Solution

by:
inthe earned 120 total points
ID: 2630658
hi,
you dont need winsight cause there another program you can use called sinfo:
http://lcpx07.lc.ehu.es/JMA/win95.html 
(sinfo is very useful utility that i really recommend)
use sinfo to get the class names
then you can do like so:

Function ReadFromNotepad:string;
var h:hwnd;
    Text:string;
    NumCaracters:integer;
begin
h:=FindWindow('notepad',nil);
h:=FindWindowex(h,0,'edit',nil);
if h<>0 then begin
             NumCaracters:=SendMessage(h,wm_getTextLength,0,0);
             setlength(text,NumCaracters);
             SendMessage(h,wm_getText,NumCaracters+1,Integer(text));
             result:=text;
             end
        else result:='ERROR!';
end;

Procedure WriteToNotepad(what:string);
var h:hwnd;
begin
h:=FindWindow('notepad',nil);
h:=FindWindowex(h,0,'edit',nil);
if h<>0 then SendMessage(h,wm_setText,0,Integer(what))
        else showmessage('Error writing to notepad!');
end;
0
 

Author Comment

by:frangers99
ID: 2630681
thanks very much for you help, the example will help me a lot i reckon.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

604 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