wenn das
handle <> 0 ist dann ist es noch da, sonst net, wenn du es zB mit findwindow suchst:
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..1024] of 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
