Autor Beitrag
Devion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

XP
V7.0
BeitragVerfasst: Sa 30.10.04 15:47 
hi !

Kann ich den Inhalt meiner Textbox in die Textbox einer Fremdanwendung senden ?

PS: Bin absoluter Anfänger... :roll:

Vielen Dank im Voraus !!!

Gruß DeVion
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Sa 30.10.04 15:58 
Ich sage einfach mal, und gewissen Umständen ist es vielleicht möglich. Dazu hätte ich folgende Fragen:

1.) Was ist eine Textbox? Ein Memo?
2.) Was ist die Fremdanwendung? Was spezielles wie z.B. Notepad oder allgemein?

Auf jedenfall ist die Lösung Anfänger-ungeeignet, das kann ich dir gleich sagen. ;-) Versuchen können wirs aber trotzdem ...

Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
Devion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

XP
V7.0
BeitragVerfasst: Sa 30.10.04 16:22 
1) ein textfeld (edit 1).
2) es ist ne Anwendung in der ich Namen,Adresse und so zeug reinschreiben muss...
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 30.10.04 16:29 
Hi,

Zuerst musst du nach dem Handle des Textfeldes suchen.
Mit Suche in: Delphi-Forum, Delphi-Library FINDWINDOSEX oder Suche in: Delphi-Forum, Delphi-Library ENUMCHILDWINDOWS()

Dann kannst du mit SendMessage den Text des Textfeldes setzen;

ausblenden Delphi-Quelltext
1:
 SendMessage(Handle_des_Textfeldes , WM_SETTEXT, 0, Integer(PChar('Dein_Text')));					
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Sa 30.10.04 16:34 
Hmm, dann muss dieses Beispiel anhand von Notepad genügen. Vielleicht kannst du es ja umbauen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var
  a : Integer;
  Handle : HWND;
  s : string;
begin
  s:='Mustermann';
  Handle:=FindWindow('notepad',nil);
  if Handle <> 0 then
  begin
    Handle:=FindWindowEx(Handle,0,'Edit',nil);
    if Handle <> 0 then
      for a:=1 to Length(s) do SendMessage(Handle,WM_CHAR,Word(s[i]),0);
  end;
end;


Gruß,
Jörg

Edit: War jemand schneller. Am besten du mischst beide Beiträge und quetschst die Essenz raus. ;-)

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 30.10.04 17:12 
Also WM_SETTEXT ist sicher besser als für jeden Buchstaben eine WM_CHAR-Message zu schicken..! ;)

Und was das Fenster-Handle betrifft.. am einfachsten du ladest dir meinem [url=www.x-spy.net]X-Spy[/url] runter, mit dem kannst du dir den FindWindow-Code für die Edits automatisch erstellen lassen.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Albanac
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 01.11.04 15:31 
Kann ich auf ähnliche weise auch ein Button pressen oder ein Form im Fenster schliessen?