![]() |
FindwindowEx
huhu^^ ich will mit FindWindowEx einen string, in ein anderes fenster einfügen, doch in dem anderem fenster gibt es 4x TEdit....
Delphi-Quellcode:
geht dann nich.. weiß wer ne lösung?
var Handle: HWND;
Eingabe: string; begin Eingabe := 'alalalala'; Handle := FindWindow('TForm1', nil); Handle := FindWindowEx(Handle,0,TEdit,nil); SendMessage(Handle,WM_SETTEXT,0,Integer(Eingabe)); Weiß net obs in die Kategorie gehört sorry :) thx schonmal [edit=Luckie]Delphi-Tags eingefügt. Mfg, Luckie[/edit] |
Re: FindwindowEx
Steht in dem Edit "TEdit" drin? Btwe. Muss es heißen:
Delphi-Quellcode:
Eine Fehlermeldung wäre auch nicht schlecht.
SendMessage(Handle,WM_SETTEXT,0,Integer(@Eingabe[1]));
|
Re: FindwindowEx
keine fehlermeldung! das isses ja =(
|
Re: FindwindowEx
Zitat:
Delphi-Quellcode:
function FindControlByNumber(hApp: HWND; ClassName: string; ControlNr: Word = 1): HWND;
var i: Word; hControl: HWND; begin Result := 0; if IsWindow(hApp) then begin Dec(ControlNr); hControl := 0; for i := 0 to ControlNr do begin hControl := FindWindowEx(hApp, hControl, PChar(ClassName), nil); if hControl = 0 then Exit; end; end; Result := hControl; end; procedure SetEditText(hApp: HWND; ClassName, AText: string; EditNr: Integer); var hEdit: HWND; begin hEdit := FindControlByNumber(hApp, ClassName, EditNr); if hEdit <> 0 then SendMessage(hEdit, WM_SETTEXT, 0, Integer(PChar(AText))); end; // dem "4." Edit vom Fenster TForm1 Text senden. procedure TForm1.Button1Click(Sender: TObject); begin SetEditText(FindWindow('TForm1', nil),'TEdit','alalalala',4); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:15 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz