窗口框架不在Windows 10上重绘 [英] Window frame not redraw on Windows 10

查看:54
本文介绍了窗口框架不在Windows 10上重绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的SW系统中,我实施了一个 浮动工具栏,它在Windows 7上运行正常,但在更改为Windows  10之后,存在一些问题。当在工具栏上移动另一个窗口然后移出时,右框架和底框架不会重新绘制。


窗口类继承自CWnd,请参阅下面的代码。如果删除WS_EX_TOOLWINDOW样式,则工具栏显示正确。

 BOOL CTGraphics :: Create(LPCTSTR lpszWindowName,const RECT& rect,CWnd * pParentWnd)
{
DWORD dwStyle = WS_POPUP | WS_CLIPSIBLINGS | WS_SYSMENU | WS_CAPTION;
DWORD dwExStyle = WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE | WS_EX_LEFT | WS_EX_LTRREADING;

int nWidth,nHeight;
POINT tpoint;
nWidth = 50;
nHeight = 100;
tpoint.x = 0;
tpoint.y = 0;

BOOL result = CreateEx(dwExStyle,AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW),lpszWindowName,dwStyle,tpoint.x,tpoint.y,nWidth,nHeight,pParentWnd-> GetSafeHwnd(),(HMENU)0 );

返回结果;
}




解决方案

您好,


感谢您在此处发帖。


> >在我的SW系统中,我实现了一个浮动工具栏,它在Windows 7上工作正常,但在更改为Windows 10之后,存在一些问题。当在工具栏上移动另一个窗口然后移出时,右框架和底框架不会重新绘制。


请提供有关项目和CTGraphics类的更多信息。或者,如果您能够通过分享我们的演示项目来重现您的问题,那就更好了。


最诚挚的问候,


Baron Bi








In my SW system, I've implemented a floating toolbar, it works fine on Windows 7, but after change to Windows 10, there's some problem. When move another window over the toolbar then move out, the right and bottom frame are not redrawn.

The window class is inherited from CWnd, see code bellow. If remove WS_EX_TOOLWINDOW style, the toolbar show correctly.

BOOL CTGraphics::Create(LPCTSTR lpszWindowName, const RECT& rect,CWnd* pParentWnd)
{
    DWORD dwStyle   = WS_POPUP|WS_CLIPSIBLINGS|WS_SYSMENU|WS_CAPTION;
    DWORD dwExStyle = WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE|WS_EX_LEFT|WS_EX_LTRREADING;

    int nWidth,nHeight;
    POINT tpoint;
    nWidth  = 50;
    nHeight = 100;
    tpoint.x = 0 ;
    tpoint.y = 0;

    BOOL result = CreateEx(dwExStyle, AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW), lpszWindowName, dwStyle, tpoint.x, tpoint.y, nWidth, nHeight, pParentWnd->GetSafeHwnd(), (HMENU)0);

    return result;
}


解决方案

Hi,

thanks for posting here.

>>In my SW system, I've implemented a floating toolbar, it works fine on Windows 7, but after change to Windows 10, there's some problem. When move another window over the toolbar then move out, the right and bottom frame are not redrawn.

Please provide more information about your project and CTGraphics class. Or it could be better if you could share us a demo project to reproduce your issue.

Best Regards,

Baron Bi


这篇关于窗口框架不在Windows 10上重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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