Autor Beitrag
koller1
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 216

WIN XP
D7 Ent
BeitragVerfasst: Fr 04.11.05 22:03 
Hi!

Wie schon der Titel sagt, ich möchte mit einem Programm alle Exedateien (nur mit App-namen) suchen und diese dann untereinander in eine listbox oder ein memo eintragen. geht das?

MFG
koller1

_________________
PLEASE INSERT SYSTEM DISK AND PRESS ENTER!
Und wenn du nicht gestorben bist, presst du noch heute! ;)
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 04.11.05 22:06 
Such mal nach Suche in der Entwickler-Ecke FINDFIRST und Suche in der Entwickler-Ecke FINDNEXT.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
koller1 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 216

WIN XP
D7 Ent
BeitragVerfasst: Fr 04.11.05 22:20 
www.delphi-library.d...a230805bcb2&t=94
Danke!
Habe den Link gefunden, aber wenn ich das ausführe und nach allen *.exe auf C:\ suche, sehe ich, wie die Listbox ne scrollleiste bekommt, aber ich sehe keine schrift und das programm stürzt ab! Liegts am hohen Rechenaufwand?

MFG
koller1

_________________
PLEASE INSERT SYSTEM DISK AND PRESS ENTER!
Und wenn du nicht gestorben bist, presst du noch heute! ;)
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 04.11.05 22:26 
nimm lieber eine der 3 hochoptimierten searchunits im Suche in: Delphi-Forum, Delphi-Library SEARCHTOOL thread.

alternativ gäbe es auch noch folgende lösung in der kommandozeile
ausblenden Quelltext
1:
2:
3:
c:
cd \
dir *.exe /s

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
koller1 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 216

WIN XP
D7 Ent
BeitragVerfasst: Fr 04.11.05 22:34 
Ich bleibe lieber ersteinmal bei der Funktion

ausblenden Delphi-Quelltext
1:
procedure GetFilesInDirectory(ADirectory: string; AMask: String; AList: TStrings; ARekursiv: Boolean);					


Klappt erstmal, jetzt bin ich zufrieden!
Danke!

MFG
koller1

_________________
PLEASE INSERT SYSTEM DISK AND PRESS ENTER!
Und wenn du nicht gestorben bist, presst du noch heute! ;)
koller1 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 216

WIN XP
D7 Ent
BeitragVerfasst: Sa 05.11.05 21:20 
Hi, hatte zwar gestern schon gesagt, dass es geht, habe hier aber noch ein Problem entdeckt! Die Funktion findet keine Dateien, die versteckt sind!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
procedure GetFilesInDirectory(ADirectory: string; AMask: String; AList: TStrings; ARekursiv: Boolean);
var
  SR: TSearchRec;
begin
  if (ADirectory<>'') and (ADirectory[length(ADirectory)]<>'\') then
    ADirectory:=ADirectory+'\';

  if (FindFirst(ADirectory+AMask,faAnyFile-faDirectory,SR)=0) then begin
    repeat
      if (SR.Name<>'.') and (SR.Name<>'..') and (SR.Attr<>faDirectory) then
          AList.Add(ADirectory+SR.Name)
    until FindNext(SR)<>0;
    FindClose(SR);
  end;

  if ARekursiv then
    if (FindFirst(ADirectory+'*.*',faDirectory,SR)=0) then
    begin
      repeat
        if (SR.Name<>'.') and (SR.Name<>'..') then
          GetFilesInDirectory(ADirectory+SR.Name,AMask,AList,True);
      until FindNext(SR)<>0;
      FindClose(SR);
    end;
end;

Was kann man dagegen tun?

MFG
koller1

_________________
PLEASE INSERT SYSTEM DISK AND PRESS ENTER!
Und wenn du nicht gestorben bist, presst du noch heute! ;)
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 05.11.05 22:41 
den cursor auf faanyfile bewegen und f1 drücken oder eine der units nehmen, die ich vorher schon erwähnte

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Maniacmd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

Windows XP
Delphi 7 Personal
BeitragVerfasst: Do 15.06.06 20:42 
hi
ich hab noch ne Frage wie kann ich wenn ich die ganzen programme in der listbox habe das jeweilige Programm mit einem klick starten?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Do 15.06.06 20:53 

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Maniacmd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

Windows XP
Delphi 7 Personal
BeitragVerfasst: Do 15.06.06 21:01 
ja aber wie kann ich das listbox item anwählen
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 15.06.06 21:03 
In dem Du draufklickst, oder mal die Suche bemühst. :D
SmileySN
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 297

WinXP, Win7
Delphi 2010 Professional
BeitragVerfasst: Do 15.06.06 22:19 
Wenn mich meine Delphikenntnisse nicht sehr täuschen, haben Komponenten meist auch Ereignisse.

Listbox auf dem Formular anklicken und im Objektinspector auf Ereignisse umschalten.
Dann nach ONCLICK suchen und dort einen doppelklick machen.
Jetzt hat man im Quelltext eine Basis-Procedure Listbox1.OnClick.... mit Begin end.
Da rein schreibt man dann seinen Shellexcecute Befehl und als Parameter nimmt man den Listboxeintrag.
Maniacmd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

Windows XP
Delphi 7 Personal
BeitragVerfasst: Do 22.06.06 12:52 
wie komme ich an den listbox eintrag auf den ich gerade geklickt habe?
der ausgewählte eintrag soll in ein editfeld kopiert werden
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Do 22.06.06 13:08 
edit1.text:=ListBox1.Items.Strings[ListBox1.Itemindex];

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse