Skip to content

Commit 5cad3eb

Browse files
committed
update screen crash
1 parent 1735c22 commit 5cad3eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ void CAgoraScreenCapture::GetCaptureParameterFromCtrl(agora::rtc::ScreenCaptureP
479479
else
480480
capParam.frameRate = _ttoi(str);
481481
HWND hWnd = NULL;
482-
hWnd = m_listWnd.GetAt(m_listWnd.FindIndex(m_cmbScreenCap.GetCurSel()));
482+
if (m_cmbScreenCap.GetCurSel() > 0)
483+
hWnd = m_listWnd.GetAt(m_listWnd.FindIndex(m_cmbScreenCap.GetCurSel()));
484+
capParam.excludeWindowList = (view_t*)hWnd;
483485
capParam.excludeWindowList = (view_t*)hWnd;
484486
capParam.windowFocus = m_chkWndFocus.GetCheck();
485487
capParam.excludeWindowCount = 1;

0 commit comments

Comments
 (0)