Autor Beitrag
fuggaz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 13.12.08 00:56 
Hey,
Für ShellListView muss ich bei .lnk-Dateien differenzieren zw. denen, die auf eine Datei verweisen, und solchen, die auf Ordner verlinken.
Ist eine Datei verlinkt, dann deaktiviere ich AutoNavigate, wenn es ein Ornder ist aktiviere ich es.

Kann mir jemand bitte sagen wie das geht?
(Leider klappt es nicht mit der Abfrage if[...].isFolders[...])
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.12.08 01:20 
Eine Möglichkeit wäre das Ziel der Verknüpfung auszulesen und dann zu schauen ob das ein Ordner ist.
www.swissdelphicente.../showcode.php?id=970

Ob direkt in der .lnk Datei gespeichert ist, worum es sich bei dem Ziel handelt, weiß ich nicht.

// EDIT:
Es scheint da Unterschiede zu geben, neben dem Arbeitsverzeichnis, das bei Verknüpfungen zu Ordnern normalerweise leer ist, sind auch andere Teile der Datei unterschiedlich. Ob das am Typ des Ziels liegt und wenn ja ob das auch so einfach via Interface auszulesen ist, weiß ich aber nicht.
fuggaz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 13.12.08 01:45 
Hey,
Danke!!
Damit klappt das.
Das Arbeitsverzeichnis, wie du sagtest, ist leer.
Das kann ich dann einfach auslesen :-)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.12.08 02:23 
So meinte ich das eigentlich nicht, denn das Arbeitsverzeichnis kann auch bei Dateien leer sein. Das ist es nur normalerweise nicht. Das war eigentlich nur als Ergebnis des Dateivergleichs gemeint. ;-)

Ich meinte mit dem ersten Satz, dass es am besten wäre mit DirectoryExists zu prüfen ob das Ziel der Verknüpfung als Verzeichnis existiert.
fuggaz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 13.12.08 04:17 
achso ok.
fuggaz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 13.12.08 15:03 
noch ein Problem:

Wie wandel ich
ausblenden Quelltext
1:
array[0..MAX_PATH] of Char;					

in
ausblenden Quelltext
1:
string					

um?
Ich habe es schon mit einer Schleife versucht aber da wird anscheinend nichts ausgetauscht...

ausblenden Quelltext
1:
2:
for wordpos:=1 to length(ShellListView1.SelectedFolder.PathName) do
      LinkInfo.FullPathAndNameOfLinkFile[wordpos]:=ShellListView1.SelectedFolder.PathName[wordpos];

FullPathAndNameOfLinkFile ist danach leer und die String-Variable nicht.

Wie wandele ich das um?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.12.08 15:10 
CopyMemory sollte helfen, hier findest du ein Beispiel dafür:
www.delphipraxis.net...st414811.html#414811
fuggaz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 106



BeitragVerfasst: Sa 13.12.08 15:24 
Wunderbar! Das klappt :-)