處理對(duì)話框的WM_WINDOWPOSCHANGED消息,當(dāng)對(duì)話框位置改變時(shí),更新視頻預(yù)覽窗口的位置。代碼如下:
void CCaptureDlg::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanged(lpwndpos);
for (UINT i = 0 ; i< m_DevNum; i++) //根據(jù)芯片數(shù)進(jìn)行循環(huán)
{
if (m_Frame.m_pList[i].m_ShowImage) //判斷是否顯示圖片
{
if (m_Frame.m_pList[i].m_Stop==psStop)
{
VCAStopVideoPreview(i); //停止預(yù)覽
VCAUpdateOverlayWnd(m_Frame.GetSafeHwnd()); //更新視頻預(yù)覽窗口
}
else if (m_Frame.m_pList[i].m_Stop==psPreview)
{
m_Frame.m_pList[i].Invalidate(); //刷新窗口
//更新視頻預(yù)覽窗口
VCAUpdateOverlayWnd(m_Frame.m_hWnd);
VCAUpdateVideoPreview(i,m_Frame.m_pList[i].m_hWnd);
}
}
}
}