Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mi 09.05.07 22:49 
Hallo,

über
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
h := Handle;
while h > 0 do
begin
  if IsWindowVisible(h) then
    PostMessage(h, WM_SYSCOMMAND, [b]SC_CLOSE[/b], 0);
  h := GetNextWindow(h, GW_HWNDNEXT);
end;

möchte ich alle aktiven Fenster schließen. Das geht auch ganz gut. Es werden beinahe alle Fenster geschlossen. Allerdings werden geöffnete Ordner (sprich explorer.exe) und Internet Explorer Fenster (iexplore.exe) nicht davon getroffen.

Woran könnte das liegen ?
Und gibt es eventuell eine andere Möglichkeit, das zu bewerkstelligen ?

Danke schonmal.

Ciao LHUser


Zuletzt bearbeitet von LonghornUser am Mo 14.05.07 16:03, insgesamt 2-mal bearbeitet
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 10.05.07 10:15 
Hallo,

"Woran könnte das liegen ?", kA

Ich sende die entsprechenden Tasten:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure MinimizeAll; 
begin 
  KeyBd_Event(VK_LWIN, MapvirtualKey(VK_LWIN, 0), 00); 
  KeyBd_Event(Ord('M'), MapvirtualKey(Ord('M'), 0), 00); 
  KeyBd_Event(Ord('M'), MapvirtualKey(Ord('M'), 0), KEYEVENTF_KEYUP, 0); 
  KeyBd_Event(VK_LWIN, MapvirtualKey(VK_LWIN, 0), KEYEVENTF_KEYUP, 0); 
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 10.05.07 22:10 
Win+M minimiert aber nur alle Fenster. Ich hingegen möchte alle Fenster schließen, sprich an alle ein Alt+F4 senden.
Das klappt mit o.g. Funktion auch, nur nicht bei Explorer und Internet Explorer Fenstern.

Weiß jemand Rat ?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 10.05.07 22:20 
Titel: Re: Alle offnen Fenster schließen
Hallo,
user profile iconLonghornUser hat folgendes geschrieben:
...möchte ich alle aktiven Fenster minimieren. Das geht auch ganz gut. Es werden beinahe alle Fenster minimiert.
:gruebel:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Do 10.05.07 23:26 
Ohhh. Mist. Meinte natürlich "schließen" wie im Betreff. War ziemlich müde an dem Tag ;)

Habs im ersten Beitrag geändert.

Kann mir da jetzt jemand helfen ?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 10.05.07 23:36 
Hallo,

hilft Dir das beim IE weiter?
[url=www.delphipraxis.net...t146644.html#146644]DP: IE schließen[/url]

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 11.05.07 08:45 
Hallo,

hab mal Deinen Code getestet, er schließt alle Fenster, IE, Explorer ...

Testumgebung:
- Windows XP Professional Version 2002 SP 2
- Internet Explorer 6.0.2900.2180.xpsp_sp2_gdr.070227-2254

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 14.05.07 16:02 
Ah. Habe jetzt den "Fehler" gefunden. Es werden nur geöffnete Fenster geschlossen. Die minimierten nicht.
Entgegen des vorherigen Titels (habe ihn angepasst), wollte ich eigentlich, dass ALLE Fenster geschlossen werden, auch die minimierten.
Geht sowas ?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 14.05.07 16:15 
Hallo,

also bei mir schließt Dein Code ALLE Fenster, auch die minimierten.

Findet oder schließt Dein Code die Fenster nicht?
Lass Dir doch mal die Anzahl der gefundenen Fenster ausgeben.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )