少し質問があります。APIFindNextFile
は、ディレクトリの内容全体を一覧表示しませんC:\Windows\System32
(Windows 7 のみ)。誰にも解決策はありますか?
コード [Delphi]:
Var
sAtr: String;
sPathName: String;
I: Integer;
iCont: Integer;
tHnd: THandle;
tArrAtr: TStringList;
tWDF: WIN32_FIND_DATA;
Begin
iCont := 0;
sAtr := '';
Result := TStringList.Create;
tArrAtr := TStringList.Create;
tHnd := FindFirstFile(PChar(sPath + '*.*'), tWDF);
If RightStr(sPath, 1) <> '\' Then
sPath := sPath + '\';
If tHnd = INVALID_HANDLE_VALUE Then
Exit;
Repeat
If (tWDF.dwFileAttributes And FILE_ATTRIBUTE_ARCHIVE) > 0 Then
If (String(tWDF.cFileName[0]) <> '.') Then
Begin
sPathName := sPath + String(tWDF.cFileName);
Result.Add(String(tWDF.cFileName) + sDel +
GetFileSizeAPI(sPathName));
sAtr := '';
Inc(iCont);
End;
Until (FindNextFile(tHnd, tWDF) <> True);
//CloseHandle(tHnd);