Hello could you please help me
What i have here is that i place the process list in a combobox then when i select the process and click terminate it does not work. But if i put strcpy(buff,"Process.exe"); and find that process in the combobox then click terminate it closes but what i want it to do is to let user choose any process and terminate it.Code:case ID_TER: TerminateProcess(hProcess,0); break; case ID_COM: PROCESSENTRY32 entry; entry.dwFlags = sizeof( PROCESSENTRY32 ); snap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL ); if ( Process32First( snap, &entry ) == TRUE ) { while ( Process32Next( snap, &entry ) == TRUE ){ ComboBox_InsertString(combox,0,&entry.szExeFile); ComboBox_GetText(combox,buffer,10000); strcpy(buff,buffer); if(ComboBox_FindItemData(combox,0,buff)==0){ hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,entry.th32ProcessID); } } CloseHandle( snap ); }




Reply With Quote