想请教一下,一个基于文档/视图结构的程序的窗口边框可否cut掉,比如显示图像时就只看到图像,标题栏什么的全都隐去? 说说思路 或给出示例代码最好
解决方案 »
- 关于stun协议的实现
- 有几个问题一直搞不清楚,请各位帮忙解答!
- 紧急求助:vc中如何求两个__int64相除所得的商和余数
- 怎样注册进程为服务器进程?(详细操作)大给分.
- 小妹有一个问题,急用,请各位兄弟姐妹帮忙(内详)
- 我想让程序休息100毫秒,是用WaitForSingleObject(handle,100)好呢,还是用Sleep(100)好?
- 一个超笨问题:如何在程序关闭时给出提示,"是"关闭,"否"不关闭
- 一个关于MainFrm与Dialog之间的问题
- 测试一下VC版的水平,满意度。
- 一个有关vc编译的问题
- 请问用CFile::Write()向文件中写数据是不是非常耗时啊,怎么都一个多小时了还在运行啊!!
- 想写系统日志,但是每次都覆盖了??????????????/
从CView继承过来的试图类可以做到。做法是将其他部分隐藏,将需要的部分全屏
void CMainFrame::OnScreenFull()
{
// TODO: Add your command handler code here
RECT DesktopRect;
WINDOWPLACEMENT WPNew; //m_FullScreen = m_FullScreen ? TRUE : FALSE; if(!m_FullScreen)
{ // need to hide all status bars
m_wndStatusBar.ShowWindow(SW_HIDE);
m_wndToolBar.ShowWindow(SW_HIDE);
//Adjust RECT to new size of window
::GetWindowRect(::GetDesktopWindow(), &DesktopRect);
m_wndSplitter.GetPane(0,0)->ShowWindow(SW_HIDE);
m_wndSplitter2.GetPane(1,0)->ShowWindow(SW_HIDE);
m_wndSplitter.GetColumnInfo(0,x,x1);
m_wndSplitter2.GetRowInfo(0,y,y1);
CRect tabrect;
CPeerOperatorTabCtrl *tabctrl;
tabctrl=(CPeerOperatorTabCtrl *)m_wndSplitter2.GetPane(0,0);
tabctrl->GetItemRect(0,&tabrect);
// We'll need these to restore the original state.
GetWindowPlacement (&m_WPPrev);
m_wndSplitter.SetColumnInfo( 0,0,0);
m_wndSplitter2.SetRowInfo( 0,DesktopRect.bottom-DesktopRect.top+tabrect.Height()+44,0); m_WPPrev.length = sizeof m_WPPrev; DesktopRect.left -= 1+16;
DesktopRect.top -= tabrect.Height()+44;
DesktopRect.bottom += 2+16;
DesktopRect.right += 2+8; ::AdjustWindowRectEx(&DesktopRect, GetStyle(), TRUE, GetExStyle()); // Remember this for OnGetMinMaxInfo()
m_FullScreenWindowRect = DesktopRect;
WPNew = m_WPPrev;
WPNew.showCmd = SW_SHOWNORMAL;
WPNew.rcNormalPosition = DesktopRect;
// m_pWndFullScreenBar=new CToolBar;
//
// if(!m_pWndFullScreenBar->Create(this,CBRS_SIZE_DYNAMIC|CBRS_FLOATING) ||
// !m_pWndFullScreenBar->LoadToolBar(IDR_SCREEN_FULL))
// {
// TRACE0("Failed to create toolbar\n");
// return; // fail to create
// }
//
// //don't allow the toolbar to dock
// m_pWndFullScreenBar->ModifyStyle(WS_CAPTION,0);
// m_pWndFullScreenBar->EnableDocking(0);
// m_pWndFullScreenBar->SetWindowPos(0, 0,0, 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW);
// m_pWndFullScreenBar->SetWindowText(_T("Hold Ctrl+F to switch between normal and a full screen"));
// FloatControlBar(m_pWndFullScreenBar, CPoint(0,0));
// m_pWndFullScreenBar->EnableToolTips(TRUE);
m_FullScreen=TRUE;
}
else
{
// m_pWndFullScreenBar->DestroyWindow();
// delete m_pWndFullScreenBar; m_FullScreen=FALSE; m_wndStatusBar.ShowWindow(SW_SHOWNORMAL);
m_wndToolBar.ShowWindow(SW_SHOWNORMAL);
m_wndSplitter.GetPane(0,0)->ShowWindow(SW_SHOWNORMAL);
m_wndSplitter2.GetPane(1,0)->ShowWindow(SW_SHOWNORMAL);
m_wndSplitter.SetColumnInfo(0,x,x1);
m_wndSplitter2.SetRowInfo( 0,y,y1);
WPNew = m_WPPrev;
}
SetWindowPlacement(&WPNew);
}
{
...
DWORD dwStyle = GetWindowLong(m_pMainWnd->GetSafeHwnd(),GWL_STYLE);
DWORD dwExStyle = GetWindowLong( m_pMainWnd->GetSafeHwnd(),GWL_EXSTYLE );
dwExStyle &= ~(WS_EX_CLIENTEDGE|WS_EX_WINDOWEDGE);
dwStyle &= ~(WS_BORDER|WS_SYSMENU|WS_OVERLAPPED|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
SetWindowLong(m_pMainWnd->GetSafeHwnd(),GWL_STYLE,dwStyle);
SetWindowLong(m_pMainWnd->GetSafeHwnd(),GWL_EXSTYLE,dwExStyle);
m_pMainWnd->MoveWindow(CRect(50,50,400,300),TRUE);m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
}