17 Ağustos 2011 Çarşamba

Çalışan proğramları listeleme


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

procedure TForm1.Button1Click(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc, Integer(Listbox1));
end;

Hiç yorum yok:

Yorum Gönder