Autor Beitrag
stathis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Fr 22.04.05 21:50 
Hallo!!!
Ich brauche wieder Ihre Hilfe :)

Wie kann ich mit delphi alle Verknüfungen die in einem Order habe zeigen und mit ein doppelklik auf die verknüfung das Programm von der Verknüpfung laufen lassen?

ich danke Ihnen

Stathis
demo88
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Ubuntu 6.04, Win XP
Delphi 7
BeitragVerfasst: Fr 22.04.05 22:14 
Verknüpfungen suchen:

ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
procedure GetFiles(const Directory: stringvar Files: TStrings;
  const FileMask: string = '*.*';  const SubFolders: Boolean = False);

  //Hilfsfunktion, um Schrägstriche hinzuzfügen, wenn nötig
  function SlashSep(const Path, S: string): string;
  begin
    if AnsiLastChar(Path)^ <> '\' then  Result := Path + '\' + S
    else Result := Path + S;
  end;

var SearchRec: TSearchRec;
    nStatus: Integer;
begin
  //Zuerst alle Dateien im aktuelle Verzeichnis finden  

  if FindFirst(SlashSep(Directory, FileMask), faAnyFile and not faDirectory and not faVolumeID,
  SearchRec) = 0 then
  begin
    try
      repeat
        Files.Add(SlashSep(Directory, SearchRec.Name));
      until FindNext(SearchRec) <> 0;
    finally
      SysUtils.FindClose(SearchRec);
    end;
  end;

  //Als nächstes nach Unterverzeichnissen suchen und, wenn benötigt, durchsuchen 
  if SubFolders then
  begin
    if FindFirst(SlashSep(Directory,'*.*'), faAnyFile,  SearchRec) = 0 then
    begin
      try
        repeat
          //Wenn es ein Verzeichnis ist, Rekursion verwenden  
          if (SearchRec.Attr and faDirectory) <> 0 then
          begin
            if ((SearchRec.Name <> '.'and (SearchRec.Name <> '..')) then
              GetFiles(SlashSep(Directory, SearchRec.Name), Files, FileMask, SubFolders);
          end;
        until FindNext(SearchRec) <> 0;
      finally
        SysUtils.FindClose(SearchRec);
      end;
    end;
  end;

end;


Als Parameter für FileMask einfach *.lnk angeben

Und dann alles per ShellExecute ausführen

_________________
"Das ist kein Bug, das ist ein Feature..."
stathis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 25.04.05 22:08 
Hallo!!
entschuldigung vieleicht habe ich es falsch getippt. Ich möchte ein Ordner öfnnen so wie in windows ist.

ich danke ihnen


stathis
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mo 25.04.05 22:34 

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
stathis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 25.04.05 23:39 
user profile icondemo88 hat folgendes geschrieben:
Verknüpfungen suchen:

ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
procedure GetFiles(const Directory: stringvar Files: TStrings;
  const FileMask: string = '*.*';  const SubFolders: Boolean = False);

  //Hilfsfunktion, um Schrägstriche hinzuzfügen, wenn nötig
  function SlashSep(const Path, S: string): string;
  begin
    if AnsiLastChar(Path)^ <> '\' then  Result := Path + '\' + S
    else Result := Path + S;
  end;

var SearchRec: TSearchRec;
    nStatus: Integer;
begin
  //Zuerst alle Dateien im aktuelle Verzeichnis finden  

  if FindFirst(SlashSep(Directory, FileMask), faAnyFile and not faDirectory and not faVolumeID,
  SearchRec) = 0 then
  begin
    try
      repeat
        Files.Add(SlashSep(Directory, SearchRec.Name));
      until FindNext(SearchRec) <> 0;
    finally
      SysUtils.FindClose(SearchRec);
    end;
  end;

  //Als nächstes nach Unterverzeichnissen suchen und, wenn benötigt, durchsuchen 
  if SubFolders then
  begin
    if FindFirst(SlashSep(Directory,'*.*'), faAnyFile,  SearchRec) = 0 then
    begin
      try
        repeat
          //Wenn es ein Verzeichnis ist, Rekursion verwenden  
          if (SearchRec.Attr and faDirectory) <> 0 then
          begin
            if ((SearchRec.Name <> '.'and (SearchRec.Name <> '..')) then
              GetFiles(SlashSep(Directory, SearchRec.Name), Files, FileMask, SubFolders);
          end;
        until FindNext(SearchRec) <> 0;
      finally
        SysUtils.FindClose(SearchRec);
      end;
    end;
  end;

end;


Als Parameter für FileMask einfach *.lnk angeben

Und dann alles per ShellExecute ausführen



wir ruft man diese procedure?
demo88
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Ubuntu 6.04, Win XP
Delphi 7
BeitragVerfasst: Di 26.04.05 00:12 
Also einen Windows Ordner öffnest du so:

ausblenden Delphi-Quelltext
1:
ShellExecute(Application.Handle, 'open', PChar('C:\Programme'), NilNil, SW_NORMAL);					

_________________
"Das ist kein Bug, das ist ein Feature..."
stathis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Di 26.04.05 20:40 
ich danke dir für die schnelle Antworten.

vieleicht geht wenn man die windows menü deaktiviert geht so was?

stathis