如何用VC的MFC或SDK方式创建全屏幕的Windows窗口? hi, 我告诉你那有吧; 进入本站首页点击Visual C++, 后进入 VC源码集合, 在 43.其它控制, 中下载fully.zip就搞定了. (hehe) sad_pacific 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void CMainFrame::FullScroll(){ ShowControlBar(&m_wndToolBar, FALSE, FALSE); // hold toolbar; ShowControlBar(&m_wndStatusBar, FALSE, FALSE); // hold statusbar; ModifyStyle(WS_CAPTION,0); // hold Bluebar; ModifyStyle(WS_THICKFRAME,0); // Set Border width SetMenu(NULL); // hold menubar; ShowWindow(SW_MAXIMIZE); // Maxing the view;} 去掉主窗口的所有附件(标题、菜单等)或许可以,但不是最佳方法,finemood的要求就是全屏显示方式,且不影响菜单操作。方法较复杂一点。void CMainFrame::OnViewFullscreen() //菜单命令响应{ g_bFullScreen = !g_bFullScreen; //定义为全局变量,其它地方可能用得着这一属性 static BOOL bShowToolbar, bShowStatusbar; WINDOWPLACEMENT wpNew; if(g_bFullScreen){ GetWindowPlacement (&m_wpPrev); m_wpPrev.length = sizeof m_wpPrev; ModifyStyle(WS_SYSMENU|WS_CAPTION, 0, 0); CMDIChildWnd* pFrame = MDIGetActive(); if(pFrame != NULL){ pFrame->MDIMaximize(); //将子框架最大化并修改属性 while(pFrame != NULL){ pFrame->ModifyStyle(WS_SYSMENU|WS_CAPTION, 0, 0); pFrame = (CMDIChildWnd* )pFrame->GetNextWindow(); } } bShowToolbar = (m_wndToolBar.GetStyle() & WS_VISIBLE) ? true : false; bShowStatusbar = (m_wndStatusBar.GetStyle() & WS_VISIBLE) ? true : false; if(bShowToolbar) m_wndToolBar.ShowWindow(SW_HIDE); if(bShowStatusbar) m_wndStatusBar.ShowWindow(SW_HIDE); GetDesktopWindow()->GetWindowRect(&m_rectFullScreenWindow); AdjustWindowRectEx(&m_rectFullScreenWindow, GetStyle(), TRUE, GetExStyle()); m_rectFullScreenWindow.InflateRect(1,1); wpNew = m_wpPrev; wpNew.showCmd = SW_SHOWNORMAL; wpNew.rcNormalPosition = m_rectFullScreenWindow; if(m_pwndMapToolBar == NULL){ //全屏方式下显示一个浮动工具栏 m_pwndMapToolBar = new CToolBar; if(!m_pwndMapToolBar->CreateEx(this, TBSTYLE_FLAT, WS_CHILD|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC|CBRS_FLOATING) || !m_pwndMapToolBar->LoadToolBar(IDR_FLOAT_MAPBAR)) { TRACE0("Failed to create toolbar\n"); delete m_pwndMapToolBar; m_pwndMapToolBar = NULL; } else{ DWORD flags = SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE; if(CChildFrame::m_nCount) flags |= SWP_SHOWWINDOW; m_pwndMapToolBar->EnableDocking(FALSE); m_pwndMapToolBar->SetWindowPos(0,100,100,0,0,flags); m_pwndMapToolBar->SetWindowText(_T("图层操作")); FloatControlBar(m_pwndMapToolBar, CPoint(400,0)); } } } else{ ModifyStyle(0, WS_SYSMENU|WS_CAPTION, 0); CMDIChildWnd* pFrame = MDIGetActive(); while(pFrame != NULL){ pFrame->ModifyStyle(0, WS_SYSMENU|WS_CAPTION, 0); //SWP_NOSIZE | SWP_NOMOVE |SWP_NOZORDER|SWP_NOACTIVATE); pFrame = (CMDIChildWnd* )pFrame->GetNextWindow(); } if(bShowToolbar) m_wndToolBar.ShowWindow(SW_SHOW); if(bShowStatusbar) m_wndStatusBar.ShowWindow(SW_SHOW); wpNew = m_wpPrev; if(m_pwndMapToolBar != NULL){ m_pwndMapToolBar->DestroyWindow(); delete m_pwndMapToolBar; m_pwndMapToolBar = NULL; } } SetWindowPlacement ( &wpNew );}void CMainFrame::OnUpdateViewFullscreen(CCmdUI* pCmdUI) { pCmdUI->Enable(!g_bEditMode); pCmdUI->SetCheck(g_bFullScreen);}void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { if (g_bFullScreen) { lpMMI->ptMaxSize.y = m_rectFullScreenWindow.Height(); lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y; lpMMI->ptMaxSize.x = m_rectFullScreenWindow.Width(); lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x; } else CMDIFrameWnd::OnGetMinMaxInfo(lpMMI);}//子框架中BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs){ // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE; if(!g_bFullScreen) cs.style |= WS_CAPTION | WS_SYSMENU; return CMDIChildWnd::PreCreateWindow(cs);} UDP的sento()为何会出现阻塞? 如何接收select count返回值 [散分] 又少了一位五星 如何实现两个对话框应用程序通信? richedit中指定位置插入字符串 VC中 ????? 请高手帮忙指点一下这个程序有什么问题 怎样让程序在开机时自动运行? 请教各位大虾,如果通过网络发送图象? ConnectionPoint的Advise失败问题 关于位图按钮 谁能给我一个VtoolsD winsock能一次接收的一个数据包最大是多少?
{
ShowControlBar(&m_wndToolBar, FALSE, FALSE); // hold toolbar;
ShowControlBar(&m_wndStatusBar, FALSE, FALSE); // hold statusbar;
ModifyStyle(WS_CAPTION,0); // hold Bluebar;
ModifyStyle(WS_THICKFRAME,0); // Set Border width
SetMenu(NULL); // hold menubar;
ShowWindow(SW_MAXIMIZE); // Maxing the view;
}
void CMainFrame::OnViewFullscreen() //菜单命令响应
{
g_bFullScreen = !g_bFullScreen; //定义为全局变量,其它地方可能用得着这一属性
static BOOL bShowToolbar, bShowStatusbar;
WINDOWPLACEMENT wpNew;
if(g_bFullScreen){
GetWindowPlacement (&m_wpPrev);
m_wpPrev.length = sizeof m_wpPrev;
ModifyStyle(WS_SYSMENU|WS_CAPTION, 0, 0);
CMDIChildWnd* pFrame = MDIGetActive();
if(pFrame != NULL){
pFrame->MDIMaximize(); //将子框架最大化并修改属性
while(pFrame != NULL){
pFrame->ModifyStyle(WS_SYSMENU|WS_CAPTION, 0, 0);
pFrame = (CMDIChildWnd* )pFrame->GetNextWindow();
}
}
bShowToolbar = (m_wndToolBar.GetStyle() & WS_VISIBLE) ? true : false;
bShowStatusbar = (m_wndStatusBar.GetStyle() & WS_VISIBLE) ? true : false;
if(bShowToolbar) m_wndToolBar.ShowWindow(SW_HIDE);
if(bShowStatusbar) m_wndStatusBar.ShowWindow(SW_HIDE);
GetDesktopWindow()->GetWindowRect(&m_rectFullScreenWindow);
AdjustWindowRectEx(&m_rectFullScreenWindow, GetStyle(), TRUE, GetExStyle());
m_rectFullScreenWindow.InflateRect(1,1);
wpNew = m_wpPrev;
wpNew.showCmd = SW_SHOWNORMAL;
wpNew.rcNormalPosition = m_rectFullScreenWindow;
if(m_pwndMapToolBar == NULL){ //全屏方式下显示一个浮动工具栏
m_pwndMapToolBar = new CToolBar;
if(!m_pwndMapToolBar->CreateEx(this, TBSTYLE_FLAT,
WS_CHILD|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC|CBRS_FLOATING) ||
!m_pwndMapToolBar->LoadToolBar(IDR_FLOAT_MAPBAR))
{
TRACE0("Failed to create toolbar\n");
delete m_pwndMapToolBar;
m_pwndMapToolBar = NULL;
}
else{
DWORD flags = SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE;
if(CChildFrame::m_nCount)
flags |= SWP_SHOWWINDOW;
m_pwndMapToolBar->EnableDocking(FALSE);
m_pwndMapToolBar->SetWindowPos(0,100,100,0,0,flags);
m_pwndMapToolBar->SetWindowText(_T("图层操作"));
FloatControlBar(m_pwndMapToolBar, CPoint(400,0));
}
}
}
else{
ModifyStyle(0, WS_SYSMENU|WS_CAPTION, 0);
CMDIChildWnd* pFrame = MDIGetActive();
while(pFrame != NULL){
pFrame->ModifyStyle(0, WS_SYSMENU|WS_CAPTION, 0); //SWP_NOSIZE | SWP_NOMOVE |SWP_NOZORDER|SWP_NOACTIVATE);
pFrame = (CMDIChildWnd* )pFrame->GetNextWindow();
}
if(bShowToolbar) m_wndToolBar.ShowWindow(SW_SHOW);
if(bShowStatusbar) m_wndStatusBar.ShowWindow(SW_SHOW);
wpNew = m_wpPrev; if(m_pwndMapToolBar != NULL){
m_pwndMapToolBar->DestroyWindow();
delete m_pwndMapToolBar;
m_pwndMapToolBar = NULL;
}
}
SetWindowPlacement ( &wpNew );
}void CMainFrame::OnUpdateViewFullscreen(CCmdUI* pCmdUI)
{
pCmdUI->Enable(!g_bEditMode);
pCmdUI->SetCheck(g_bFullScreen);
}void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
if (g_bFullScreen)
{
lpMMI->ptMaxSize.y = m_rectFullScreenWindow.Height();
lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y;
lpMMI->ptMaxSize.x = m_rectFullScreenWindow.Width();
lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x;
}
else
CMDIFrameWnd::OnGetMinMaxInfo(lpMMI);
}//子框架中
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED
| FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE;
if(!g_bFullScreen)
cs.style |= WS_CAPTION | WS_SYSMENU;
return CMDIChildWnd::PreCreateWindow(cs);
}