zoukankan      html  css  js  c++  java
  • duilib解决窗口不能拖动的问题

    <Window size="280,400" caption="22,22,22,50" roundcorner="5,5" defaultfontcolor="#FFFFFBF0" caption="0,0,0,-1">

    caption="0,0,0,-1” 在windows的布局中,加入这个属性即可,别做其他的。

    网上说那些要重写 OnNcHitTest函数的,虽然能拖动 但是所有的鼠标点击事件没了。

    LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        POINT pt;
        RECT rcClient;
        RECT rcCaption;
    
        rcCaption = m_pm.GetCaptionRect();
        GetClientRect(m_pm.GetPaintWindow(), &rcClient);
        pt.x = GET_X_LPARAM(lParam);
        pt.y = GET_Y_LPARAM(lParam);
        ::ScreenToClient(m_pm.GetPaintWindow(), &pt);
    
        //xml中设置bottom为-1时,整个窗口区域都可以拖动  
        if (-1 == rcCaption.bottom) 
        {
            rcCaption.bottom = rcClient.bottom;
        }
    
        if ((pt.x >= rcClient.left)
            && (pt.x < rcClient.right)
            && (pt.y >= rcCaption.top)
            && (pt.y < rcCaption.bottom))
        {
                return HTCAPTION;
        }
    
        return __super::OnNcHitTest(uMsg, wParam, lParam, bHandled);
    }
  • 相关阅读:
    TortoiseGit
    申请成功
    web.xml文件中配置ShallowEtagHeaderFilter需注意的问题
    消息队列调研
    二阶段提交
    ACID CAP BASE介绍
    SQL NULL Values
    HTTPS原理
    ID生成器详解
    如何变得更聪明
  • 原文地址:https://www.cnblogs.com/132818Creator/p/14682109.html
Copyright © 2011-2022 走看看