WS_THICKFRAME风格去边角问题

ToCpp 2009-03-07 11:45:47
我的问题是如果窗体有WS_THICKFRAME样式,当使用rgn去边角时总是感觉右下角的坐标不太对劲,不知道为什么,是不是和WM_NCCALCSIZE有关呢,我响应这个消息貌似还是有问题,SM_CYSIZEFRAME获取到的值为4,但是用SPY看到的客户区矩形却是从(3,3)开始的,也就是客户区和非客户区之间的距离是3而不是4?
...全文
2489 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjj9850 2009-09-05
  • 打赏
  • 举报
回复
QQ2009内嵌的是"网页"了~~~已经不是普通的窗口唠~~~
和WPF有类似的机制了~~
lanlan014 2009-04-16
  • 打赏
  • 举报
回复
WS_THICKFRAME具体是什么含义啊。。。。。。
ToCpp 2009-03-10
  • 打赏
  • 举报
回复
响应WM_NCHITTEST消息确实可以实现边框拖动,但是好像窗体不能有WS_SYSMENU风格,这个对于一般窗体来说肯定是不行的,我看QQ系列可以改变窗口大小的软件都有WS_THICKFRAME风格,总体上边框拖动还是用系统自带的比较好。
菜牛 2009-03-10
  • 打赏
  • 举报
回复
要做异型窗口最好不要边框,否则本来边框被裁掉就不好看,自己绘制好了;处理边框的拖动也很简单,只要响应WM_NCHITTEST消息,在计算好的边框上分别返回需要的值即可(具体参考该消息)。
ToCpp 2009-03-09
  • 打赏
  • 举报
回复
但是QQ啊,好多界面都是这样的啊,虽然一般不加WS_CAPTION, WS_BORDER, WS_OVERLAPPEDWINDOW,但是WS_THICKFRAME还是需要的,要不还得自己模拟拖动大小效果
liuzxchina 2009-03-09
  • 打赏
  • 举报
回复
如果是改变窗口的形状,一般都不加WS_CAPTION, WS_BORDER, WS_OVERLAPPEDWINDOW, WS_THICKFRAME, WS_EX_STATICEDGE,等样式
abesky 2009-03-09
  • 打赏
  • 举报
回复
ws_thickframe风格的操作系统会自动加上border,所以你可以去掉此样式要么创建RGN时偏移一下
ToCpp 2009-03-08
  • 打赏
  • 举报
回复
为什么我发的帖子看不到呢?
ToCpp 2009-03-08
  • 打赏
  • 举报
回复
可能是说得不够明白吧,就是做一个带有ws_thickframe风格的不规则窗口应该注意哪些地方?
ToCpp 2009-03-08
  • 打赏
  • 举报
回复
嗯,感觉是偏移了,为什么去rgn会偏移呢,有没有这方面的介绍
abesky 2009-03-08
  • 打赏
  • 举报
回复
qq的没有WS_CAPTION样式和WS_EX_WINDOWEDGE,去除是rgn要偏移border的宽度
XP下面x坐标偏移GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXDLGFRAME)
y坐标GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION)
没有如果没有WS_CAPTION y只偏移GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME)
vista下好像还有点偏差
ToCpp 2009-03-07
  • 打赏
  • 举报
回复
刚用SPY看了QQ2009的界面,发现其窗口矩形和客户矩形是一样大小的,而且客户区坐标是从(0,0)开始的,而且也可以拖动大小,可以这样么?还是另有手段
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

15,981

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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