Autor Beitrag
Mindforce
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Fr 16.03.07 18:57 
Hi,

ich hab da mal ne Frage. Undzwar: Wie kann ich meine gesammten Fenster die Offen sind überprüfen ob sie eine bestimmte Caption haben? Ich konnte den Code mal hat auch was mit "for"?! zu tun!
War eigentlich ganz simpel!

Gruss,

M!ndforce

_________________
Our force; in mind.
rizla
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 417
Erhaltene Danke: 2

XP
FPC mit Lazarus
BeitragVerfasst: Fr 16.03.07 19:16 

_________________
if you have what they want - they'll find a way to take it (bruce sterling)
WOW - 10 JAHRE Mitglied beim Delphi-Forum. Wie die Zeit vergeht, Freunde.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Fr 16.03.07 19:22 
Warum nicht einfach so?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
function IsWindowOpen(Caption: String): Boolean;
begin
  IsWindowOpen := FindWindow(nil, Caption) > 0;
end;
rizla
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 417
Erhaltene Danke: 2

XP
FPC mit Lazarus
BeitragVerfasst: Fr 16.03.07 19:24 
nee, er will fenster "ohne Rückmeldung" finden, sprich "taskxyz - Keine Rückmeldung", wie ich per icq erfahren durfte ;) also alle fenster enumerieren und dann check, is schon geklärt.

:r:

_________________
if you have what they want - they'll find a way to take it (bruce sterling)
WOW - 10 JAHRE Mitglied beim Delphi-Forum. Wie die Zeit vergeht, Freunde.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mo 26.03.07 09:34 
Hi,

ich sitz jetzt eine Woche an diesem EnumWindow und das ist nicht das richtige. Ich krieg dauernd Zugrifsverletzung.

Ich erkläre nochmal :P

Ich möchte ALLE Prozesse die Laufen und sonst noch was was es gibt ^^ die Caption aller Fentser prüfen!
Undzwar das ende der Caption ("(keine Rückmeldung)").

Bitte helft mir! :eyes:

Mindforce

_________________
Our force; in mind.
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Mo 26.03.07 11:33 
user profile iconMindforce hat folgendes geschrieben:
Bitte helft mir! :eyes:

Wenn du dich dann entschließt, die Sache auch hier im Forum zuende zu bringen - und nicht per ICQ oder sonstwas -, dann könnte das vielleicht was werden.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Di 27.03.07 00:14 
Hi,

also. Er ist schon seid längerem in meiner ICQ Liste. Und dann hat er mir einfach geschreiben. Mir trifft also nicht die Schuld zu. Und ausserdem hätte ich euch sowieso die Lösung gepostet. "Ihr" braucht sie ja auch.
Aber ich mach das auch nicht über ICQ. Ist nicht meine Art :wink:

Mindforce

_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Di 27.03.07 02:32 
Das EnumWindows von Torry muss aber funktionieren...es sei denn du führst es mit Win98 aus. Zeig mal deinen Code.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Di 27.03.07 09:47 
Ok^^ Hier ist die Pascal...
Einloggen, um Attachments anzusehen!
_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 28.03.07 12:14 
Wieso rufst du die EnumWindows Funktion nicht einfach genauso aus wie auf Torry beschrieben wurde?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function EnumWindowsProc(wHandle: HWND; lb: TListBox): Bool; stdcall; export;
var
  Title, ClassName: array[0..255] of char;
begin
  Result := True;
  GetWindowText(wHandle, Title, 255);
  GetClassName(wHandle, ClassName, 255);
  if IsWindowVisible(wHandle) then
     lb.Items.Add(string(Title) + '-' + string(ClassName));
end;

//Call
EnumWindows(@EnumWindowsProc, Integer(Listbox1));


Und schon hast den ganzen kram in der Listbox1 stehen. Keine Ahnung was du das versucht hast zu implentieren...

Dann gehst du die Listbox (oder besser Stringlist) per For-Schleife durch und überprüfst mit Pos ob Keine Rückmeldung am Ende steht! Sollte doch zu machen sein... ;)
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mi 28.03.07 13:08 
Hi,

ich glaub ich mach was falsch. Wie kann ich die Direktive Overload deklarieren? :oops:

Mindforce

_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 28.03.07 19:58 
Was willst du denn jetzt mit Overload? :lol: Du brauchst hier garnichts zu deklarieren!

Setzt mal deine Gedankenkraft (und strg+c) ein und kopier dir einfach den Quelltext in deine Unit und ruf ihn mit dem dabeistehendem Befehl auf. Kanns sein das du das ganze komlizierter siehst als es ist? ;)
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mi 28.03.07 21:07 
Ich habs oeben bei "private" deklariert und in einem Timer eingebaut also der aufruf.
Und dann sagt er mir das.

[Fehler] killerpas.pas(64): E2254 Die überladene Prozedur 'EnumWindowsProc' muss mit der Direktive 'overload' gekennzeichnet sein

Mindforce :wink:

_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 28.03.07 21:18 
Du musst hier nicht forwarden!

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    ListBox1: TListBox;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


function EnumWindowsProc(wHandle: HWND; lb: TListBox): Bool; stdcall; export;
var
  Title, ClassName: array[0..255] of char;
begin
  Result := True;
  GetWindowText(wHandle, Title, 255);
  GetClassName(wHandle, ClassName, 255);
  if IsWindowVisible(wHandle) then
     lb.Items.Add(string(Title) + '-' + string(ClassName));
end;



procedure TForm1.Timer1Timer(Sender: TObject);
begin
 listbox1.Items.clear;
 EnumWindows(@EnumWindowsProc, Integer(Listbox1));
end;


Einfach unter Implementation einfügen. Musst nur drauf achten, dass der Call im Quelltext irgendwann nach der Funktion steht.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mi 28.03.07 21:19 
Hi

Aber trotzdem sagt er das eine Variable fehlt :P
[Fehler] killerpas.pas(263): E2036 Variable erforderlich

Mindforce :lol:

_________________
Our force; in mind.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mo 02.04.07 20:30 
*PUSH*

_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mo 02.04.07 20:36 
Du bist doch jetzt auch nicht erst seit gestern dabei! :)

Woher soll irgendjemand von uns wissen was bei dir in Zeile 263 steht?

Poste den relevanten Quellcode, dann schau wir mal.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mo 02.04.07 21:02 
Aja sorry ^^

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
263: EnumWindowsProc(@EnumWindowsProc,>>>Err?<<< Integer(Apps));

159 - 168: function TMainWindow.EnumWindowsProc(wHandle: HWND; lb: TListBox): Bool; stdcall; export;
var
  Title, ClassName: array[0..255] of char;
begin
  Result := True;
  GetWindowText(wHandle, Title, 255);
  GetClassName(wHandle, ClassName, 255);
  if IsWindowVisible(wHandle) then
     apps.Items.Add(string(Title) + '-' + string(ClassName));
end;


Ich weiss genau das ich irgendetwas falsch mache...
Weil kein Code den ich deklariert habe funktioniert weil eine Variable fehlt! :P

Mindforce

_________________
Our force; in mind.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mo 02.04.07 21:15 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
//mein Aufuf:
  EnumWindows(@EnumWindowsProc, Integer(Apps)); 

//dein Aufruf:
  EnunWindowsProc(@EnumWindowsProc, Integer(Apps));


Fällt dir was auf?


edit: Kopier die Function einfach so wie geschrieben...du brauchst in ihr nichts anzupassen und auch nicht forwarden.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
159 - 168: function TMainWindow.EnumWindowsProc(wHandle: HWND; lb: TListBox): Bool; stdcall; export;  
var  
  Title, ClassName: array[0..255] of char;  
begin  
  Result := True;  
  GetWindowText(wHandle, Title, 255);  
  GetClassName(wHandle, ClassName, 255);  
  if IsWindowVisible(wHandle) then  
     apps.Items.Add(string(Title) + '-' + string(ClassName));  
end;


Ist nicht notwendig. Du übergibst du bereits die Listbox im Header. Den Forward kannst du dir auch sparen wenn du form1.apps schreiben würdest.
Mindforce Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 358

Win XP Pro / MCE, Win 98, Slax (Linux)
Delphi 07 PRO, Delphi 3+7 (mit Prdx)
BeitragVerfasst: Mo 02.04.07 22:27 
//edit: NAchdem ich diesen *** oben "deklariert" habe bei "privat" gehts. ?!

Also. Ich habn Brett vorm Kopf :-!

[Fehler] killerpas.pas(234): E2003 Undefinierter Bezeichner: 'EnumWindowsProc'
[Fehler] killerpas.pas(234): E2029 ';' erwartet, aber '(' gefunden
[Fehler] killerpas.pas(238): E2003 Undefinierter Bezeichner: 'Result'
[Fehler] killerpas.pas(239): E2003 Undefinierter Bezeichner: 'wHandle'
[Fehler] killerpas.pas(242): E2003 Undefinierter Bezeichner: 'apps'
[Fehler] killerpas.pas(242): E2066 Operator oder Semikolon fehlt
[Fehler] killerpas.pas(249): E2003 Undefinierter Bezeichner: 'EnumWindowsProc'

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
234: function TMainWindow.EnumWindowsProc(wHandle: HWND; lb: TListBox): Bool; stdcall; export;
...: var
     Title, ClassName: array[0..255] of char;
      begin
     Result := True;
     GetWindowText(wHandle, Title, 255);
     GetClassName(wHandle, ClassName, 255);
     if IsWindowVisible(wHandle) then
     apps.Items.Add(string(Title) + '-' + string(ClassName));


end;


Kopiert nix verändert...

Wer realVNC hat der kriegt meine IP. //edit: mindbyte.homeip.net:5900

Nein spass. Wieso gehts nicht? :autsch:

Mindforce

_________________
Our force; in mind.


Zuletzt bearbeitet von Mindforce am Mo 02.04.07 22:32, insgesamt 1-mal bearbeitet