본문 바로가기

search folder or read folder // Get a list of files CFileFind finder; BOOL finding = finder.FindFile (myDirectory + CString ("\\*.") + extension); //iterate the results while (finding) { finding = finder.FindNextFile(); //get file path CString path = finder.GetFilePath()); //get file title CString title = finder.GetFileTitle() } //dont forget to close finder.Close (); 더보기
WinInet API WinInet API WinInet(The Microsoft Win32 Internet functions) 클래스는 Win32반의 WinInet API들을 캡슐화하고 있는 클래스의 모임을 말하며 클라이언트 쪽에서 인터넷의 표준 프로토콜인 HTTP, Gopher, FTP 등을 지원하기 위한 클래스이다. MFC에서 제공하는 WinInet 관련 클래스들은 네트워크상에서 발생하는 여러 가지 복잡한 처리 작업을 내부적으로 수행하고 상당히 안정적인 코드를 제공한다. 이러한 프로토콜을 사용한 전송을 쉽게 할 수 있도록 운영체제 확장의 일부로 wininet.dll을 제공한다. MFC 응용 프로그램에서 wininet.dll은 CInternetSession 개체에 의해 표현된다. CInternetSession은 작업자가 .. 더보기
프로세스 검색 코드 PROCESSENTRY32 pe32; BOOL bCheck= FALSE; HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); if ( !hSnapshot ) { // check } CString strSearchProcessName = _T("검색 프로세스 명"); pe32.dwSize = sizeof(pe32); for ( bCheck= Process32First( hSnapshot, &pe32 ); bCheck; bCheck= Process32Next( hSnapshot, &pe32 ) ) { if(strSearchProcessName.CompareNoCase(pe32.szExeFile) == 0) { // 검색 완료. } } 더보기