// このコード モジュールに含まれる関数の前宣言: ATOM MyRegisterClass( HINSTANCE hInstance ); BOOL InitInstance( HINSTANCE, int ); LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); LRESULT CALLBACK About( HWND, UINT, WPARAM, LPARAM ); DWORD WINAPI SearchFunc( LPVOID lpParameter );
case IDM_GETDIR: { LboxCommdlg Commdlg; LboxString Path; if ( Commdlg.GetFolderName( &Path ) ) { Lview->Reset(); Lview->AddRow(); Lview->SetColumnText( 0, &Path ); Lview->Fit(); SearchFunc( NULL ); } break; }
DWORD WINAPI SearchFunc( LPVOID lpParameter ) { Win->MsgOk( "OK" ); return true; }
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 ); } bRet = FindNextFile( hFile, &wfd ); } if ( !bRet ) { FindClose( hFile ); } Lview->Fit(); } return true; }