We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fb0aa5 commit b539843Copy full SHA for b539843
1 file changed
windows/APIExample/APIExample/Advanced/MultiVideoSource/CAgoraMutilVideoSourceDlg.cpp
@@ -294,9 +294,18 @@ int CAgoraMutilVideoSourceDlg::StartMultiVideoSource()
294
m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("start porcess success"));
295
296
m_HandleData.process_id = (unsigned long)dwProcessId;
297
+
298
+ int remainRetry = 10;
299
do {
300
+ Sleep(500);
301
EnumWindows(EnumWindowsCallback, (LPARAM)(&m_HandleData));
- } while (!m_HandleData.best_handle);
302
+ remainRetry--;
303
+ } while (!m_HandleData.best_handle && remainRetry > 0);
304
305
+ if (!m_HandleData.best_handle) {
306
+ m_lstInfo.InsertString(m_lstInfo.GetCount() - 1, _T("best handle not exists"));
307
+ return -1;
308
+ }
309
m_WndScreenShare = m_HandleData.best_handle;
310
311
if (!IsWindow(m_WndScreenShare))
0 commit comments