void CProcessBrowserDlg::LoadProcesses() { HANDLE hSnapshot; BOOL bRet; PROCESSENTRY32 peProcessEntry; hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); if( hSnapshot != NULL ) { peProcessEntry.dwSize = sizeof( PROCESSENTRY32 ); bRet = Process32First( hSnapshot,&peProcessEntry ); while( bRet ) { ………………… bRet = Process32Next ( hSnapshot,&peProcessEntry ); } CloseHandle( hSnapshot ); } }