ما هي طريقة اقفال مجلد او اخفاءه بدون ان يظهر
#5
جرب هذا
كود :
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;
الرد


الردود في هذا الموضوع
ما هي طريقة اقفال مجلد او اخفاءه بدون ان يظهر - بواسطة karika2 - 06-06-2014, 10:59 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم