Autor Beitrag
CodeRed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Fr 18.03.05 18:16 
Hi!
ich weiß, dass es solche sachen schon mehrmals gab, ich hab's aber immer noch nicht geschafft.
Hier mein Problem:
Ich möchte eine Textzeile an IRC schicken, die dann verschickt werden soll.

Mit WinSpy hab ich folgendes über die Eingabezeile im IRC bekommen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var 
wnd: HWND; 
begin 
wnd := FindWindow('mIRC','mIRC OCRANA-IRC - [#perles-ds]'); 
wnd := FindWindowEx(wnd, 0, 'MDIClient', nil); 
wnd := FindWindowEx(wnd, 0, 'mIRC_Channel', nil); 
wnd := FindWindowEx(wnd, 0, 'Edit', nil); 
if wnd <> 0 then 
begin 
// ShowMessage('Window found. Handle: ' + IntToStr(wnd)); 
writeln('Window found. Handle: ' + IntToStr(wnd)); 
FlashWindow(wnd); 
end; 
end.


Nun 2 fragen:
1.) wie sende ich nun an dieses EditFeld einen Text??
2.) der name des fensters ist leider immer unterschiedlich (aber nur das in den eckigen klammern). gibt es eine möglichkeit, wie ich das umgehen kann??

Ich danke jetzt gleich mal für eure hilfe! und nochmal sorry, aber ich bin echt auf keine lösung gekommen!
MfG
CodeRed

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Fr 18.03.05 18:27 
@2. : Kann man da regular expressions benutzen? :roll:

mfg matze

_________________
si tacuisses, philosophus mansisses.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 18.03.05 18:32 

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
CodeRed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Fr 18.03.05 20:44 
ok, teil 1 konnte ich nun fast vollständig lösen.
nur noch eine frage dazu: wie kann ich die Enter-Taste simulieren??


auf die zweite frage hab ich noch keine lösung...
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 18.03.05 20:48 
die antwort auf frage 2 ist die prozedur findwindowbytitle.
da dort mit pos gearbeitet wird, kannst du einen beliebigen teil des fensternamens hernehmen.

antworten zu frage 1 und enter usw findest du hier Suche in: Delphi-Forum, Delphi-Library SENDKEYS

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Lesco
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 42



BeitragVerfasst: Di 22.03.05 20:28 
user profile iconCodeRed hat folgendes geschrieben:
ok, teil 1 konnte ich nun fast vollständig lösen.
nur noch eine frage dazu: wie kann ich die Enter-Taste simulieren??


auf die zweite frage hab ich noch keine lösung...


auf swissdelphicenter.ch unter tippsuche mal Tastendruck eingeben
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Di 22.03.05 21:02 

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
CodeRed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 2000
D7 Pers
BeitragVerfasst: Do 24.03.05 10:42 
ich hab's jetzt so gelöst:

wnd ist vom Typ HWND
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
wnd := FindWindowByTitle('mIRC OCRANA-IRC');
wnd := FindWindowEx(wnd, 0, 'MDIClient', nil);
wnd := FindWindowEx(wnd, 0, 'mIRC_Channel', nil);
wnd := FindWindowEx(wnd, 0, 'Edit', nil);
if wnd <> 0 then
begin
  SendMessage(wnd,WM_SETTEXT,0, integer(pchar(zeile_irc)));  //Text (zeile_irc) senden
  SendMessage(wnd,WM_Char,VK_Return,0); //Enter Taste simulieren
end;


Danke für eure Hilfe!!

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.