WS_CLIPSIBLINGS 样式自动添加 [英] WS_CLIPSIBLINGS style automatically added

查看:22
本文介绍了WS_CLIPSIBLINGS 样式自动添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这种窗口样式创建了窗口:WS_CLIPCHILDREN |WS_POPUP |WS_BORDER |WS_SIZEBOX |WS_VISIBLE.

但由于未知原因 WS_CLIPSIBLINGS 样式会自动添加.

你知道这是什么原因吗?

示例代码:

hWnd = CreateWindowExW(0, szWindowClass, szTitle, WS_CLIPCHILDREN | WS_POPUP | WS_BORDER | WS_SIZEBOX | WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, Instance, NULL, NULL);

解决方案

添加 WS_CLIPSIBLINGS

重绘后

I created window with this window styles: WS_CLIPCHILDREN | WS_POPUP | WS_BORDER | WS_SIZEBOX | WS_VISIBLE.

But for unknown reason WS_CLIPSIBLINGS style is automatically added.

Do you somebody know reason for this?

Sample code:

hWnd = CreateWindowExW(0, szWindowClass, szTitle, WS_CLIPCHILDREN | WS_POPUP | WS_BORDER | WS_SIZEBOX | WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

解决方案

Only child windows are mentioned in the MSDN.

Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.

Actually, All overlapped and popup-style windows have WS_CLIPSIBLINGS properties. That is to say, you can't get rid of WS_CLIPSIBLINGS attributes and draw in its overlapping brothers'windows.

If it's just a child window, you can add WS_CLIPSIBLINGS yourself.

Add WS_CLIPSIBLINGS

After redrawing

这篇关于WS_CLIPSIBLINGS 样式自动添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆