zajiju 2016-11-23 07:36 采纳率: 0%
浏览 1020

VC 非客户区鼠标快速移动不响应

VC 非客户区鼠标快速移动不响应
移动到外面应该不是白的叉

  • 写回答

3条回答 默认 最新

  • zajiju 2016-11-23 07:37
    关注

    void CMyQQDlg::OnNcMouseMove(UINT nHitTest, CPoint point)
    {
    CDialog::OnNcMouseMove(nHitTest, point);

    #if 1
    CRect tempIni,tempMin,tempMax,ClientRect;

    CDC* pWindowDC = GetWindowDC();
    CDC memDC;
    memDC.CreateCompatibleDC(pWindowDC);
    
    BITMAPINFO bInfo;
    CBitmap LeftLine;
    int x,y;
    
    GetWindowRect(ClientRect);
    

    // tempIni.CopyRect(CRect(m_IniRect.left+ ClientRect.left,ClientRect.top+m_IniRect.top,m_IniRect.right+m_IniRect.left+ ClientRect.left,m_IniRect.bottom+m_IniRect.top+ClientRect.top));
    // tempMin.CopyRect(CRect(m_MinRect.left+ ClientRect.left,ClientRect.top+m_MinRect.top,m_MinRect.right+m_MinRect.left+ ClientRect.left,m_MinRect.bottom+m_MinRect.top+ClientRect.top));
    // tempMax.CopyRect(CRect(m_MaxRect.left+ ClientRect.left,ClientRect.top+m_MaxRect.top,m_MaxRect.right+m_MaxRect.left+ ClientRect.left,m_MaxRect.bottom+m_MaxRect.top+ClientRect.top));
    MytempClose.CopyRect(CRect(m_CloseRect.left+ ClientRect.left,ClientRect.top+m_CloseRect.top+5,m_CloseRect.right+m_CloseRect.left+ ClientRect.left,m_CloseRect.bottom+m_CloseRect.top+ClientRect.top));

    if (MytempClose.PtInRect(point))
    {
        LeftLine.LoadBitmap(IDB_BITMAP2);
        LeftLine.GetObject(sizeof(bInfo),&bInfo);
    
        x = bInfo.bmiHeader.biWidth;
        y = bInfo.bmiHeader.biHeight;
        memDC.SelectObject(&LeftLine);
        pWindowDC->StretchBlt(m_CloseRect.left,m_CloseRect.top+5,m_CloseRect.right,m_CloseRect.bottom,&memDC,0,0,x,y,SRCCOPY);
        //m_IsDrawForm = FALSE;
        //m_ButtonState = bsClose;//////记录当前光标位置所在的按钮
        LeftLine.DeleteObject();            
    }
    else
    {
        LeftLine.LoadBitmap(IDB_BITMAP1);
        LeftLine.GetObject(sizeof(bInfo),&bInfo);
    
        x = bInfo.bmiHeader.biWidth;
        y = bInfo.bmiHeader.biHeight;
        memDC.SelectObject(&LeftLine);
        pWindowDC->StretchBlt(m_CloseRect.left,m_CloseRect.top+5,m_CloseRect.right,m_CloseRect.bottom,&memDC,0,0,x,y,SRCCOPY);
        //m_IsDrawForm = FALSE;
        //m_ButtonState = bsClose;//////记录当前光标位置所在的按钮
        LeftLine.DeleteObject();    
        //DrawForm();
    }
    

    #endif

    评论

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R