0
点赞
收藏
分享

微信扫一扫

用VC 6.0写flash播放器——4、处理窗口缩放


purpleendurer

2005.11.26 第1

当用户缩放窗口时,我们要调整窗口中的各个控件的位置。

我们对WM_SIZE消息进行处理,代码如下:

void CSwfPlayerDlg::OnSize(UINT nType, int cx, int cy) 
{
//CDialog::OnSize(nType, cx, cy);

// TODO: Add your message handler code here

if (nType != SIZE_MINIMIZED) //如果窗口不是最小化则进行调整
{
RECT DlgRect, BtnRect, StatusBarRect;
GetWindowRect(&DlgRect); //取当前窗口的Rect,此DlgRect用于重新设置flash//重新设置状态栏
::GetWindowRect(m_hStatusWindow, &StatusBarRect);//取状态栏的Rect//取命令按钮的坐标
//flash的左上角
DlgRect.bottom = StatusBarRect.top;//flash的右下角
m_SwfBox.MoveWindow(&DlgRect);
}
}

举报

相关推荐

0 条评论