Ejemplo n.º 1
0
BOOL CopyRectDetector::checkWindowMovements(HWND hwnd)
{
    Rect currRect;
    if (IsWindowVisible(hwnd) && getWinRect(hwnd, &currRect)) {
        // Store window properties in the new list
        WinProp newWinProp(hwnd, &currRect);
        m_newWinProps.push_back(newWinProp);

        Rect prevRect;
        if (findPrevWinProps(hwnd, &prevRect)) {
            if ((prevRect.left != currRect.left || prevRect.top != currRect.top) &&
                    currRect.area() > m_copyRect.area()) {
                m_copyRect = currRect;
                m_source.setPoint(prevRect.left, prevRect.top);

                // Adjust
                int destopX = GetSystemMetrics(SM_XVIRTUALSCREEN);
                int destopY = GetSystemMetrics(SM_YVIRTUALSCREEN);
                m_copyRect.move(-destopX, -destopY);
                m_source.move(-destopX, -destopY);
            }
        }
    }
    return TRUE;
}
Ejemplo n.º 2
0
BOOL CopyRectDetector::checkWindowMovements(HWND hwnd)
{
    Rect currRect;
    if (IsWindowVisible(hwnd) && getWinRect(hwnd, &currRect)) {
        WinProp newWinProp(hwnd, &currRect);
        m_newWinProps->push_back(newWinProp);

        Rect prevRect;
        if (findPrevWinProps(hwnd, &prevRect)) {
            if (!prevRect.isEqualTo(&currRect) && currRect.area() > m_copyRect.area()) {
                m_copyRect = currRect;
                m_source.setPoint(prevRect.left, prevRect.top);

                int destopX = GetSystemMetrics(SM_XVIRTUALSCREEN);
                int destopY = GetSystemMetrics(SM_YVIRTUALSCREEN);
                m_copyRect.move(-destopX, -destopY);
                m_source.move(-destopX, -destopY);
            }
        }
    }
    return TRUE;
}