请参照下例程:void CVideoView::OnLButtonDown(UINT nFlags, CPoint point)
{
CString filename("d:\\msvc20\\bin\\video\\tlclouds.avi");
//If the MCIWnd doen not exist, ctreate it.
if (m_videoWnd == NULL)
m_videoWnd = MCIWndCreate(this->GetSafeHwnd(),
AfxGetInstanceHandle(),
WS_CHILD | WS_CAPTION | WS_VISIBLE | MCIWNDF_SHOWPOS | MCIWNDF_SHOWNAME,
filename);
//Otherwise, pause or resume play as needed.
else
{
if (m_paused)
{
MCIWndPlay(m_videoWnd);
m_paused = FALSE;
}
else
{
MCIWndPause(m_videoWnd);
m_paused = TRUE;
}
}
}void CVideoView::OnRButtonDown(UINT nFlags, CPoint point)
{
//If the MCIWnd exists, destroy it. if (m_videoWnd != NULL)
{
MCIWndDestroy(m_videoWnd);
m_videoWnd = NULL;
}
}
{
CString filename("d:\\msvc20\\bin\\video\\tlclouds.avi");
//If the MCIWnd doen not exist, ctreate it.
if (m_videoWnd == NULL)
m_videoWnd = MCIWndCreate(this->GetSafeHwnd(),
AfxGetInstanceHandle(),
WS_CHILD | WS_CAPTION | WS_VISIBLE | MCIWNDF_SHOWPOS | MCIWNDF_SHOWNAME,
filename);
//Otherwise, pause or resume play as needed.
else
{
if (m_paused)
{
MCIWndPlay(m_videoWnd);
m_paused = FALSE;
}
else
{
MCIWndPause(m_videoWnd);
m_paused = TRUE;
}
}
}void CVideoView::OnRButtonDown(UINT nFlags, CPoint point)
{
//If the MCIWnd exists, destroy it. if (m_videoWnd != NULL)
{
MCIWndDestroy(m_videoWnd);
m_videoWnd = NULL;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货