社区
界面
帖子详情
如何通过代码设置对话框的WS_CHILD或者WS_POPUP
flashzf
2006-03-14 06:06:29
我想创建非模态对话框.但是需要根据情况来确定是POPUP还是CHILD.
由于PreCreateWindow消息不响应.
我用CreateIndirect(),但是不成功,我也不清楚原因.
最好有例子代码.
...全文
460
6
打赏
收藏
如何通过代码设置对话框的WS_CHILD或者WS_POPUP
我想创建非模态对话框.但是需要根据情况来确定是POPUP还是CHILD. 由于PreCreateWindow消息不响应. 我用CreateIndirect(),但是不成功,我也不清楚原因. 最好有例子代码.
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xing_xing_xing
2006-03-16
打赏
举报
回复
先创建对话框,然后更改风格
CMyDlg *pDlg = new CMyDlg();
pDlg->Create(ID_DIALOG,this);
pDlg->ModifyStyle(WS_CHILD,0);
lamputa_lito
2006-03-16
打赏
举报
回复
更简单的是用ModifyStyle()
dnliophsam
2006-03-15
打赏
举报
回复
学习
liutaoxwl
2006-03-15
打赏
举报
回复
DWORD dwStyle = GetWindowLong(hWnd,GWL_STYLE);
if(dwStyle && WS_CHILD)
{
dwStyle &= ~WS_CHILD;// 去掉WS_CHILD风格
dwStyle |= WS_POPUP;// 设置WS_POPUP风格
}
else
{
dwStyle &= ~WS_POPUP;
dwStyle |= WS_CHILD;
}
SetWindowLong(hWnd,GWL_STYLE,dwStyle);
handsomerun
2006-03-15
打赏
举报
回复
可以用setwindowlong重新设置窗口的style
flashzf
2006-03-15
打赏
举报
回复
HELP!
WS
_
POPUP
WS
_OVERLAPPED
WS
_
CHILD
的区别 1
otherwise, pop-up windo
ws
are the same as overlapped windo
ws
of the
WS
_OVERLAPPE
MFC ModifyStyle
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
_
CHILD
WINDOW Same as the
WS
_
CHILD
style.
WS
_CLIP
CHILD
REN Excludes the area occupied by
child
windo
ws
when you draw within the parent window. Used when you create the parent window.
WS
_CLIPSIBLINGS Clips
child
windo
ws
relative to each other; that is, when a particular
child
window receives a paint message, the
WS
_CLIPSIBLINGS style clips all other overlapped
child
windo
ws
out of the region of the
child
window to be updated. (If
WS
_CLIPSIBLINGS is not given and
child
windo
ws
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
mfc 窗口分析
popup
,overlap,
child
http://blog.csdn.net/guogangj/archive/2008/12/06/3460267.aspx 网上的一篇帖子 (本文尝试通过一些简单的实验,来分析Windo
ws
的窗口机制,并对微软的设计理由进行一定的猜测,需要读者具备C++、Windo
ws
编程及MFC经验,还得有一定动手能力。文中可能出现一些术语不统一的现象,比如“子窗口”,有时候我写作“
child
window”,有时候写作“
child
”,我想应该不会有太大影响,文章太长,不一一更正了)
Change from
child
window to
popup
window (and back)(277KB)
Change from
child
window to
popup
window (and back)(277KB)
Windo
ws
Style
里面包含了所有Windo
ws
样式,是英文版的,不过很好理解
界面
15,978
社区成员
115,866
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章