Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mi 31.10.07 20:47 
Hallo,

wie kann ich versteckte Dateien mit Delphi wieder anzeigen lassen?
Hab mit SetFileAttributes versucht, aber der nimmt "not faHidden" nicht an...
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: Mi 31.10.07 22:11 
user profile iconWolle92 hat folgendes geschrieben:
wie kann ich versteckte Dateien mit Delphi wieder anzeigen lassen?
Hab mit SetFileAttributes versucht, aber der nimmt "not faHidden" nicht an...


SetFileAttributes ist eine Windows API Funktion, die kann mit den Delphi-Konstanten faHidden und Co. nichts anfangen. Du musst dazu die in der Windows-Unit deklarierten Konstanten verwenden, in diesem Fall FILE_ATTRIBUTE_HIDDEN.

twm
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mi 31.10.07 22:54 
Schau besser nach

ausblenden Delphi-Quelltext
1:
FileSetAttr					


aus der Unit

ausblenden Delphi-Quelltext
1:
SysUtils;					


beispiel:
ausblenden Delphi-Quelltext
1:
2:
FileSetAttr('dateiname',faHidden); //verstecken
FileSetAttr('dateiname',FileGetAttr and not faHidden); //wieder sichtbar machen


ich hoffe ich hab keinen fehler gemacht... das ist eben Logik.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 01.11.07 08:47 
Danke, FileGetAttr braucht aber noch den Dateinamen als Parameter
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 01.11.07 09:41 
user profile iconWolle92 hat folgendes geschrieben:
Danke, FileGetAttr braucht aber noch den Dateinamen als Parameter

SetFileAttributes auch. Wo ist das Problem?
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 01.11.07 09:54 
dateiname ist hald zB. 'C:\Programme\deinProgramm\readme.txt'
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 01.11.07 11:53 
^^Es gibt kein Problem... ich habe nur einen Fehler in Jakobs Quellcode berichtigt...
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 01.11.07 12:04 
user profile iconWolle92 hat folgendes geschrieben:
^^Es gibt kein Problem... ich habe nur einen Fehler in Jakobs Quellcode
berichtigt...

welchen Fehler?
Ich habe doch den für den Parameter Filename 'dateiname' eingesetzt - wo ist da der Fehler?.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 01.11.07 12:41 
ICh rede doch auch von FileGETAttr, nicht FileSetAttr...
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 01.11.07 18:16 
ahh, sorry