设为首页 加入收藏

TOP

vc开发简单的flash播放器(二)
2014-11-23 20:17:46 来源: 作者: 【 】 浏览:89
Tags:开发 简单 flash 播放器
Pos);
flash.GetWindowPlacement(&m_FlashPos);
flash.GetWindowRect(flashrect);
CSliderCtrl *m_pSlider=(CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
m_pSlider->ShowWindow(SW_HIDE );
HWND hwnd=this->GetSafeHwnd();
LONG style=GetWindowLongPtr(hwnd,GWL_STYLE);
SetWindowLongPtr(hwnd,GWL_STYLE,style-WS_CAPTION );
CClientDC dc(this);
this->MoveWindow(0,0,dc.GetDeviceCaps(HORZRES),dc.GetDeviceCaps(VERTRES));
flash.SetWindowPos(&CWnd::wndTop ,0,0,dc.GetDeviceCaps(HORZRES),dc.GetDeviceCaps(VERTRES),SWP_SHOWWINDOW);
screenflag=TRUE;////////////////////
}
9。响应按键ESC消息,取消全屏。
重载对话框的PreTranslateMessage()函数,在函数中添加如下代码:
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam==VK_ESCAPE)
{
if(screenflag)
{
HWND hwnd=this->GetSafeHwnd();
LONG style=GetWindowLongPtr(hwnd,GWL_STYLE);
SetWindowLongPtr(hwnd,GWL_STYLE,style+WS_CAPTION );
ShowWindow(SW_HIDE);
SetWindowPlacement(&m_WndPos);
flash.MoveWindow(flashrect.left,flashrect.top,flashrect.Width(),flashrect.Height(),1);
flash.SetWindowPlacement(&m_FlashPos);
screenflag=FALSE;
CSliderCtrl *m_pSlider=(CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
m_pSlider->ShowWindow(SW_SHOW );
}
}
}
全屏和取消全屏的代码,是俺自己拼凑所得,充其量只是个模拟效果,而且还是个模拟的不好的效果,如果有高手见到,希望能够博您一笑。另外,在笑过之后还请您不吝赐教。


摘自 家里蹲博客
首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇vector彻彻底底干干净净清理内存.. 下一篇VC程序里判断系统是64位还是32位..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: