MFC去掉窗口右上方最大化最小化关闭按钮

本文介绍了如何在MFC应用程序中去除窗口右上方的标准操作按钮,包括最大化、最小化和关闭按钮。这些按钮的显示依赖于窗口创建时的特定风格,如WS_CAPTION和WS_SYSMENU。通过修改窗口风格,可以实现对这些按钮的控制。提供了两种实现方法,一种是在.h文件中修改窗口风格,另一种是在OnCreate函数中进行设置。
摘要由CSDN通过智能技术生成

MFC去掉窗口右上方最大化最小化关闭按钮 

简介:

最大化、最小化和关闭按钮是窗口中最主要的元素。首先要说明,说他们是按钮其实是不准确的,按钮是一种窗口,而这三个组件根本就不是窗口,而是一个窗口常见的组成部分。出于习惯的原因,这里还是称呼他们为按钮。

这三个按钮是否显示似乎只能在窗口创建是决定。首先,要显示这三个按钮,窗口必须有标题条和系统菜单,没有标题条和系统菜单的窗口是不能显示这三个按钮的,也就是说,要想有这三个按钮,创建窗口时必须有WS_CAPTION和WS_SYSMENU风格。当窗口创建时有风格WS_MAXI

MFC开发过程序所需的ModifyStyle(needDelStyle,needAddStyle,SWP_FRAMECHANGED); Sytel: WS_BORDER Creates a window that has a border. WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style. WS_CHILD Creates a child window. Cannot be used with the WS_POPUP style. WS_CHILDWINDOW Same as the WS_CHILD style. WS_CLIPCHILDREN Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window. WS_CLIPSIBLINGS Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only. WS_DISABLED Creates a window that is initially disabled. WS_DLGFRAME Creates a window with a double border but no title. WS_GROUP Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUP style FALSE after the first control belong to the same group. The next control with the WS_GROUP style starts the next group (that is, one group ends where the next begins). WS_HSCROLL Creates a window that has a horizontal scroll bar. WS_ICONIC Creates a window that is initially minimized. Same as the WS_MINIMIZE style. WS_MAXIMIZE Creates a window of maximum size. WS_MAXIMIZEBOX Creates a window that has a Maximize button. WS_MINIMIZE Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only. WS_MINIMIZEBOX Creates a window that has a Minimize button. WS_OVERLAPPED Creates an overlapped window. An overlapped window usually has a caption a
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值