...alle Verzeichnisse, Dateien und Laufwere in einer Listbox anzeigen?

Autor: GPS

Kategorie: VCL

procedure TForm1.Button1Click(Sender: TObject);
var
   
D: PChar;
begin
   
D := 'C:\*.*';
   SendMessage(ListBox1.Handle,
               LB_DIR,
               DDL_ARCHIVE +
               DDL_DIRECTORY +
               DDL_DRIVES +
               DDL_EXCLUSIVE +
               DDL_HIDDEN +
               DDL_READONLY +
               DDL_READWRITE +
               DDL_SYSTEM,
               Integer(D));
end;

//Oder:
//Or:

procedure TForm1.Button2Click(Sender: TObject);
var
  
D: PChar;
begin
   
D := 'C:\*.*';
   ListBox2.Perform(LB_DIR,
                    DDL_ARCHIVE +
                    DDL_DIRECTORY +
                    DDL_DRIVES +
                    DDL_EXCLUSIVE +
                    DDL_HIDDEN +
                    DDL_READONLY +
                    DDL_READWRITE +
                    DDL_SYSTEM,
                    Integer(d));
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base