Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Inhalte aus EnumWindow vergleichen! (https://www.delphipraxis.net/23819-inhalte-aus-enumwindow-vergleichen.html)

jAcK oRsEn 10. Jun 2004 10:03


Inhalte aus EnumWindow vergleichen!
 
Hi,

ich benutze folgenden Code um alle aktiven Programme zu listen...

Delphi-Quellcode:
function EnumWindowsProc (Wnd: HWND; LParam: LPARAM): BOOL; stdcall;
var Bezeichnung : Array[0..200] of Char;
begin
  if (IsWindowVisible(Wnd) or IsIconic(wnd)) and
     ((GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) or
     (GetWindowLong(Wnd, GWL_HWNDPARENT) = GetDesktopWindow)) and
     (GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW = 0) then begin
      GetWindowText(Wnd, Bezeichnung, 256);
    Form1.listbox1.Items.Add(Bezeichnung);
  end;
end;


procedure TForm1.Timer1Timer(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc, 1);
end;
Wie kann ich nun schauen ob die Einträge die hinzugefügt werden schon in der liste sind...
So das nur die Programme hinzugefügt werden die noch nicht gelistet sind.

Vjay 10. Jun 2004 10:23

Re: Inhalte aus EnumWindow vergleichen!
 
Delphi-Quellcode:
  GetWindowText(Wnd, Bezeichnung, 256);
  if Form1.ListBox1.Items.IndexOf( Bezeichnung) = -1 then
   Form1.listbox1.Items.Add(Bezeichnung);


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:17 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz