unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,mystr;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    Button2: TButton;
    ListBox2: TListBox;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses myproc;
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var i1:integer;
begin
ListProc:=TstringList.Create;
GetSystemInformation;
for i1:=0 to ListProc.Count-1 do ListBox1.Items.Add( ListProc.Strings[i1]);
end;

procedure TForm1.Button1Click(Sender: TObject);
var Wnd : hWnd;St1:string;
begin
St1:=ListBox1.Items[ListBox1.itemindex];
St1:=tNFi(2,St1);
Wnd:=StrToInt(St1);
ShowWindow(wnd, SW_Show);

end;

procedure TForm1.Button2Click(Sender: TObject);
var Wnd : hWnd;St1:string;
begin
St1:=ListBox1.Items[ListBox1.itemindex];
St1:=tNFi(2,St1);
Wnd:=StrToInt(St1);
ShowWindow(wnd, SW_Hide);
end;

procedure TForm1.ListBox1Click(Sender: TObject);
var Wnd : hWnd;St1:string;
begin
St1:=ListBox1.Items[ListBox1.itemindex];
St1:=tNFi(2,St1);
Wnd:=StrToInt(St1);
WHILE Wnd <> 0 DO
BEGIN
ListBox2.Items.Add(IntToStr(wnd));



Wnd := GetWindow(Wnd,gw_hWndNext);
end;

end;

end.
