处理对话框的WM_WINDOWPOSCHANGED消息,当对话框位置改变时,更新视频预览窗口的位置。代码如下:
void CCaptureDlg::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanged(lpwndpos);
for (UINT i = 0 ; i< m_DevNum; i++) //根据芯片数进行循环
{
if (m_Frame.m_pList[i].m_ShowImage) //判断是否显示图片
{
if (m_Frame.m_pList[i].m_Stop==psStop)
{
VCAStopVideoPreview(i); //停止预览
VCAUpdateOverlayWnd(m_Frame.GetSafeHwnd()); //更新视频预览窗口
}
else if (m_Frame.m_pList[i].m_Stop==psPreview)
{
m_Frame.m_pList[i].Invalidate(); //刷新窗口
//更新视频预览窗口
VCAUpdateOverlayWnd(m_Frame.m_hWnd);
VCAUpdateVideoPreview(i,m_Frame.m_pList[i].m_hWnd);
}
}
}
}