MFC 防止多线程卡死
Par p;
p.CmdLine = _T("ping 127.0.0.1");
HANDLE handle = CreateThread(NULL, 0, ExecuteCmd, &p, 0, NULL);
while (TRUE){
DWORD result;
MSG msg;
result = MsgWaitForMultipleObjects(1, &handle, FALSE, INFINITE, QS_ALLINPUT);
if (result == (WAIT_OBJECT_0)){
break;
}
else{
PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
DispatchMessage(&msg);
}
}
m_edit_result = p.ret;