大家好,我用Windows Media Player控件播放视频,播放wmv文件就正常,切换播放也正常,而播放swf文件只能第一次全屏,切换播放的时候就不是全屏了(播放器还是全屏的),怎么回事呢?请帮帮忙
控制全屏的代码如下:(有两处代码,只要一处不能实现)
void CPlayer1Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
ShowWindow(SW_SHOWMAXIMIZED); //主要是这句
UpdateWindow(); }
}void CPlayer1Dlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_Player.m_hWnd != NULL)
{
CRect rt;
GetWindowRect(&rt);
m_Player.MoveWindow(0,0,rt.Width(),rt.Height());
}
}
控制全屏的代码如下:(有两处代码,只要一处不能实现)
void CPlayer1Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
ShowWindow(SW_SHOWMAXIMIZED); //主要是这句
UpdateWindow(); }
}void CPlayer1Dlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_Player.m_hWnd != NULL)
{
CRect rt;
GetWindowRect(&rt);
m_Player.MoveWindow(0,0,rt.Width(),rt.Height());
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货