title: How do I call EnumWindowsProc?
body: <p>I'm, trying to list all running processes on my computer. </p>
  
  <p>What is wrong with my <code>EnumWindowsProc()</code> calling statement in my short example code. My compiler claims that, in this line:</p>
  
  <pre><code>EnumWindows(@EnumWindowsProc, ListBox1);
  </code></pre>
  
  <p>that there needs to be a variable inside the function call. How should I change <code>@EnumWindowsProc</code> to a var ?</p>
  
  <pre><code>unit Unit_process_logger;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, 
    System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, 
    Vcl.ExtCtrls, Vcl.StdCtrls;
  
  type
    TForm1 = class(TForm)
      ListBox1: TListBox;
      Timer1: TTimer;
      procedure Timer1Timer(Sender: TObject);
    private
      { Private-Deklarationen }    
    public
      { Public-Deklarationen }
    end;
  
  function EnumWindowsProc(wHandle: HWND; lb: TListBox): Boolean;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  function EnumWindowsProc(wHandle: HWND; lb: TListBox): Boolean;
  var
    Title, ClassName: array[0..255] of Char;
  begin
    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, ListBox1);    
  end;
  
  end.
  </code></pre>