Autor Beitrag
Hein Blöd
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 51



BeitragVerfasst: Do 09.06.05 15:47 
Ich hab das Handle des Fensters und möchte alle paar Sekunden prüfen ob es immer noch da ist. Wie kann ich das prüfen?

_________________
nix
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 09.06.05 17:10 
wenn das handle <> 0 ist dann ist es noch da, sonst net, wenn du es zB mit findwindow suchst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
function IsHandleActive(Handle: HWND): boolean;
var
  buf: Array[0..1024of char;
  str: string;
begin
  result := false;
  windows.GetWindowText(handle, @buf, sizeof(buf));
  str := buf;
  if findwindow(nil, pchar(str)) <> 0 then
    result := true;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if IsHandleActive(Form1.Handle) then
    showmessage('Is Active!');
end;


geht aber bestimmt auch einfacher :lol:
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 09.06.05 17:20 
genau, es geht einfacher mit IsWindow

Zitat:
The IsWindow function determines whether the specified window handle identifies an existing window.

BOOL IsWindow(

HWND hWnd // handle of window
);
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 09.06.05 20:15 
stimmt so hieß das teil :lol:
Hein Blöd Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 51



BeitragVerfasst: Do 09.06.05 22:18 
Danke für die Antworten.

_________________
nix