追加したリストビューにファイル名を表示

  SearchFunc 関数を変更



  
DWORD WINAPI SearchFunc( LPVOID lpParameter )
{
	int i;
	LboxString Path;

	for( i = 0; i < Lview->Count(); i++ ) {

		HANDLE hFile;
		BOOL bRet;
		WIN32_FIND_DATA wfd;

		Lview->SetCurrentRow( i );
		Lview->GetColumnText( 0, &Path );
		Path.AddBackslash();
		Path.operator += ("*.*");

		hFile = FindFirstFile( Path.szLboxString, &wfd );
		bRet = true;

		while( hFile != INVALID_HANDLE_VALUE && bRet ) {
			if ( lstrcmp( wfd.cFileName, "." ) == 0 ) {
				bRet = FindNextFile( hFile, &wfd );
				continue;
			}
			if ( lstrcmp( wfd.cFileName, ".." ) == 0 ) {
				bRet = FindNextFile( hFile, &wfd );
				continue;
			}
			Lview->SetCurrentRow( i );
			Lview->GetColumnText( 0, &Path );
			Path.AddBackslash();
			Path.operator += (wfd.cFileName);
			if ( PathIsDirectory( Path.szLboxString ) ) {
				Lview->AddRow();
				Lview->SetColumnText( 0, &Path );
			}
			else {
				Lview2->AddRow();
				Lview2->SetColumnPrintf( 0, "%4lu", Lview2->Count() );
				Lview2->SetColumnText( 1, &Path );
			}
			bRet = FindNextFile( hFile, &wfd );

		}
		if ( !bRet ) {
			FindClose( hFile );
		}
		Lview->Fit();
		Lview2->Fit();
	}

	return true;
}
  



  テキストファイルのみ表示する



  
DWORD WINAPI SearchFunc( LPVOID lpParameter )
{
	int i;
	LboxString Path;
	LboxFileSystem Fs;

	for( i = 0; i < Lview->Count(); i++ ) {

		HANDLE hFile;
		BOOL bRet;
		WIN32_FIND_DATA wfd;

		Lview->SetCurrentRow( i );
		Lview->GetColumnText( 0, &Path );
		Path.AddBackslash();
		Path.operator += ("*.*");

		hFile = FindFirstFile( Path.szLboxString, &wfd );
		bRet = true;

		while( hFile != INVALID_HANDLE_VALUE && bRet ) {
			if ( lstrcmp( wfd.cFileName, "." ) == 0 ) {
				bRet = FindNextFile( hFile, &wfd );
				continue;
			}
			if ( lstrcmp( wfd.cFileName, ".." ) == 0 ) {
				bRet = FindNextFile( hFile, &wfd );
				continue;
			}
			Lview->SetCurrentRow( i );
			Lview->GetColumnText( 0, &Path );
			Path.AddBackslash();
			Path.operator += (wfd.cFileName);
			if ( PathIsDirectory( Path.szLboxString ) ) {
				Lview->AddRow();
				Lview->SetColumnText( 0, &Path );
			}
			else {
			   if ( Fs.IsText( &Path ) ) {
			      Lview2->AddRow();
			      Lview2->SetColumnPrintf( 0, "%4lu", Lview2->Count() );
			      Lview2->SetColumnText( 1, &Path );
			   }
			}
			bRet = FindNextFile( hFile, &wfd );

		}
		if ( !bRet ) {
			FindClose( hFile );
		}
		Lview->Fit();
		Lview2->Fit();
	}

	return true;
}
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ