المشاركات : 131
المواضيع 73
:
: 0
الإنتساب : Feb 2012
السلام عليكم ما هي طريقة اقفال مجلد او اخفاءه بدون ان يظهر ك'hiden file and folder'
المشاركات : 245
المواضيع 69
:
: 12
الإنتساب : Jan 2013
انا لم أحاول فى استخدام اقفال المجلد ولكن عملتك اخفاء المجلد ولا يظهر حتى ولو كان الجهازم مفعل خاصية أظهار الاخفاء ..المرفقات
المشاركات : 245
المواضيع 69
:
: 12
الإنتساب : Jan 2013
أعتذر أخى ...الخطأ كان عندى فى الجهاز عند عرض المجلدات يظهر المجلد
المشاركات : 131
المواضيع 73
:
: 0
الإنتساب : Feb 2012
لا بأس مشكور على المحاولة مع tfilestreamshareexciusive نستطيع اقفال ملف هل بالامكان ان يشابهها شيى او دالة للمجلدات
المشاركات : 245
المواضيع 69
:
: 12
الإنتساب : Jan 2013
جرب هذا
كود :
uses ShlObj, ActiveX, ShellAPI;
function GetDesktopDirectory:string;
var
pidl: PItemIDList;
buf : array[0..MAX_PATH] of char;
const
folderID = $0010; // $0010 = DESKTOPDIRECTORY
begin
result := '';
if Succeeded( ShGetSpecialFolderLocation(GetActiveWindow, folderID, pidl) ) then begin
if ShGetPathfromIDList( pidl, buf ) then
result := buf;
CoTaskMemFree(pidl);
end;
end;
function SetFileWriteProtect(filename:string;setreadonly:bo olean):boolean;
var
attr:integer;
begin
Attr := FileGetAttr(FileName);
result:=true;
try
if setreadonly then Attr := Attr and (faReadOnly)
else Attr := Attr and (not faReadOnly);
FileSetAttr(FileName, Attr);
except
result:=false;
end;
end;
//Action could be FO_MOVE,FO_DELETE,FO_COPY,FO_RENAME
procedure FileSystemAction(action:longint;fromDir,toDir:stri ng);
var SHFileOp:TSHFileOpStruct;
begin
SHFileOp.wnd :=Form1.handle;
SHFileOp.wFunc :=action;
SHFileOp.pFrom :=Pchar(fromDir +#0+#0);
SHFileOp.pTo :=Pchar(toDir +#0+#0);
SHFileOp.fFlags:=FOF_SILENT or FOF_NOCONFIRMATION;
SHFileOp.fAnyOperationsAborted:=false;
SHFileOp.hNameMappings :=NIL;
SHFileOp.lpszProgressTitle :=NIL;
SHFileOperation(SHFileOp);
end;
Procedure GetFileList(aFiles : TStringList; sPath : string; sMask : string = '*.*');
var
iIndex : Integer;
SearchRec : TSearchRec;
begin
if aFiles = Nil then
aFiles := TStringList.Create;
if sPath[Length(sPath)] <> '\' then
sPath := sPath + '\';
iIndex := FindFirst(sPath+sMask, faArchive, SearchRec);
while iIndex = 0 do begin
aFiles.Add(sPath+SearchRec.Name);
iIndex := FindNext(SearchRec);
end;
FindClose(SearchRec);
end;