Autor Beitrag
OliverN_26
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 252

Win7 64-Bit, WinXP SP3
Delphi 7 Enterprise
BeitragVerfasst: So 26.03.06 05:07 
Hi,

kann mir einer sagen wie der handle beim Mozilla FireFox heisst?
Verwende ne PostMessage Anweisung um Explorer Fenster zu schliessen.
Beim Microsoft Explorer heisst der "IEFRAME".
Brauch das jetzt nur noch für den Mozilla...

Danke
Ydobon
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 42



BeitragVerfasst: So 26.03.06 13:26 
Hi,

das Handle ist das Ergebnis, was du von FindWindow bekommst, nur ein Cardinalwert, der jedesmal anders ist.
"IEFrame" ist der Name der Fensterklasse, bei Mozilla "MozillaUIWindowClass".
Wenn du in der Nähe von FindWindow dir die Funktionen EnumWindows und GetClassName anschaust, kannst du so etwas mit wenigen Kodezeilen selbst ermitteln.
Je nach Version kannst du auch von Borland WinSight oder von der Konkurrenz Spy++ haben, damit findet man so etwas auch.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 26.03.06 14:10 
user profile iconYdobon hat folgendes geschrieben:
Je nach Version kannst du auch von Borland WinSight oder von der Konkurrenz Spy++ haben, damit findet man so etwas auch.

Oder aber du nimmst meinen [url=www.x-spy.net]X-Spy[/url] :zwinker:

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

Win7 64-Bit, WinXP SP3
Delphi 7 Enterprise
BeitragVerfasst: So 26.03.06 21:19 
@Motzi
Deine Software habe ich schon gefunden. Nur irgendwie klappt das net.
Ich geb euch mal den Code. Was mach ich denn falsch?

procedure TForm1.Timer4Timer(Sender: TObject);
var wnd: HWnd;
begin
//Microsoft Internet Explorer
wnd := FindWindow('IEFrame', nil);
PostMessage(wnd, WM_CLOSE, 0, 0); <---- klappt super


//Mozilla FireFox
wnd := FindWindow('MozillaUIWindowClass', nil);
PostMessage(wnd, WM_CLOSE, 0, 0); <---- klappt nicht :-(
end;
Ydobon
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 42



BeitragVerfasst: So 26.03.06 22:05 
Keine Ahnung, wenn ich deinen Code einfach in mein Programm kopiere, dann verabschieded sich Mozilla, wie es sich gehört.
Bekommst du überhaupt das richtige Handle? Frag mal ab, ob wnd=0. Hast du mehrere Fenster offen?
OliverN_26 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 252

Win7 64-Bit, WinXP SP3
Delphi 7 Enterprise
BeitragVerfasst: So 26.03.06 22:10 
Also wnd ist 0. Egal ob ich 1 oder mehrere Fenster auf habe.
Versteh das nicht...
OliverN_26 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 252

Win7 64-Bit, WinXP SP3
Delphi 7 Enterprise
BeitragVerfasst: Mo 27.03.06 20:32 
OK ... war ein Schreibfehler :-)
Es heißt nicht 'MozillaUIWindowClass', sondern 'MozillaWindowClass' :-?

@Motzi --> thx for your Program. Ist echt geil. Hätte ich mich am Anfang mehr damit beschäftigt, wäre dieser Post gar nicht nötig gewesen ...