Autor Beitrag
Stefan-M
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 12.10.04 12:18 
Seid gegrüßt,

also ich bin so weit, dass ich ein Edit-Feld eines fremden Fensters füllen kann. zwar füllt er mir nur die Ziffern korrekt rein (bei den Buchstaben kommt nur Mist raus - also wer da schon eine Idee hat, dem sei gedankt).

Nun kommts aber. Und ich denke, ich stell mich nur zu blöd an. Es gibt noch ein Edit-Feld auf dem Fenster welches auch gefüllt werden muss, wie komme ich an das handle dieses Feldes?

Danke schonmal

Stefan
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 12.10.04 12:23 
Hi,

Ich habe mir dafür mal eine Funktion geschrieben:

// hWin: Handle des Parent Controls/Fensters
// ControlClassName: Klassenname des zu suchenden Controls
// Nr. des Controls, (Wenn es mehrere Controls dieser Klasse gibt)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function FindControlByNumber(hWin: HWND; ControlClassName: string; ControlNr: Word = 1): HWND; 
var 
  i: Word; 
  hControl: HWND; 
begin 
  Result := 0; 
  if IsWindow(hWin) then 
  begin 
    Dec(ControlNr); 
    hControl := 0; 
    for i := 0 to ControlNr do 
    begin 
      hControl := FindWindowEx(hWin, hControl, PChar(ControlClassName), nil); 
      if hControl = 0 then 
        Exit; 
    end; 
  end; 
  Result := hControl; 
end;


Zuletzt bearbeitet von toms am Di 12.10.04 12:24, insgesamt 1-mal bearbeitet
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 12.10.04 12:23 
Stefan-M Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 12.10.04 12:40 
danke für den Code. Funktioniert einwandfrei. Jetzt werd ich erstmal lesen und versuchen zu verstehen, was der veranstaltet.
Das mit den Buchstaben hat sich auch geklärt. Die kommen jetzt gut rüber.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 12.10.04 12:44 
Zitat:
Das mit den Buchstaben hat sich auch geklärt.


Wie genau füllst du denn das Edit Feld?
Stefan-M Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 12.10.04 15:33 
das Edit-Feld fülle ich mit

ausblenden Quelltext
1:
SendMessage(wnd,WM_SETTEXT,0,Longint(PChar('Text')));					


hab vorher eine riesige Prozedur gefunden gehabt, die einzelne Zeichen übermittelt. Das war aber für diese Zwecke ein Schuss mit Kanonen auf Spatzen.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 12.10.04 15:49 
Zitat:
WM_SETTEXT


Ja das ist so ok.