Autor Beitrag
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 10.12.06 14:36 
Hi,

ich möchte eine Liste mit gesamte Startmenüinhalt erstellen.

habe aber keine Ahnung was ich da für Komponenten nutzen sollte.

Ich hab ein Screenshot angehängt... der zeigt wie es am Ende aussehen sollte. (dieser ist aus einem anderen Programm)

Schon mal ein Danke für eure Hilfe.. :-)

Tschau Stefan
Einloggen, um Attachments anzusehen!
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 10.12.06 14:56 
Irgendeinen Baum. VirtualStringTree ist z.B. sehr gut dafür geeignet, aber die Delphi-Kompo geht auch.
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 10.12.06 15:12 
hat noch jemand eine Idee wie ich das gesamte Startmenü einlesen kann (also "AllUser" und "Benutzer")
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 10.12.06 15:17 
Ich hab das mal so gelöst:
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:
procedure GetShortcuts(folder : String; recursive : Boolean; var files : TStringList);
var
  aFile : TSearchRec;
begin
  if files = nil then
    exit;

  if FindFirst(folder+'\*.*', faAnyFile, aFile) = 0 then
  try
    repeat
      if (aFile.Name <> '.') and (aFile.Name <> '..') then
      begin
        if (aFile.Attr and faDirectory <> 0) and recursive then
           GetShortcuts(folder+'\'+aFile.Name, true, files)
        else
          if ExtractFileExt(aFile.Name) = '.lnk' then
            files.Add(folder+'\'+aFile.Name)
      end;
    until FindNext(aFile) <> 0;
  finally
    FindCLose(aFile);
  end;
end;

//Diese Funktion habe ich nicht selber geschrieben, ich weiß leider nicht mehr, woher sie ist :oops:
function GetShellFolder(CSIDL: integer): String;
var
  pidl         : PItemIdList;
  FolderPath   : string;
  SystemFolder : Integer;
begin
  SystemFolder := CSIDL;
  if SUCCEEDED(SHGetSpecialFolderLocation(0, SystemFolder, pidl)) then
  begin
    SetLength(FolderPath, max_path);
    if SHGetPathFromIDList(pidl, PChar(FolderPath)) then
    begin
      SetLength(FolderPath, length(PChar(FolderPath)));
    end;
  end;
  Result := FolderPath;
end;


Aufruf
ausblenden Delphi-Quelltext
1:
2:
3:
  GetShortcuts(GetShellFolder(CSIDL_STARTMENU), true, FFiles); //Startmenü des Nutzers
  GetShortcuts(GetShellFolder(CSIDL_COMMON_STARTMENU), true, FFiles); //"allgemeines" Startmenü
  GetShortcuts(GetShellFolder(CSIDL_DESKTOP), false, FFiles); //evtl. noch den Desktop



//Edit: Möchtest Du die Programme, die zu den Verknüpfungen gehören, ausführen, brauchst Du vielleicht noch das hier:
www.delphi-library.de/topic_51393.html

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 10.12.06 15:44 
Danke euch beiden :D bin schon ein stück weiter... nun hab ich aber das Problem... ich hab mir grad erst das VirtualStringTree runtergeladen... und find da nix was ich die Stringlist für die Funktionen von Christian nehmen könnte.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 10.12.06 15:51 
Für einen normalen Treeview dürfte das hier interessant sein: www.delphi-library.d...iewtopic.php?t=61300

Evtl. lässt sich das auf den VirtualStringTree umbauen? Hab mit dem noch nie gearbeitet :nixweiss:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 10.12.06 15:51 
Die Kompo VST hat keine StringList-Darstellung, sondern eine Baum-Darstellung. (Tutorial zu VST siehe hier)
Dem entsprechend musst du in der Suchruotine reagieren, da die Suchruotine rekursiv ist.
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 10.12.06 16:13 
Stop :!:

ich will doch gar kein Tree... Da muss man ja dann sich erst duchhangeln. :-(

also reich ne Liste die vorn Icons anzeigen kann. Was währe das dann für ne kompo? und wie bekomm ich da die Stringlist rein?
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 10.12.06 16:45 
gut ich hab die Funktionen abgeändert und ne normale Listbox genommen... soweit ich weis kann man da auch über n Trick Bildchen anzeigen :-) Danke nochmal für eure mühen

Tschau Stefan