如何全屏显示? 如何不让一个窗口移动?

flying_fox0 2002-08-28 09:48:06
我在作一个视频程序,

请问如何才能做到全屏显示?

如何才能禁止一个窗口的移动?
...全文
258 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
o_racle 2003-04-27
  • 打赏
  • 举报
回复
全屏显示:
我想在一个SDI应用程序中实现正常的窗口和全屏窗口的切换(没有框架,状态栏,工具条)


class CMainFrame : public CSDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();

// Attributes
public:

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

BOOL GetFullScreenSize(CWnd* pWnd, POINT& pt) const;

protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;

CWnd* m_pWndFullScreen;
WINDOWPLACEMENT m_PreviousPlace;
WINDOWPLACEMENT m_MainPreviousPlace;
CRect m_FullScreenPlace;
CRect m_MainFullScreenPlace;
BOOL m_bHadToolBar;
BOOL m_bHadStatusBar;

public:
void EscapeFullScreen();

// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnViewFullScreen();
afx_msg void OnUpdateViewFullScreen(CCmdUI* pCmdUI);
afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

void CMainFrame::EscapeFullScreen()
{
if (m_pWndFullScreen != NULL)
OnViewFullScreen();
}


void CMainFrame::OnViewFullScreen()
{
TRACE("m_wndStatusBar == %d\n", m_wndStatusBar.IsWindowVisible());
TRACE("m_wndToolBar == %d\n", m_wndToolBar.IsWindowVisible());

if (m_pWndFullScreen != NULL)
{
// If we are returning the app to the Maximized state, SetWindowPlacement()
// draws the entire app twice - once to its "Normal" state, then once to
// the maximized state. The LockWindowUpdate() calls suppress the extra
// redraw.

ShowControlBar(&m_wndToolBar, m_bHadToolBar, FALSE);
ShowControlBar(&m_wndStatusBar, m_bHadStatusBar, FALSE);

m_pWndFullScreen->LockWindowUpdate();
m_pWndFullScreen->SetWindowPlacement(&m_PreviousPlace);
m_pWndFullScreen->UnlockWindowUpdate();

LockWindowUpdate();
SetWindowPlacement(&m_MainPreviousPlace);
UnlockWindowUpdate();
m_pWndFullScreen = NULL;
}
else
{
m_pWndFullScreen = MDIGetActive();
ASSERT(m_pWndFullScreen != NULL);

m_bHadToolBar = m_wndToolBar.IsWindowVisible();
m_bHadStatusBar = m_wndStatusBar.IsWindowVisible();
ShowControlBar(&m_wndToolBar, FALSE, FALSE);
ShowControlBar(&m_wndStatusBar,FALSE, FALSE);

m_pWndFullScreen->GetWindowPlacement(&m_PreviousPlace);
GetWindowPlacement(&m_MainPreviousPlace);

CRect rectDesktop;
if (!::SystemParametersInfo(SPI_GETWORKAREA, 0, &rectDesktop, 0))
::GetWindowRect(::GetDesktopWindow(), &rectDesktop);
else
{
rectDesktop.right = ::GetSystemMetrics(SM_CXSCREEN);
rectDesktop.bottom = ::GetSystemMetrics(SM_CYSCREEN);
rectDesktop.right -= rectDesktop.left;
rectDesktop.bottom -= rectDesktop.top;
rectDesktop.left = -rectDesktop.left;
rectDesktop.top = -rectDesktop.top;
}

TRACE("Going to (%d,%d) - (%d,%d)\n", rectDesktop.left, rectDesktop.top,
rectDesktop.right, rectDesktop.bottom);

CRect rectDesired = rectDesktop;
::AdjustWindowRect(&rectDesktop, GetStyle(), TRUE);

TRACE("Adjusted to (%d,%d) - (%d,%d)\n", rectDesktop.left, rectDesktop.top,
rectDesktop.right, rectDesktop.bottom);

rectDesktop.bottom += ::GetSystemMetrics(SM_CYBORDER); // See "Ask Dr. GUI #10"
m_FullScreenPlace = rectDesktop;
m_MainFullScreenPlace = rectDesktop;

WINDOWPLACEMENT wpNew = m_PreviousPlace;
wpNew.showCmd = SW_SHOWNORMAL;
wpNew.rcNormalPosition = rectDesktop;

LockWindowUpdate();
SetWindowPlacement(&wpNew);
UnlockWindowUpdate();

TRACE("Before MDI Child to (%d,%d) - (%d,%d)\n", wpNew.rcNormalPosition.left, wpNew.rcNormalPosition.top,
wpNew.rcNormalPosition.right, wpNew.rcNormalPosition.bottom);

wpNew.rcNormalPosition = rectDesired;
::AdjustWindowRect(&(wpNew.rcNormalPosition), m_pWndFullScreen->GetStyle(), FALSE);

TRACE("MDI Child to (%d,%d) - (%d,%d)\n", wpNew.rcNormalPosition.left, wpNew.rcNormalPosition.top,
wpNew.rcNormalPosition.right, wpNew.rcNormalPosition.bottom);

m_pWndFullScreen->LockWindowUpdate();
m_pWndFullScreen->SetWindowPlacement(&wpNew);
m_pWndFullScreen->UnlockWindowUpdate();
}
}
}

【更新至2025年】2001-2025年上市公司数字化转型年报词频统计(吴非、赵宸宇、甄红线)(300+年报词频统计) 1、时间:2001-2025年 2、来源:上市公司年报 3、参考文献:企业数字化转型与资本市场表现——来自股票流动性的经验证据(吴非) 数字化转型如何影响企业全要素生产率(赵宸宇) 知识产权行政保护与企业数字化转型(甄红线) 4、方法说明:(1)参考吴非老师的做法,对人工智能技术、大数据技术、云计算技术、区块链技术、数字技术运用五个维度76个数字化相关词频进行统计 (2)参考赵宸宇老师的做法,对数字技术应用、互联网商业模式、智能制造、现代信息系统四个维度99个数字化相关词频进行统计 (3)参考甄红线老师的做法,对技术分类、组织赋能、数字化应用等类别下139个数字化相关词频进行统计 5、指标:年份、股票代码、公司简称、行业名称、行业代码、全文-文本总长度、仅中英文-文本总长度、人工智能技术-吴、大数据技术-吴、云计算技术-吴、区块链技术-吴、数字技术运用-吴、数字技术应用-赵、互联网商业模式-赵、智能制造-赵、现代信息系统-赵、技术分类-人工智能技术-甄、技术分类-区块链技术-甄、技术分类-云计算技术-甄、技术分类-大数据技术-甄、组织赋能-人工智能技术-甄、组织赋能-云计算技术-甄、组织赋能-大数据技术-甄、组织赋能-广义数字技术-甄、数字化应用-技术创新-甄、数字化应用-流程创新-甄、数字化应用-业务创新-甄、人工智能、商业智能、图像理解、投资决策辅助系统、智能数据分析、智能机器人、机器学习、深度学习、语义搜索、生物识别技术、人脸识别、语音识别、身份验证、自动驾驶、自然语言处理、大数据、数据挖掘、文本挖掘、数据可视化、异构数据、征信、增强现实、混合现实、虚拟现实、云计算、流计算、图计算、内存计算、多方安全计算、类脑计算、绿色计算、认知计算等300+词频

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧