How to search file on certain directory ? | |||
| |||
Following example shows the example, bool KFindFile(void *findname) { WIN32_FIND_DATA FindFileData; HANDLE hFind; CString strSearch = (LPCTSTR)findname; hFind = FindFirstFileEx( strSearch, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0); if (hFind==INVALID_HANDLE_VALUE) { MessageBox( NULL, CString("Invalid Handle Value"), CString("Error"), MB_OK); return false; } else { MessageBox( NULL, (LPCTSTR)FindFileData.cFileName, (LPCTSTR)FindFileData.cFileName, MB_OK); FindClose( hFind); return true; } } Above source works on Windows CE Platform as well. And you can use above function as below: . . . KFindFile( _T("\My Documents\My Pictures\PIC-*.jpg")); . . . Tags: C++ Event Call MFC Search File WIN32 API WIndows CE WinCE Windows XP | |||
| |||
| |||
Login for comment |
SIMILAR POSTS How to call SetTimer function on MFC CDialog class ? |