一个关于对话框的问题 怎么实现当窗口正常的情况下有最小化、最大化和关闭,而当窗口最大化时就没有标题栏了,就像暴风影音那种效果。推出最大化就又出现了最小化、最大化和关闭标题栏。请高手帮帮忙 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void CDEMODlg::OnSize(UINT nType, int cx, int cy){ CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here if(IsZoomed()) { //AfxMessageBox(_T("MAX")); LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE); lStyle &= ~WS_CAPTION; //lStyle &= ~WS_THICKFRAME; SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle); SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOSIZE |SWP_NOMOVE |SWP_NOZORDER |SWP_NOACTIVATE|SWP_FRAMECHANGED); } else { }} 或者:ModifyStyle(WS_CAPTION, 0, SWP_FRAMECHANGED); 这个可以全屏~ LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE); style &= ~(WS_DLGFRAME | WS_THICKFRAME); SetWindowLong(this->m_hWnd,GWL_STYLE, style); this->ShowWindow(SW_SHOWMAXIMIZED); CRect rect; this->GetWindowRect(&rect); ::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left+1, rect.top+1, rect.right-rect.left-2, rect.bottom-rect.top-2, SWP_FRAMECHANGED); SetWindowPos(&wndTopMost,....);设置到顶层窗口试试 窗口最大化:GetWindowRect(m_rect); // m_rect定义为类的成员变量,保存最大化前窗口区域 CRect rectDesktop; ::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop ); LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE); lStyle &= ~WS_CAPTION; //lStyle &= ~WS_THICKFRAME; SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle); SetWindowPos(NULL, 0, 0, rectDesktop.Width(), rectDesktop.Height(), SWP_SHOWWINDOW|SWP_FRAMECHANGED); ------------------------------------------------------------------------------窗口还原:LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE); lStyle |= WS_CAPTION; SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle); SetWindowPos(NULL, m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), SWP_SHOWWINDOW|SWP_FRAMECHANGED); 谢谢 VisualEleven,很热心,感动!也很感谢其他人,谢谢了。 三角网的生成 关于画面抖动问题 请教如何保存和读取数据方便一点? 请问如何才能由元文件句柄得到元文件的设备描述符? ××××在线等待,这个函数是什么意思?请给解释???????××××××× 为什么我通过公司的ip访问网站,网站都记录了公司的ip而不是我电脑的ip? 提供MSDN2003 APRIL 下载,要下载的请进来 几个简单问题,请高手们给看看,进者有分! 要打开一个文件,用什么控件 yu_hl(卖火柴的小男孩) 进来吧! USB WriteFile问题 如何让VC里的DataGrid控件可以响应鼠标滚动的事件?
{
CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here
if(IsZoomed())
{
//AfxMessageBox(_T("MAX"));
LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE);
lStyle &= ~WS_CAPTION;
//lStyle &= ~WS_THICKFRAME;
SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle);
SetWindowPos(NULL, 0, 0, 0, 0,
SWP_NOSIZE |SWP_NOMOVE |SWP_NOZORDER |SWP_NOACTIVATE|SWP_FRAMECHANGED);
}
else
{ }
}
ModifyStyle(WS_CAPTION, 0, SWP_FRAMECHANGED);
LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE);
style &= ~(WS_DLGFRAME | WS_THICKFRAME);
SetWindowLong(this->m_hWnd,GWL_STYLE, style);
this->ShowWindow(SW_SHOWMAXIMIZED);
CRect rect;
this->GetWindowRect(&rect);
::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left+1, rect.top+1, rect.right-rect.left-2, rect.bottom-rect.top-2, SWP_FRAMECHANGED);
GetWindowRect(m_rect); // m_rect定义为类的成员变量,保存最大化前窗口区域 CRect rectDesktop;
::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE);
lStyle &= ~WS_CAPTION;
//lStyle &= ~WS_THICKFRAME;
SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle);
SetWindowPos(NULL, 0, 0, rectDesktop.Width(), rectDesktop.Height(),
SWP_SHOWWINDOW|SWP_FRAMECHANGED);
------------------------------------------------------------------------------窗口还原:
LONG lStyle = GetWindowLong(GetSafeHwnd(), GWL_STYLE);
lStyle |= WS_CAPTION; SetWindowLong(GetSafeHwnd(), GWL_STYLE, lStyle);
SetWindowPos(NULL, m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(),
SWP_SHOWWINDOW|SWP_FRAMECHANGED);